Frame Receive Procedure (RX)

For receiving frames in the Basic Operating Mode, the radio transceiver needs to be in the state RX_ON, as described in section Transitions to State RX_ON.

The end of a frame reception is indicated by the TRX_IRQ_TRX_END interrupt. At the same time, the sub register SR_RX_CRC_VALID is updated with the result of the FCS check. The value {1} in this sub register indicates, that the received frame contains a correct CRC16.

A received frame is stored in the frame buffer of the radio transceiver in the following way:

             0   1   2                         L-1  L  L+1 L+2 L+3
           +--- --- --- --- --- --- --- ~~~~~~ --- ---+--- --- ---+
           | P | D | D | D | D | D | D |      |D/F|D/F|LQI|ED |RXS|
           +--- --- --- --- --- --- --- ~~~~~~ --- ---+--- --- ---+
           |                                          |           |
           |<--- access via "SRAM Read Access"  ----->|           |
           |                                                      |
           |<--- access via "Frame Read Access"  ---------------->|

      P   : PHR field containing the PSDU length information L
      D,F : D = data byte, F = FCS byte (D and F belong to the PSDU)
      LQI : link quality indication value for the received frame
      ED  : energy value for the received frame
      RXS : RX_STATUS value for the received frame

  

The PHR field of a received frame contains the PSDU length L, which has a valid range from {1,...,127}. The PHR field and the PSDU bytes can be read with the functions trx_frame_read() and/or trx_sram_read(). The RX Frame Status Information (LQI, ED, RX_STATUS) is stored directly after the last byte of the PSDU and is only accessible with the function trx_frame_read().

Use Cases:


PHY_DATA_INDICATION_MATCH

This procedure loads the frame from the radio transceiver, when it is completely received and stored in the frame buffer. In this use case it is assumed, that the incoming frame passes the Address Filter and thus the interrupt TRX_IRQ_AMI occurs. If the entire frame buffer read takes longer than tMSNC, there is a risk, that the currently stored frame is overwritten by the next frame being received. This can be avoided with one of the procedures described in Frame Buffer Protection (Static/Dynamic).

inline_mscgraph_79
Code example
    /* AT86RF212::RX_ON && AT86RF212::BUSY_RX */
    /* TRX_IRQ_RX_START occurs here */
    /* TRX_IRQ_AMI occurs here */
    /* TRX_IRQ_TRX_END occurs here */
    /* AT86RF212::RX_ON */
    crc_valid = trx_bit_read(SR_RX_CRC_VALID);
    frame = trx_frame_read();

PHY_DATA_INDICATION_NOMATCH

This use case describes the same procedure as PHY_DATA_INDICATION_MATCH. The only difference is that the address field of the incoming frame does not pass the frame filter according to the filter rules described in section 6.2 (Frame Filter) of the AT86RF212 datasheet. Thus, no TRX_IRQ_AMI occurs.

inline_mscgraph_80
Code example
    /* AT86RF212::RX_ON && AT86RF212::BUSY_RX */
    /* TRX_IRQ_RX_START occurs here */
    /* TRX_IRQ_TRX_END occurs here */
    /* AT86RF212::RX_ON */
    crc_valid = trx_bit_read(SR_RX_CRC_VALID);
    frame = trx_frame_read();

PHY_DATA_INDICATION_FAST

In order to meet the strict timing constraints of the acknowledgement procedure in the IEEE 802.15.4 standard, the frame buffer can be read in parallel to the frame reception. In order to avoid a RX underrun condition, the frame read procedure has to be started so, that it is finished after the last PSDU octet of the frame is received.

After the TRX_IRQ_RX_START interrupt the PHR field is read in order to determine the frame length flen (see trx_frame_length_read()). The value twait denotes the waiting time before the frame buffer read is started. It depends on the SPI transfer rate Rspi [octets/s], the data rate Rdata [octets/s] and the frame length flen [octets]. It is computed according the following formula:

twait [s] > flen *(1/Rdata-1/Rspi)

When the TRX_IRQ_TRX_END interrupt occurs, the frame is already uploaded in a buffer and the acknowledge procedure can be started immediately.

Note:
If the frame upload is started earlier than twait, a TRX_IRQ_TRX_UR interrupt is generated and the data has to be uploaded again (see PHY_EVENT_TRX_UR_RX). However, this can be avoided by using the Frame Buffer Empty Indicator. In this case, the calculation of twait and the corresponding delay is not needed.
inline_mscgraph_81
Code example
    /* AT86RF212::RX_ON && AT86RF212::BUSY_RX */
    /* TRX_IRQ_RX_START occurs here */
    flen = trx_frame_length_read();
    delay(twait);
    frame = trx_frame_read();
    /* TRX_IRQ_TRX_END occurs here */
    /* AT86RF212::RX_ON */
    generate_ack(frame);

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