| 数据搜索系统,热门电子元器件搜索 |
|
AN2341 数据表(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2341 数据表(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. |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |