Datasheet

Section 15 Controller Area Network for Tiny (TinyCAN)
Rev. 4.00 Mar. 15, 2006 Page 340 of 556
REJ09B0026-0400
15.5.5 Reconfiguring Mailbox
A Mailbox can be reconfigured using the following procedure:
Changing CAN-ID and MBCR of Transmit Mailbox: Make sure that the bit corresponding to
the Mailbox in TXPR is not set to 1. The identifier of the transmit Mailbox and corresponding
MBCR bit can be changed at any time. If both of them need to be changed, change the identifier
first, clear RXPR and RFPR to 0, and then change MBCR.
Changing CAN-ID, MBCR, and LAFM of Receive Mailbox:
<Method 1: Halt mode (see figure 15.17)>
1. Set the HLTRQ bit in MCR bit to 1.
2. Determine whether the TinyCAN is during transmission or reception, or in the bus off state
and wait for recovery from transmission, reception, or bus off state.
3. The TinyCAN enters halt mode at the first bit in the intermission frame of the message and
sets the RHI bit in TCIRR0 and the HALT bit in GSR to 1. Note that the TinyCAN cannot
transmit or receive a message in halt mode.
4. Confirm that the RHI bit in TCIRR0 and the HALT bit in GSR are both set to 1 before
changing settings of the identifier, LAFM, and the MBn bit in MBCR of the Mailbox.
5. When the HLTRQ bit in MCR is cleared to 0, the TinyCAN returns to normal operation after
11 recessive bits have been continuously received.
<Method 2: Other than halt mode (see figure 15.17)>
1. Set the MBn bit in MBIMR for the corresponding Mailbox to 1 to disable interrupts. (n = 0 to
3)
2. Determine whether the MBn bits in RXPR and RFPR are cleared to 0 to confirm that there are
no receive messages.
3. Change the settings of the identifier, LAFM, and the MBn bit in MBCR in the Mailbox.
4. Determine whether the MBn bits in RXPR and RFPR are cleared to 0 to confirm that no
message is received during reconfiguration. The function of MBIMR is not to prevent RXPR,
RFPR, or the OVRI bit in TCIRR1 from being set.
5. At this time, when the MBn bit in RXPR or RFPR is set to 1, clear the relevant bit to 0. Delete
the receive message because it cannot be determined whether the message was addressed to the
new Mailbox ID or the old Mailbox ID.
6. Then clear the MBn bit in MBIMR for the corresponding Mailbox to 0. The TinyCAN returns
to normal operation.