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)
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.
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. The splitting of the parameters into register values is described in Handling of Multibyte Variables.

inline_mscgraph_74
Code example
    /* AT86RF231::[CONFIG] */
    trx_bit_write(SR_TX_AUTO_CRC_ON, txcrc);
    trx_bit_write(SR_MAX_FRAME_RETRIES, frame_rctr);
    trx_bit_write(SR_MAX_CSMA_RETRIES, csma_rctr);
    trx_bit_write(SR_CSMA_SEED_1, csma_seed_10_8);
    trx_reg_write(RG_CSMA_SEED_0, csma_seed_7_0);
    trx_bit_write(SR_MIN_BE, min_be);
    trx_bit_write(SR_MAX_BE, max_be);

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 acknowledgment 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, the ACK frame needs to be received within an interval of 864 us (macAckWaitDuration=54 symbols in 2.4GHz band). The internal timing for the ACK frame processing in TX_ARET mode is shown below:

 = CCA =:=== TX ===:============== RX ====================
                   0             42  44  46  48  50  52  54 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_75
Code example
    /* AT86RF231::TX_ARET_ON */
    trx_pinset_slptr(1);
    /* AT86RF231::BUSY_TX_ARET */
    trx_pinset_slptr(0);
    trx_frame_write(len(frame), frame);
    /* TRX_IRQ_TRX_END occurs here */
    /* AT86RF231::TX_ARET_ON */
    tracstat = trx_bit_read(SR_TRAC_STATUS);

Generated on Mon Jan 12 18:32:18 2009 for SWPM AT86RF231 by  doxygen 1.5.2