Random Number Generator

GET_RND_VALUE

The radio transceiver is capable of generating 2-bit random values. It can be read from the sub register SR_RND_VALUE, whenever the radio transceiver is in one of the [RX_BASIC] states. The value is updated at an interval of tTR29.

The following sequence illustrates, how an 8 bit random value rnd can be obtained.

Note:
The Random Generator does not work, if the preamble detector is disabled, therefore it has to be ensured, that the value of sub register SR_RX_PDT_DIS is 0.
inline_mscgraph_97
Code example
    /* AT86RF212::[RX_BASIC] */
    trx_bit_write(SR_RX_PDT_DIS, 0);
    rnd = 0;
    r = trx_bit_read(SR_RND_VALUE);
    rnd = (rnd*4) + r;
    delay(tTR29);
    r = trx_bit_read(SR_RND_VALUE);
    rnd = (rnd*4) + r;
    delay(tTR29);
    r = trx_bit_read(SR_RND_VALUE);
    rnd = (rnd*4) + r;
    delay(tTR29);
    r = trx_bit_read(SR_RND_VALUE);
    rnd = (rnd*4) + r;

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