929
Atmel | SMART SAM R21 [DATASHEET]
Atmel-42223G–SAM-R21_Datasheet–05/2016
36.2.4.1 Overview
The implementation of TX_ARET algorithm is shown in Figure 36-13.
The TX_ARET Extended Operating Mode supports the frame transmission process as defined by IEEE 802.15.4-2006. It
is invoked as described in “State Control” on page 916 by writing TX_ARET_ON to register subfield TRX_CMD
(register 0x02, TRX_STATE).
If a transmission is initiated in TX_ARET mode, the AT86RF233 executes the CSMA-CA algorithm as defined by
[2]IEEE 802.15.4-2006, Section 7.5.1.4. If the CCA reports IDLE, the frame is transmitted from the Frame Buffer.
If an acknowledgement frame is requested, the radio transceiver checks for an ACK reply automatically. The CSMA-CA
based transmission process is repeated until a valid acknowledgement is received or the number of frame
retransmissions MAX_FRAME_RETRIES (register 0x2C, XAH_CTRL_0) is exceeded.
The completion of the TX_ARET transaction is indicated by the IRQ_3 (TRX_END) interrupt, see “Interrupt Handling” on
page 931.
36.2.4.2 Description
Prior to invoking AT86RF233 TX_ARET mode, the basic configuration steps as described in “Configuration” on page 917
shall be executed. It is further recommended to write the PSDU transmit data to the Frame Buffer in advance.
The transmit start event may either come from a rising edge on SLP_TR, refer to “Sleep/Wake-up and Transmit Signal
(SLP_TR)” on page 894, or by writing a TX_START command to register bits TRX_CMD (register 0x02, TRX_STATE).
If the CSMA-CA detects a busy channel, it is retried as specified by the register bits MAX_CSMA_RETRIES
(register 0x2C, XAH_CTRL_0). In case that CSMA-CA does not detect a clear channel after MAX_CSMA_RETRIES, it
aborts the TX_ARET transaction, issues interrupt IRQ_3 (TRX_END), and sets the value of the register bits
TRAC_STATUS to CHANNEL_ACCESS_FAILURE.
During transmission of a frame the radio transceiver parses bit[5] (ACK Request) of the MAC header (MHR) frame
control field of the PSDU data (PSDU octet #1) to be transmitted to check if an ACK reply is expected.
If no ACK is expected, the radio transceiver issues IRQ_3 (TRX_END) directly after the frame transmission has been
completed. The register bits TRAC_STATUS (register 0x02, TRX_STATE) are set to SUCCESS.
If an ACK is expected, after transmission the radio transceiver automatically switches to receive mode waiting for a valid
ACK reply (that is matching sequence number and correct FCS). After receiving a valid ACK frame, the “Frame Pending”
subfield of this frame is parsed and the status register bits TRAC_STATUS are updated to SUCCESS or
SUCCESS_DATA_PENDING accordingly, refer to Table 36-12. At the same time, the entire TX_ARET transaction is
terminated and interrupt IRQ_3 (TRX_END) is issued.
If no valid ACK is received or after timeout of 54 symbol periods (864µs), the radio transceiver retries the entire
transaction (CSMA-CA based frame transmission) until the maximum number of frame retransmissions is exceeded, see
register bits MAX_FRAME_RETRIES (register 0x2C, XAH_CTRL_0). In that case, the TRAC_STATUS is set to
NO_ACK, the TX_ARET transaction is terminated, and interrupt IRQ_3 (TRX_END) is issued.
The current CSMA-CA and frame retransmission counter values of an ongoing TX_ARET transaction can be retrieved by
the register bits ARET_FRAME_RETRIES and ARET_CSMA_RETRIES (register 0x19, XAH_CTRL_2).
Note: 1. The acknowledgment receive procedure does not overwrite the Frame Buffer content. Transmit data in the Frame
Buffer is not modified during the entire TX_ARET transaction. Received frames, other than the expected ACK
frame, are discarded automatically.
Additionally to the RX Frame Time stamping via DIG2, a TX Frame Time stamping within TX_ARET mode can be
activated, if the register bits IRQ_2_EXT_EN (register 0x04, TRX_CTRL_1) and ARET_TX_TS_EN (register 0x17,
XAH_CTRL_1) are set to one, see “RX and TX Frame Time Stamping (TX_ARET)” on page 1027.
After that, the microcontroller may read the value of the register bits TRAC_STATUS (register 0x02, TRX_STATE) to
verify whether the transaction was successful or not. The register bits are set according to the following cases, additional
exit codes are described in “Register Summary” on page 932.