Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

AN2341 Scheda tecnica(PDF) 7 Page - STMicroelectronics

Il numero della parte AN2341
Spiegazioni elettronici  Programming ST10F27x/F25x CAN interrupt drivers
PDF  26 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  STMICROELECTRONICS [STMicroelectronics]
Homepage  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN2341 Scheda tecnica(HTML) 7 Page - STMicroelectronics

Back Button AN2341 Datasheet HTML 3Page - STMicroelectronics AN2341 Datasheet HTML 4Page - STMicroelectronics AN2341 Datasheet HTML 5Page - STMicroelectronics AN2341 Datasheet HTML 6Page - STMicroelectronics AN2341 Datasheet HTML 7Page - STMicroelectronics AN2341 Datasheet HTML 8Page - STMicroelectronics AN2341 Datasheet HTML 9Page - STMicroelectronics AN2341 Datasheet HTML 10Page - STMicroelectronics AN2341 Datasheet HTML 11Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 7 / 26 page
background image
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.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


Scheda tecnica Scarica

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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