04.03.2013 Views

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

RL78/D1A User's Manual: Hardware - Renesas

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Under development<br />

Preliminary document<br />

Specifications in this document are tentative and subject to change.<br />

<strong>RL78</strong>/<strong>D1A</strong> CHAPTER 14 CAN CONTROLLER<br />

14.9.5 Multi buffer receive block function<br />

The multi buffer receive block (MBRB) function is used to store a block of data in two or more message buffers<br />

sequentially with no CPU interaction, by setting the same ID to two or more message buffers with the same message<br />

buffer type.<br />

Suppose, for example, the same message buffer type is set to 5 message buffers, message buffers 10 to 14, and the<br />

same ID is set to each message buffer. If the first message whose ID matches the ID of the message buffers is received,<br />

it is stored in message buffer 10. At this point, the DN bit of message buffer 10 is set, prohibiting overwriting the message<br />

buffer when subsequent messages are received.<br />

If the next message with a matching ID is received, it is received and stored in message buffer 11. Each time a<br />

message with a matching ID is received, it is sequentially (in the ascending order) stored in message buffers 12, 13, and<br />

14. Even when a data block consisting of multiple messages is received, the messages can be stored and received<br />

without overwriting the previously received matching-ID data.<br />

Whether a data block has been received and stored can be checked by setting the IE bit of the C0MCTRLm register of<br />

each message buffer. For example, if a data block consists of k messages, k message buffers are initialized for reception<br />

of the data block. The IE bit in message buffers 0 to (k-2) is cleared to 0 (interrupts disabled), and the IE bit in message<br />

buffer k-1 is set to 1 (interrupts enabled). In this case, a reception completion interrupt occurs when a message has been<br />

received and stored in message buffer k-1, indicating that MBRB has become full. Alternatively, by clearing the IE bit of<br />

message buffers 0 to (k-3) and setting the IE bit of message buffer k-2, a warning that MBRB is about to overflow can be<br />

issued.<br />

The basic conditions of storing receive data in each message buffer for the MBRB are the same as the conditions of<br />

storing data in a single message buffer.<br />

Cautions 1. MBRB can be configured for each of the same message buffer types. Therefore, even if a<br />

message buffer of another MBRB whose ID matches but whose message buffer type is<br />

different has a vacancy, the received message is not stored in that message buffer, but instead<br />

discarded.<br />

2. MBRB does not have a ring buffer structure. Therefore, after a message is stored in the<br />

message buffer having the highest number in the MBRB configuration, a newly received<br />

message will not be stored in the message buffer having the lowest message buffer number.<br />

3. MBRB operates based on the reception and storage conditions; there are no settings dedicated<br />

to MBRB, such as function enable bits. By setting the same message buffer type and ID to two<br />

or more message buffers, MBRB is automatically configured.<br />

4. With MBRB, "matching ID" means "matching ID after mask". Even if the ID set to each<br />

message buffer is not the same, if the ID that is masked by the mask register matches, it is<br />

considered a matching ID and the buffer that has this ID is treated as the storage destination of<br />

a message.<br />

5. The priority between MBRBs is mentioned in 14.9.1 Message Reception.<br />

Remark m = 0 to 15<br />

R01UH0317EJ0004 Rev. 0.04 891<br />

Feb. 22, 2013

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!