English
Language : 

AT91SAM7XC256 Datasheet, PDF (553/675 Pages) ATMEL Corporation – Thumb-based Microcontrollers
Figure 39-16. Producer / Consumer Model
Producer
Request
AT91SAM7XC256/128 Preliminary
PUSH MODEL
CAN Data Frame
Consumer
Indication(s)
Producer
Indications
PULL MODEL
CAN Remote Frame
Consumer
Request(s)
Response
CAN Data Frame
Confirmation(s)
In Pull Mode, a consumer transmits a remote frame to the producer. When the producer
receives a remote frame, it sends the answer accepted by one or many consumers. Using
transmit and receive mailboxes, a consumer must dedicate two mailboxes, one in Transmit
Mode to send remote frames, and at least one in Receive Mode to capture the producer’s
answer. The same structure is applicable to a producer: one reception mailbox is required to
get the remote frame and one transmit mailbox to answer.
Mailboxes can be configured in Producer or Consumer Mode. A lonely mailbox can handle the
remote frame and the answer. With 8 mailboxes, the CAN controller can handle 8 independent
producers/consumers.
Producer Configuration
A mailbox is in Producer Mode once the MOT field in the CAN_MMRx register has been con-
figured. 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.
6209B–ATARM–10-Feb-06
553