CCA Measurement

This section describes how a CCA measurement (Clear Channel Assesment) for the current RF channel is done. The result of the CCA measurement is used in the CSMA-CA algorithm (Carrier Sense Multiple Access - Collision Avoidance) to ensure that no transmission of another station is disturbed by the own frame transmission.

The CCA measurement, which is described in more detail in section 6.6 (Clear Channel Assessment) of the AT86RF212 datasheet, is controlled with two parameters, mode and edthrs:

Parameters:
mode  The CCA-Mode parameter is set in the sub register SR_CCA_MODE and has the following meaning:
mode=0
Carrier sense or energy above threshold (Mode 3a).
CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4 OR energy above the ED threshold.
mode=1
Energy above threshold.
CCA shall report a busy medium upon detecting any energy above the ED threshold.
mode=2
Carrier sense only.
CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. This signal may be above or below the ED threshold.
mode=3
Carrier sense and energy above threshold (Mode 3b).
CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4 AND energy above the ED threshold.
edthrs  If a signal is present, which has an energy value above the energy threshold, the CCA measurement reports a busy medium. The value edthrs is a 4 bit value, which is converted to an RF input power value by
PRF = RSSI_BASE_VAL + 2*edthrs. This parameter is not relevant for mode=2.

The CCA measurement itself is carried out with sequence PHY_DO_CCA. It returns two values, cca and done:

Return values:
done  The end of a manually initiated CCA measurement is signalled by TRX_IRQ_CCA_ED_DONE. Alternatively, sub register SR_CCA_DONE can be read.
  • 0 : a previously started CCA measurement is not (yet) completed
  • 1 : a previously started CCA measurement is completed correctly
stat  This parameter is retrieved from the sub register SR_CCA_STATUS and has the following meaning:
  • 0 : medium is busy
  • 1 : medium is free
Use Cases:


PHY_SET_CCA_CFG

This sequence sets the parameters mode and edthrs for the CCA measurement.

inline_mscgraph_72
Code example
    /* AT86RF212::[CONFIG] */
    trx_bit_write(SR_CCA_MODE, mode);
    trx_bit_write(SR_CCA_ED_THRES, edthrs);

PHY_GET_CCA_CFG

This sequence returns the currently configured parameters, mode and edthrs.

inline_mscgraph_73
Code example
    /* AT86RF212::[ACTIVE] */
    mode = trx_bit_read(SR_CCA_MODE);
    edthrs = trx_bit_read(SR_CCA_ED_THRES);

PHY_DO_CCA

After the configuration (see PHY_SET_CCA_CFG), a CCA measurement can be started in one of the [RX_BASIC] states by writing value 1 to the sub register SR_CCA_REQUEST. The measurement is finished after tTR28.

inline_mscgraph_74
Code example
    /* AT86RF212::[RX_BASIC] */
    trx_bit_write(SR_CCA_REQUEST, 1);
    delay(tTR28);
    stat = trx_bit_read(SR_CCA_STATUS);

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