EasyManua.ls Logo

NXP Semiconductors MPC5606S - Receive Process

NXP Semiconductors MPC5606S
1344 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
FlexCAN
MPC5606S Microcontroller Reference Manual, Rev. 7
Freescale Semiconductor 699
if LBUF is negated and LPRIO_EN is asserted, then the PRIO bits augment the ID used during the
arbitration process. With this extended ID concept, arbitration is done based on the full 32-bit ID, and the
PRIO bits define which MB should be transmitted first—therefore MBs with PRIO = 000 have higher
priority. If two or more MBs have the same priority, the regular ID will determine the priority of
transmission. If two or more MBs have the same priority (three extra bits) and the same regular ID, the
lowest MB will be transmitted first.
Once the highest priority MB is selected, it is transferred to a temporary storage space called Serial
Message Buffer (SMB), which has the same structure as a normal MB but is not user accessible. This
operation is called move-out, and after it is done write access to the corresponding MB is blocked (if the
AEN bit in MCR is asserted). The write access is released in the following events:
After the MB is transmitted
FlexCAN enters in Halt or Bus Off
FlexCAN loses the bus arbitration or there is an error during the transmission
At the first opportunity window on the CAN bus, the message on the SMB is transmitted according to the
CAN protocol rules. FlexCAN transmits up to eight data bytes, even if the DLC (Data Length Code) value
is bigger.
18.4.4 Receive process
To be able to receive CAN frames in the mailbox MBs, the CPU must prepare one or more Message
Buffers for reception by executing the following steps:
1. If the MB has a pending transmission, write an ABORT code (1001) to the Code field of the
Control and Status word to request an abortion of the transmission, then read back the Code field
and the IFRL/IFRH registers to check if the transmission was aborted (see Section 18.4.6.1,
Transmission abort mechanism). If backwards compatibility is desired (AEN in MCR negated),
just write 1000 to the Code field to inactivate the MB, but be aware that in this case the pending
frame may be transmitted without notification (see Section 18.4.6.2, Message Buffer deactivation).
If the MB is already programmed as a receiver, just write 0000 to the Code field of the Control and
Status word to keep the MB inactive.
2. Write the ID word.
3. Write 0100 to the Code field of the Control and Status word to activate the MB.
Once the MB is activated in the third step, it will be able to receive frames that match the programmed ID.
At the end of a successful reception, the MB is updated by the MBM as follows:
1. The value of the Free Running Timer is written into the Time Stamp field.
2. The received ID, Data (8 bytes at most), and Length fields are stored.
3. The Code field in the Control and Status word is updated (see Table 18-5 and Table 18-6 in
Section 18.3.2, Message Buffer structure).
4. A status flag is set in the Interrupt Flag Register and an interrupt is generated if allowed by the
corresponding Interrupt Mask Register bit.

Table of Contents

Related product manuals