| Motore di ricerca datesheet componenti elettronici |
|
AN2341 Scheda tecnica(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2341 Scheda tecnica(HTML) 7 Page - STMicroelectronics |
|
7 / 26 page ![]() AN2341 Handling interrupts 7/26 Note: This example assumes that a ‘switch on IntId’ instruction is placed at the beginning of the interrupt driver: case (intid): // Message n specific interrupt CANxIF1CM = 0x7F; // Transfer entire message into inference CANxIF1CR = intid; // register and clear IntPnd and NewDat CANx_WAIT_FOR_IF1; if (CANxIF1A2 & IF_DIR) // direction = transmit { if (CANxIF1MC & IF_NEWDAT) // remote received provided that // UMask =1 and RmtEn = 0 {.....} // procedure to handle answer to remote else {.....} // procedure to handle transmit interrupts } else // direction = receive { if (CANxIF1MC & IF_NEWDAT) // NewDat is set {.....} // procedure to handle data receive interrupt else {.....} // a remote frame was successfully transmitted } break; 2.2 Bus-off interrupts Each transfer error detected on the CAN bus (though not necessarily generated by the CAN module) increments one of the two error counters (receive error counter and transmit error counter). If one of these counters reaches the value of 96, bit EWarn is set. If enabled by bits EIE and IE, an error interrupt is generated. If the transmit error counter exceeds the value of 255, bit BOff is set. If enabled by bits EIE and IE, this generates an error interrupt. Furthermore, when the device goes into the bus-off state, bit INIT is set and all actions on the bus are stopped immediately. The bus-off recovery sequence can be initiated from the bus-off state. During the bus recovery sequence, the CAN module monitors the recovery sequence. ● The bus-off recovery sequence is started by resetting bit INIT. ● Bit0Error is set every time a sequence of 11 recessive bits is detected. Bit0Error indicates that the CAN bus is not stuck at dominant or not continuously disturbed. If bits SIE and IE are set, a status interrupt is generated after each sequence. ● The recovery sequence cannot be shortened by setting or resetting bit INIT. |
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore 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 |