Atmel Evaluation Kit AT91SAM9X25-EK AT91SAM9X25-EK Scheda Tecnica

Codici prodotto
AT91SAM9X25-EK
Pagina di 1151
917
SAM9X25 [DATASHEET]
11054E–ATARM–10-Mar-2014
41.8.3.3  Remote Frame Handling
Producer/consumer model is an efficient means of handling broadcasted messages. The push model allows a producer 
to broadcast messages; the pull model allows a customer to ask for messages.
Figure 41-16.Producer / Consumer Model
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 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 
.
CAN Data Frame
CAN Remote Frame
CAN Data Frame
Indication(s)
Request
Request(s)
Indications
Response
Confirmation(s)
PUSH MODEL
PULL MODEL
Producer
Producer
Consumer
Consumer