14.2.2.4 TX_ARET_ON – Transmit with Automatic Frame Retransmission and CSMA-CA Retry

Figure 14-30. Flow Diagram of TX_ARET

Overview

The implementation of TX_ARET algorithm is shown in the figure above.

The TX_ARET Extended Operating Mode supports the frame transmission process as defined by IEEE 802.15.4-2006. It is invoked by writing TX_ARET_ON to the TRX_CMD bits in the TRX_STATE register (TRX_STATE.TRX_CMD).

If a transmission is initiated in TX_ARET mode, the AT86RF212B executes the CSMA-CA algorithm as defined by 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 is exceeded, refer to the MAX_FRAME_RETRIES bits in the XAH_CTRL_0 register..

The completion of the TX_ARET transaction is indicated by the IRQ_3 (TRX_END) interrupt.

Description

Prior to invoking AT86RF212B TX_ARET mode, the basic configuration steps must 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 pin 11 (SLP_TR) or by writing a TX_START command to the TRX_CMD bits in the TRX_STATE register (TRX_STATE.TRX_CMD).

If the CSMA-CA detects a busy channel, it is retried as specified by the MAX_CSMA_RETRIES bits in the XAH_CTRL_0 register (XAH_CTRL_0.MAX_CSMA_RETRIES). 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 TRAC_STATUS bits in the TRX_STATE register (TRX_STATE_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 TRX_STATE.TRAC_STATUS bits 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 TRX_STATE.TRAC_STATUS bits re updated to SUCCESS or SUCCESS_DATA_PENDING accordingly. 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 within the timeout period, the radio transceiver retries the entire transaction (CSMA-CA based frame transmission) until the maximum number of frame retransmissions is exceeded, see the XAH_CTRL_0.MAX_FRAME_RETRIES bits. In that case, the TRX_STATE.TRAC_STATUS is set to NO_ACK, the TX_ARET transaction is terminated, and interrupt IRQ_3 (TRX_END) is issued.

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.

After that, the microcontroller may read the value of the TRX_STATE.TRAC_STATUS bits to verify whether the transaction was successful or not. The register bits are set according to the following cases.

The table below summarizes the Extended Operating Mode result codes in the TRX_STATE.TRAC_STATUS bits with respect to the TX_ARET transaction. Values are meaningful after an interrupt until the next frame transmit.

Table 14-17. Interpretation of TRAC_STATUS Register Bits
Value Name Description
0 SUCCESS The transaction was responded to by a valid ACK, or, if no ACK is requested, after a successful frame transmission.
1 SUCCESS_DATA_PENDING Equivalent to SUCCESS and indicating that the “Frame Pending” bit (see Section 8.1.2.2) of the received acknowledgment frame was set.
3 CHANNEL_ACCESS_FAILURE Channel is still busy after attempting MAX_CSMA_RETRIES of CSMA‑CA.
5 NO_ACK No acknowledgement frame was received during all retry attempts.
7 INVALID

A value of MAX_CSMA_RETRIES = 7 initiates an immediate TX_ARET transaction without performing CSMA-CA. This can be used for example to transmit indirect data to a device. Further the value MAX_FRAME_RETRIES is ignored and the TX_ARET transaction is performed only once.