English
Language : 

CP3BT23_14 Datasheet, PDF (140/324 Pages) Texas Instruments – CP3BT23 Reprogrammable Connectivity Processor with Bluetooth and Dual CAN Interfaces
CP3BT23
SNOSCX3A – JULY 2013 – REVISED JANUARY 2014
www.ti.com
18.5.2 Receive Procedure
Software executes the following procedure to initialize a message buffer for the reception of a CAN
message.
1. Configure the receive masks (GMASK or BMASK).
2. Configure the buffer ID.
3. Configure the message buffer status as RX_READY.
To read the out of a received message, the CPU must execute the following steps (see Figure 18-21):
Read buffer
Read CNSTAT
Yes
RX_READY?
No
Yes
RX_BUSYx?
No
Interrupt Entry Point
RX_OVERRUN?
(optional, for information)
Write RX_READY
Read buffer (id/data/control)
Read CNSTAT
Ye s
RX_BUSYx?
No
RX_FULL or
Ye s
RX_OVERRUN?
No
Clear RX_PND
Exit
DS038
Figure 18-21. Buffer Read Routine (BUFFLOCK Disabled)
The first step is only applicable if polling is used to get the status of the receive buffer. It can be deleted
for an interrupt driven receive routine.
1. Read the status (CNSTAT) of the receive buffer. If the status is RX_READY, no was the message
received, so exit. If the status is RX_BUSY, the copy process from hidden receive buffer is not
completed yet, so read CNSTAT again.
If a buffer is configured to RX_READY and its interrupt is enabled, it will generate an interrupt as soon
as the buffer has received a message and entered the RX_FULL state (see also Section 18.7). In that
case the procedure described below must be followed.
2. Read the status to determine if a new message has overwritten the one originally received which
triggered the interrupt.
3. Write RX_READY into CNSTAT.
4. Read the ID/data and object control (DLC/RTR) from the message buffer.
5. Read the buffer status again and check it is not RX_BUSYx. If it is, repeat this step until RX_BUSYx
has gone away.
6. If the buffer status is RX_FULL or RX_OVERRUN, one or more messages were copied. In that case,
start over with step 2.
7. If status is still RX_READY (as set by the CPU at step 2), clear interrupt pending bit and exit.
140 CAN Module
Submit Documentation Feedback
Product Folder Links: CP3BT23
Copyright © 2013–2014, Texas Instruments Incorporated