AN2283 Freescale Semiconductor / Motorola, AN2283 Datasheet - Page 34

no-image

AN2283

Manufacturer Part Number
AN2283
Description
Scalable Controller Area Network (MSCAN)
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2283/D
34
Notes:
1. In order to clear the bits in the CRFLG register write a 1 to the bit while it’s set.
2. An exclusive OR operation 1
3. Do not use the BSET instructions to clear bits. However, the LDA and STA instructions can be used. Take care that any
TRANSMITTER WARNING
IN THE CRIER REGISTER
USER INTERRUPT CODE
END OF TRANSMITTER
WARNING INTERRUPT
CLEAR TWRNIE = 0
C compiler being used does not use the BSET instructions.
CLEAR TERRIF = 0
SET TERRIE = 1
(SEE NOTES)
ADDITIONAL
INTERRUPT
(96 <= TEC <128)
TWRNIF = 1
Figure 24. Example Transmitter Error Interrupt Flowchart
BEGINNING OF THE APPLICATION CODE
Motorola Scalable Controller Area Network (MSCAN) Interrupts
AND ENABLE TWRNIE = 1
IN THE CRIER REGISTER
USER INTERRUPT CODE
Freescale Semiconductor, Inc.
END OF TRANSMITTER
TRANSMITTER ERROR
ERROR INTERRUPTS
ENABLE TERRIE = 1
ERROR INTERRUPT
CLEAR TWRNIF = 0
CLEAR TERRIE = 0
READ THE CRFLG
1 = 0 is performed on the bit.
INITIALIZE CHIP
(REC = TEC = 0)
SET TWRNIE = 1
For More Information On This Product,
(SEE NOTES)
ADDITIONAL
INTERRUPT
REGISTER
TERRIF = 1
(128 <= TEC <= 255)
Go to: www.freescale.com
CLEAR SFTRST = 0 IN CMCR0.
BOFFIF = 1
(TEC > 255)
SET SRTRST =1 IN CMCR0.
AS IN THE BEGINNING OF
THE APPLICATION CODE.
USER INTERRUPT CODE
AND READ BACK BOFFIF
REINITIALIZE THE CAN
BUS OFF INTERRUPT
CLEAR TWRNIF = 0
CLEAR BOFFIF = 0
(SEE NOTES)
(SEE NOTES)
ADDITIONAL
INTERRUPT
BUS OFF
END OF
TEC < 96
BOFFIF = 0
END OF THE MAIN LINE CODE
USE THE POLLING METHOD
USE THE POLLING METHOD
IN MAIN LINE CODE
CLEAR TWRNIF = 0
READ THE TWRNIF
BIT IN THE CRIER
(SEE NOTES)
TWRNIE = 1
REGISTER
TWRNIF = 0
MOTOROLA
TWRNIF = 1

Related parts for AN2283