Extended Frame Transmit Procedure (TX_ARET)

This section describes configuration and frame transmission in TX_ARET mode.

Parameters:
txcrc If set to 1, the CRC is calculated automatically, otherwise, the frame will be transmitted as it was downloaded.
frame_retr Number of attempts until giving up sending a frame sucessfully. The parameter has the range 0 ... 15, with the following meaning:
  • 0 : 1 transmit attempt in total,
  • 1 : 2 transmit attempts (1 retry), ...,
  • 15 : 16 transmit attempts (15 retries).
lbt Flag which determines, that LBT method should be used instead of CSMA.
csma_retr Number of maximum CSMA attempts before giving up sending a frame. The parameter has the range {0...7} with the following meaning:
  • 0 : 1 CSMA attempt,
  • 1 : 2 CSMA attempts (1 retry), ...,
  • 6 : 7 CSMA attempts (6 retries),
  • 7 : no CSMA attempt.
csma_seed The seed value for the random number generator of the CSMA-CA algorithm.
min_be Value of the minimum backoff exponent in the CSMA-CA algorithm.
max_be Value of the maximum backoff exponent in the CSMA-CA algorithm.
For CSMA and LBT the parameters mode and edthrs are configured according to section CCA Measurement.

Differences between CSMA and LBT
In CSMA mode the radio transceiver attempts at maximum csma_retr channel assessments before sending a frame or giving up. In LBT mode the number of CSMA attempts is inifinite and therefore the parameters csma_retr, csma_seed, min_be, and max_be are ignored. In the case of a permanently blocked channel, the CSMA mode terminates with a TRX_IRQ_TRX_END interrupt and the result TRAC_CHANNEL_ACCESS_FAILURE in the sub register SR_TRAC_STATUS. Under the same conditions, the LBT mode never terminates with any interrupt, continuously trying to detect that the channel is idle.

Note:
  • The IEEE 802.15.4-2003 standard defines the maximum number of retransmissions as three, whereas the IEEE 802.15.4-2006 standards allows up to 7 retransmissions.
Use Cases:


PHY_CONFIG_TX_ARET

This sequence describes how the TX_ARET mode parameters are configured.

inline_mscgraph_82
Code example

PHY_SET_CSMA_SEED

The content of registers RG_CSMA_SEED_0 and RG_CSMA_SEED_1 initializes the TX_ARET random backoff generator after the wakeup from SLEEP state. To prevent a reinitialization with the same value it is recommended to reinitialize both registers before every SLEEP state with a random value.

The following use case illustrates the initialisation of the CSMA seed with a wake-sleep-wake sequence (see also Transitions to/from State SLEEP).

The splitting of the parameters into register values is described in section Handling of Multibyte Variables.

inline_mscgraph_83
Code example
    /* AT86RF212::TRX_OFF */
    trx_bit_write(SR_CSMA_SEED_1, csma_seed_10_8);
    trx_reg_write(RG_CSMA_SEED_0, csma_seed_7_0);
    trx_pinset_slptr(1);
    delay(tTR3);
    /* AT86RF212::SLEEP */
    trx_pinset_slptr(0);
    delay(tTR2);
    /* AT86RF212::TRX_OFF */

PHY_DATA_REQUEST_TX_ARET

The frame transmission in TX_ARET mode combines a hardware assisted CSMA-CA followed by the frame transmission itself and the acknowledgement frame checking. Therefore the radio transceiver switches internally between transmit and receive states.

The result of a TX_ARET transaction is stored in the sub register SR_TRAC_STATUS after the TRX_IRQ_TRX_END interrupt.

Return values:
tracstat Result of a TX_ARET transaction from sub register SR_TRAC_STATUS.
  • TRAC_SUCCESS : The frame transmission was successful and an optional requested acknowledgement frame was received correct.
  • TRAC_SUCCESS_DATA_PENDING : The frame transmission was successful and the frame pending subfield was set in the received ACK frame.
  • TRAC_CHANNEL_ACCESS_FAILURE : The CSMA-CA algorithm has failed and the frame could not be send.
  • TRAC_NO_ACK : A correct ACK frame was not received within the required period of time.
  • TRAC_INVALID : The transaction is ongoing or was aborted.
According to IEEE 802.15.4 an ACK frame needs to be received within an interval of 54 symbols for OQPSK modulation or 120 symbols for BPSK modulation. The internal timing for the ACK frame processing in TX_ARET mode is shown below:

 = CCA =:=== TX ===:============== RX ====================
                   0             72  80  88  96 104 112 120 [BPSK]
                   0             42  44  46  48  50  52  54 [O-QPSK]
        |~~~~~~+---|          |---+---+---+---+---+---+---|          time [symbols]
 -------|      | F |----------|SFD|PHR|    ACK    |  FCS  |------------------------->
        |~~~~~~+---|          |---o---+---+---+---+---+---|
        |          |              |                       |
        t0         t1             t2                      t3

         F = last transmitted byte,
         SFD, PHR, ACK, FCS = data of the received ACK frame

 

Note:
After a TX_ARET transaction the frame is kept in the frame buffer, so that it can be sent out again. The received ACK frame is processed internally and therefore it is not stored in the frame buffer.
inline_mscgraph_84
Code example
    /* AT86RF212::TX_ARET_ON */
    trx_pinset_slptr(1);
    delay(t7);
    /* AT86RF212::BUSY_TX_ARET */
    trx_pinset_slptr(0);
    trx_frame_write(len(frame), frame);
    /* TRX_IRQ_TRX_END occurs here */
    /* AT86RF212::TX_ARET_ON */
    tracstat = trx_bit_read(SR_TRAC_STATUS);

Generated on Mon Aug 17 13:35:01 2009 for SWPM AT86RF212 by  doxygen 1.5.6