EasyManuals Logo
Home>Texas Instruments>Microcontrollers>CC253x

Texas Instruments CC253x User Manual

Texas Instruments CC253x
370 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #330 background imageLoading...
Page #330 background image
Random Number Generation
www.ti.com
When receiving CMD_DEMOD_TEST, the LLE starts the receiver, but does not start sync search. The
receiver runs until a CMD_SHUTDOWN command (or a command starting another task) is sent.
When receiving CMD_RX_TEST, the LLE starts the receiver and starts sync search. Any received data is
discarded. The receiver runs until a CMD_SHUTDOWN command (or a command starting another task) is
sent.
When receiving a CMD_TX_TEST, the LLE starts the transmitter and starts sending all zeros. The Tx test
command is normally combined with configuration of the modem to send a tone or by the BSP to send a
whitening sequence. The transmitter runs until a CMD_SHUTDOWN command (or a command starting
another task) is sent. In order to send random modulated data for test purposes, it is recommended to set
BSP_MODE to 0x03 to enable both whiteners.
In order to send a continuous wave (CW), MDMCTRL0.TX_IF can be set to 1 before the CMD_TX_TEST
command is issued. In this case, the radio outputs a tone with the frequency given in
MDMTEST1.TX_TONE. In most cases, a tone at the synthesizer frequency is wanted (e.g., to measure
phase noise), in which case MDMTEST.TX_TONE should be set to 0x0A. The frequency synthesizer must
be programmed to the carrier frequency with no offset in this case; see Section 25.5.
When receiving a CMD_TX_FIFO_TEST, the LLE starts the transmitter and starts sending from the Tx
FIFO; otherwise, the command is as CMD_TX_TEST. The MCU must feed data into the Tx FIFO to avoid
underflow, and the Tx FIFO must be set up with auto commit and auto deallocate.
When receiving a CMD_PING command, the LLE responds with a PINGRSP. This can be used for
checking that the LLE code is running.
25.10 Random Number Generation
The CC2541 has a hardware pseudo-random register, as explained in Section 14.1. The RF core register
bank provides a second interface to this register. Reading the RFPSRND register is equivalent to reading
RNDL, then writing 01 to ADCCON1.RCTL.
For seeding the pseudo-random number generator and for tasks where higher entropy of the random
numbers is needed, the radio can be used as a true-random generator. The register RFRND provides
access to the least-significant bits of the radio ADC, which is random when noise is received. In order to
get values on this register, the receiver must be turned on. The value in RFRND is updated every 0.17 µs,
so the sampling of that register must be slower than that in order to get a new value with every sample.
To get true random numbers, the following procedure can be followed:
1. Program FREQCTRL to a channel that is not likely to contain a narrow-band signal. A frequency outside
the ISM band, such as a setting of 0, is recommended.
2. Program LNAGAIN to 0 to have minimum reception of a signal on the air.
3. Start the receiver in test mode by issuing a CMD_DEMOD_TEST command.
4. Wait until ADC data are ready. This can be seen by the RFRND register having a value different from 0.
5. Read the number of values needed from RFRND. Make sure that there is at least 0.17 µs between each
read (i.e., at least 6 cycles if running on 32 MHz). For instance, to seed the pseudo-random generator,
two values are needed.
6. Shut down the receiver by issuing a CMD_SHUTDOWN command
The values read from the RFRND register do not have a perfectly uniform distribution. In order to improve
this, several random numbers can be combined to produce one random number. One way of doing this is
to use the pseudo-random generator in CRC mode and combine 8 numbers into one. An example of how
this can be done is given in the C code below:
// Store LNA gain setting and set minimum LNA gain
lnagain_stored = LNAGAIN;
LNAGAIN = 0x00;
// Set lowest possible frequency to avoid signals in ISM band
FREQCTRL = 0x00;
// Enable radio in Rx without sync search
while (RFST != 0);
330
CC2541 Proprietary Mode Radio SWRU191C April 2009Revised January 2012
Submit Documentation Feedback
Copyright © 20092012, Texas Instruments Incorporated

Table of Contents

Other manuals for Texas Instruments CC253x

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments CC253x and is the answer not in the manual?

Texas Instruments CC253x Specifications

General IconGeneral
BrandTexas Instruments
ModelCC253x
CategoryMicrocontrollers
LanguageEnglish

Related product manuals