![NXP Semiconductors MPC5605BK Скачать руководство пользователя страница 581](http://html.mh-extra.com/html/nxp-semiconductors/mpc5605bk/mpc5605bk_reference-manual_1721852581.webp)
Chapter 25 FlexCAN
MPC5606BK Microcontroller Reference Manual, Rev. 2
Freescale Semiconductor
579
25.5.5
Receive process
To be able to receive CAN frames into 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 IFLAG register to check if the transmission was aborted (see
). If backwards compatibility is desired (AEN in MCR negated),
just write 1000 to the Code field to inactivate the MB, but then the pending frame may be
transmitted without notification (see
Section 25.5.7.2, Message buffer deactivation
). If the MB
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
Section 25.4.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.
Upon receiving the MB interrupt, the CPU should service the received frame using the following
procedure:
1. Read the Control and Status word (mandatory – activates an internal lock for this buffer).
2. Read the ID field (optional – needed only if a mask was used).
3. Read the Data field.
4. Read the Free Running Timer (optional – releases the internal lock).
Upon reading the Control and Status word, if the BUSY bit is set in the Code field, then the CPU should
defer the access to the MB until this bit is negated. Reading the Free Running Timer is not mandatory. If
not executed the MB remains locked, unless the CPU reads the C/S word of another MB. Note that only a
single MB is locked at a time. The only mandatory CPU read operation is the one on the Control and Status
word to assure data coherency (see
Section 25.5.7, Data coherence
The CPU should synchronize to frame reception by the status flag bit for the specific MB in one of the
IFLAG registers and not by the Code field of that MB. Polling the Code field does not work because once
a frame was received and the CPU services the MB (by reading the C/S word followed by unlocking the
MB), the Code field will not return to EMPTY. It will remain FULL, as explained in
. If the CPU
tries to workaround this behavior by writing to the C/S word to force an EMPTY code after reading the
MB, the MB is actually deactivated from any currently ongoing matching process. As a result, a newly
received frame matching the ID of that MB may be lost. In summary:
never do polling by reading directly
the C/S word of the MBs. Instead, read the IFLAG registers.
Содержание MPC5605BK
Страница 2: ...This page is intentionally left blank...
Страница 20: ...MPC5606BK Microcontroller Reference Manual Rev 2 20 Freescale Semiconductor...
Страница 103: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 103 Clocks and power...
Страница 104: ...MPC5606BK Microcontroller Reference Manual Rev 2 104 Freescale Semiconductor This page is intentionally left blank...
Страница 243: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 243 Core platform modules...
Страница 244: ...MPC5606BK Microcontroller Reference Manual Rev 2 244 Freescale Semiconductor This page is intentionally left blank...
Страница 395: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 395 Communication modules...
Страница 396: ...MPC5606BK Microcontroller Reference Manual Rev 2 396 Freescale Semiconductor This page is intentionally left blank...
Страница 548: ...Chapter 24 LIN Controller LINFlexD MPC5606BK Microcontroller Reference Manual Rev 2 548 Freescale Semiconductor...
Страница 645: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 643 Timers...
Страница 646: ...MPC5606BK Microcontroller Reference Manual Rev 2 644 Freescale Semiconductor This page is intentionally left blank...
Страница 715: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 713 ADC system...
Страница 716: ...MPC5606BK Microcontroller Reference Manual Rev 2 714 Freescale Semiconductor This page is intentionally left blank...
Страница 787: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 787 Memory...
Страница 788: ...MPC5606BK Microcontroller Reference Manual Rev 2 788 Freescale Semiconductor This page is intentionally left blank...
Страница 893: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 893 Integrity...
Страница 894: ...MPC5606BK Microcontroller Reference Manual Rev 2 894 Freescale Semiconductor This page is intentionally left blank...
Страница 943: ...MPC5606BK Microcontroller Reference Manual Rev 2 Freescale Semiconductor 943 Debug...
Страница 944: ...MPC5606BK Microcontroller Reference Manual Rev 2 944 Freescale Semiconductor This page is intentionally left blank...