|
MC9S12KG128_10 Datasheet, PDF (327/606 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers | |||
|
◁ |
Chapter 9 Freescaleâs Scalable Controller Area Network (S12MSCANV2)
âMSCAN Receiver Flag Register (CANRFLG)â and Section 9.3.2.6, âMSCAN Receiver Interrupt
Enable Register (CANRIER)â).
9.4.7.6 Interrupt Acknowledge
Interrupts are directly associated with one or more status ï¬ags in either the Section 9.3.2.5, âMSCAN
Receiver Flag Register (CANRFLG)â or the Section 9.3.2.7, âMSCAN Transmitter Flag Register
(CANTFLG).â Interrupts are pending as long as one of the corresponding ï¬ags is set. The ï¬ags in
CANRFLG and CANTFLG must be reset within the interrupt handler to handshake the interrupt. The ï¬ags
are reset by writing a 1 to the corresponding bit position. A ï¬ag cannot be cleared if the respective
condition prevails.
NOTE
It must be guaranteed that the CPU clears only the bit causing the current
interrupt. For this reason, bit manipulation instructions (BSET) must not be
used to clear interrupt ï¬ags. These instructions may cause accidental
clearing of interrupt ï¬ags which are set after entering the current interrupt
service routine.
9.4.7.7 Recovery from Stop or Wait
The MSCAN can recover from stop or wait via the wake-up interrupt. This interrupt can only occur if the
MSCAN was in sleep mode (SLPRQ = 1 and SLPAK = 1) before entering power down mode, the wake-up
option is enabled (WUPE = 1), and the wake-up interrupt is enabled (WUPIE = 1).
9.5 Initialization/Application Information
9.5.1 MSCAN initialization
The procedure to initially start up the MSCAN module out of reset is as follows:
1. Assert CANE
2. Write to the conï¬guration registers in initialization mode
3. Clear INITRQ to leave initialization mode and enter normal mode
If the conï¬guration of registers which are writable in initialization mode needs to be changed only when
the MSCAN module is in normal mode:
1. Bring the module into sleep mode by setting SLPRQ and awaiting SLPAK to assert after the CAN
bus becomes idle.
2. Enter initialization mode: assert INITRQ and await INITAK
3. Write to the conï¬guration registers in initialization mode
4. Clear INITRQ to leave initialization mode and continue in normal mode
MC9S12KG128 Data Sheet, Rev. 1.16
Freescale Semiconductor
327
|
▷ |