English
Language : 

SAM7X128_14 Datasheet, PDF (502/662 Pages) ATMEL Corporation – ARM-based Flash MCU
36.7.3.7 Producer Configuration
A mailbox is in Producer Mode once the MOT field in the CAN_MMRx register has been configured. Message ID and
Message Acceptance masks must be set before Receive Mode is enabled.
After Producer Mode is enabled, the MRDY flag in the CAN_MSR register is automatically set until the first transfer
command. The software application prepares data to be sent by writing to the CAN_MDHx and the CAN_MDLx registers,
then by setting the MTCR bit in the CAN_MCRx register. Data is sent after the reception of a remote frame as soon as it
wins the bus arbitration.
The MRDY flag remains at zero as long as the message has not been sent or aborted. No access to the mailbox data
register can be done while MRDY flag is cleared. An interrupt is pending for the mailbox while the MRDY flag is set. This
interrupt can be masked according to the mailbox flag in the CAN_IMR global register.
If a remote frame is received while no data are ready to be sent (signal MRDY set in the CAN_MSRx register), then the
MMI signal is set in the CAN_MSRx register. This bit is cleared by reading the CAN_MSRx register.
The MRTR field in the CAN_MSRx register has no meaning. This field is used only when using Receive and Receive with
Overwrite modes.
After a remote frame has been received, the mailbox functions like a transmit mailbox. The message with the highest
priority is sent first. The transmitted message may be aborted by setting the MACR bit in the CAN_MCR register. Please
refer to the section “Transmission Handling” on page 500.
Figure 36-17. Producer Handling
CAN BUS
Remote Frame
MRDY
(CAN_MSRx)
MMI
(CAN_MSRx)
MTCR
(CAN_MCRx)
Message 1
Remote Frame
Reading CAN_MSRx
Remote Frame Message 2
(CAN_MDLx
CAN_MDHx) Message 1
Message 2
36.7.3.8 Consumer Configuration
A mailbox is in Consumer Mode once the MOT field in the CAN_MMRx register has been configured. Message ID and
Message Acceptance masks must be set before Receive Mode is enabled.
After Consumer Mode is enabled, the MRDY flag in the CAN_MSR register is automatically cleared until the first transfer
request command. The software application sends a remote frame by setting the MTCR bit in the CAN_MCRx register or
the MBx bit in the global CAN_TCR register. The application is notified of the answer by the MRDY flag set in the
CAN_MSRx register. The application can read the data contents in the CAN_MDHx and CAN_MDLx registers. An
interrupt is pending for the mailbox while the MRDY flag is set. This interrupt can be masked according to the mailbox
flag in the CAN_IMR global register.
The MRTR bit in the CAN_MCRx register has no effect. This field is used only when using Transmit Mode.
After a remote frame has been sent, the consumer mailbox functions as a reception mailbox. The first message received
is stored in the mailbox data registers. If other messages intended for this mailbox have been sent while the MRDY flag
is set in the CAN_MSRx register, they will be lost. The application is notified by reading the MMI field in the CAN_MSRx
register. The read operation automatically clears the MMI flag.
If several messages are answered by the Producer, the CAN controller may have one mailbox in consumer
configuration, zero or several mailboxes in Receive Mode and one mailbox in Receive with Overwrite Mode. In this case,
SAM7X Series [DATASHEET]
6120K–ATARM–11-Feb-14
502