| Electronic Components Datasheet Search |
|
AN1105 Datasheet(PDF) 36 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1105 Datasheet(HTML) 36 Page - STMicroelectronics |
|
36 / 100 page ![]() 36/100 ST7 pCAN PERIPHERAL DRIVER ADC_Init(); //Initializes the ADC if ((CAN_First_Init())==CAN_INIT_FAILURE) //Initializes the CAN peripheral { return; } TIMA_Init();//Initializes the timer _asm(“RIM”);// EnableInterrupts; /* ------------------- */ /*---------------------------- LOOP --------------------------*/ while (1) /* ------------------- */ { } } Finished! Now compile the entire code and run the software. Once the while {1} loop is en- tered, the microcontroller will run non-stop until it is shut down, reacting to every event, saving data in our buffer, sending data periodically and answering remote requests. If you own a CAN bus simulation tool, you can monitor messages being received and sent by the ST7. The next section of this application note will explain in detail the driver architecture and all soft- ware functions (including internal functions). 2.2.5 IMPORTANT: Reentrant Functions If the memory model you chose for compiling your application does not use the physical stack but simulates it in RAM, you CANNOT allow functions to be reentrant. The COSMIC compiler will generate an error if it finds some code that could be reentrant. For example, this may occur if you use a subroutine inside both an initialization function and an in- terrupt routine. This is, of course, not a real error, but the compiler does not know this and prevents you from going further. To fix this problem with the COSMIC compiler, use the following trick: – Change the name of the function in your code, in the call that makes the error appear. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |