Atmel Xplained Pro Evaluation Kit ATSAM4E-XPRO ATSAM4E-XPRO データシート

製品コード
ATSAM4E-XPRO
ページ / 1506
675
SAM4E [DATASHEET]
Atmel-11157D-ATARM-SAM4E16-SAM4E8-Datasheet_12-Jun-14
Producer Configuration
A mailbox is in Producer Mode once the MOT field in the CAN_MMRx 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 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. 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), then the
MMI signal is set in the CAN_MSRx. This bit is cleared by reading the CAN_MSRx.
The MRTR field in the CAN_MSRx 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.
Please refer to the section “Transmission Handling” on page 673.
Figure 33-17. Producer Handling
Consumer Configuration
A mailbox is in Consumer Mode once the MOT field in the CAN_MMRx 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 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 or
the MBx bit in the global CAN_TCR. The application is notified of the answer by the MRDY flag set in the
CAN_MSRx. 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 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, they will be lost. The application is notified by reading the MMI field in the
CAN_MSRx. 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
MTCR
(CAN_MCRx)
MRDY
(CAN_MSRx)
CAN BUS
Remote Frame
Message 1
Message 1
Message 2
(CAN_MDLx
CAN_MDHx)
MMI
(CAN_MSRx)
Remote Frame
Remote Frame
Message 2
Reading CAN_MSRx