This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1101 PKTCTRL0 random TX mode usage

Other Parts Discussed in Thread: CC1101

I've been attempting to use the PKTCTRL0 register to continuously send random data for examine the RF signal output from a CC1101EM 868/915 eval board.

I set the transmission to MSK data rate 250K base frequency 902mhz channel spacing to 200khz and channel 20. I then set PKTCTRL0 from 0x05 too 0x25

Then use the STX strobe.

I've tried many variations of this SO

"CODE"

// force radio to be idle response = mrfiSpiCmdStrobe(SIDLE);
// set the packet to random data
// get the contents of PKTCTRL0
response = mrfiSpiReadReg(PKTCTRL0);
// mask off packet format 
response&= ~0x30;
// set packet format to RANDOM data for testing 
response|= (2)<<4; 
// turn on random data transmission! 
mrfiSpiWriteReg(PKTCTRL0, response); 
// start transmitting first 
response = mrfiSpiCmdStrobe(STX); 

"CODE"

1: Does data whitening have too be turned on?

2: Does LENGTH CONFIG need to change (currently variable length)

3: Does CRC enable need to be on or off?

I've looked at DN509 (doesn't mention how to use this mode) and the CC1101 data sheet merely mentions it no explanation given on how to use it. It appears what's going on is the random mode causes the unit to immediately go into idle mode (it returns 0x0A).

If anyone knows how to use this mode (which I am using for testing) I would appreciate a few hints and pointers to documentation on it.

I'll appreciate any assistance I can get on this.

  • I found "something" it appears infinite packet length mode allows this to work (hmm). Data Whitening appears to XOR the PSRG data with itself and output solid 0's

    Hope this helps someone else.

  • Have you used SmartRF Studio to see which registers that have to be set to send random data continuous? Go to the continuous TX tab, select Modulated and Random mode in the "data format" pull down.

  • Do the normal (FIFO) mode data rate settings apply when "Random TX" mode is selected?  If not, what determines the data rate at which the random data is transmitted.


    Setting PKTCTRL0 to 0x22 to configure for random TX mode with infinite packet length (per SmartRF Studio).  After sending the STX strobe, I see what looks like a CW tone, hard to differentiate from unmodulated data.  If I just want to send a modulated tone at our configured data rate, does the PKTLEN setting make a difference?

  • When selecting random Tx, all the other settings are valid, eq if you have selected to send with 50 kbps/ 25 kHz deviation you will do so also if you select random.

    PKTLEN should not have an impact but try to set it to 0xFF. Have you used small enough RBW and span when looking at the signal?

  • We are using OOK modulation @ 16.384kbps.  Would the expected signal bandwidth be affected one way or the other by using this modulation scheme?


    For Random TX mode, other than sending the STX strobe, is there any handling that needs to be done.  We are currently just configuration the registers and sending the STX strobe to start the signal.  Do we need to monitor the GDO for any reason, or send any other commands to keep the modulation going?

  • It should only be to set the register and strobe STX. Could you send me your register settings (if possible as a SmartRF Studio xml file) and I can test it briefly tomorrow.

  • OK, that is what we are doing.  Here are our configuration settings:

    <html><head>
    <style>
    body {background-color:#dde;}
    caption {font-weight:bold; font-size:16px;margin-left:30px}
    th { text-align:left; background-color:#f00; color:#fff}
    table { background-color: #eec; font-size:9px;margin:10px}
    </style>
    </head>
    <body><table border=1 cellpadding=5 cellspacing=0>
    <caption>CC1101 registers</caption>
    <tr><th>Name</th><th>Address</th><th>Value</th>
    <th>Description</th></tr><tr><td>IOCFG0<td>0x0002</td><td>0x06</td><td>GDO0 Output Pin Configuration</td></tr>
    <tr><td>FIFOTHR<td>0x0003</td><td>0x47</td><td>RX FIFO and TX FIFO Thresholds</td></tr>
    <tr><td>SYNC1<td>0x0004</td><td>0xF9</td><td>Sync Word, High Byte</td></tr>
    <tr><td>SYNC0<td>0x0005</td><td>0x53</td><td>Sync Word, Low Byte</td></tr>
    <tr><td>PKTCTRL1<td>0x0007</td><td>0x00</td><td>Packet Automation Control</td></tr>
    <tr><td>PKTCTRL0<td>0x0008</td><td>0x22</td><td>Packet Automation Control</td></tr>
    <tr><td>FSCTRL0<td>0x000C</td><td>0x08</td><td>Frequency Synthesizer Control</td></tr>
    <tr><td>FREQ2<td>0x000D</td><td>0x23</td><td>Frequency Control Word, High Byte</td></tr>
    <tr><td>FREQ1<td>0x000E</td><td>0x00</td><td>Frequency Control Word, Middle Byte</td></tr>
    <tr><td>FREQ0<td>0x000F</td><td>0x00</td><td>Frequency Control Word, Low Byte</td></tr>
    <tr><td>MDMCFG4<td>0x0010</td><td>0x8A</td><td>Modem Configuration</td></tr>
    <tr><td>MDMCFG3<td>0x0011</td><td>0x4A</td><td>Modem Configuration</td></tr>
    <tr><td>MDMCFG2<td>0x0012</td><td>0x38</td><td>Modem Configuration</td></tr>
    <tr><td>DEVIATN<td>0x0015</td><td>0x70</td><td>Modem Deviation Setting</td></tr>
    <tr><td>MCSM0<td>0x0018</td><td>0x18</td><td>Main Radio Control State Machine Configuration</td></tr>
    <tr><td>FOCCFG<td>0x0019</td><td>0x1D</td><td>Frequency Offset Compensation Configuration</td></tr>
    <tr><td>BSCFG<td>0x001A</td><td>0x1C</td><td>Bit Synchronization Configuration</td></tr>
    <tr><td>AGCCTRL2<td>0x001B</td><td>0xC7</td><td>AGC Control</td></tr>
    <tr><td>AGCCTRL1<td>0x001C</td><td>0x00</td><td>AGC Control</td></tr>
    <tr><td>AGCCTRL0<td>0x001D</td><td>0xB2</td><td>AGC Control</td></tr>
    <tr><td>WORCTRL<td>0x0020</td><td>0xFB</td><td>Wake On Radio Control</td></tr>
    <tr><td>FREND1<td>0x0021</td><td>0xB6</td><td>Front End RX Configuration</td></tr>
    <tr><td>FREND0<td>0x0022</td><td>0x11</td><td>Front End TX Configuration</td></tr>
    <tr><td>FSCAL3<td>0x0023</td><td>0xE9</td><td>Frequency Synthesizer Calibration</td></tr>
    <tr><td>FSCAL2<td>0x0024</td><td>0x2A</td><td>Frequency Synthesizer Calibration</td></tr>
    <tr><td>FSCAL1<td>0x0025</td><td>0x00</td><td>Frequency Synthesizer Calibration</td></tr>
    <tr><td>FSCAL0<td>0x0026</td><td>0x1F</td><td>Frequency Synthesizer Calibration</td></tr>
    <tr><td>TEST2<td>0x002C</td><td>0x81</td><td>Various Test Settings</td></tr>
    <tr><td>TEST1<td>0x002D</td><td>0x35</td><td>Various Test Settings</td></tr>
    <tr><td>TEST0<td>0x002E</td><td>0x09</td><td>Various Test Settings</td></tr>
    </table>
    </body><html>

  • I did some quick testing. Initially I though I had forgotten something, normally a byte has to be written to the FIFO before strobing STX to init the random generator but when I tested it seemed to work without doing so.

    But I did not get anything to work with your settings. When I imported them I got that the center frequency is 800 MHz. Is that correct? 

  • We are using a 26MHz crystal frequency, which impacts several register settings.  For a 27MHz reference, the following change, according to SmartRF Studio:

    FREQ2 = 0x21

    FREQ1 = 0xB4

    FREQ0 = 0x25

    MDMCFG3 = 0x3E

  • We did some additional testing and found that our operation in normal (FIFO) mode, which involves short bursts of data rather than constantly transmitting, showed a completely different spectrum profile than when we used Random TX mode to produce a constantly-on modulated tone.

    In our test cases, the modulated tone (using Random TX) spectrum looked nearly identical to the unmodulated tone spectrum.

    For a sanity check, we changed the modulation settings to GFSK.  The modulated GFSK signal looked much different from unmodulated signal.  Might there be an issue with the Random TX mode when used with ASK/OOK modulation?  Or possibly just additional configuration needed?

  • A random spectrum using OOK will not look different from a non random spectrum given max hold since the shape is the same, it's more often you get a '1' or '0'. Is it ASK/ OOK you plan to use?

  • Yes, we are using OOK for this application.


    Regardless of the data pattern, shouldn't the spectrum of a modulated signal look different from a unmodulated signal?


    Under normal operation, our application transmits short bursts of data, but our design testing requires that we also be able to send continuous data with the same frequency and modulation scheme.  We had hoped to use the Random TX mode for this test. 

    However, what we are finding is that the spectrum of our OOK data burst is very different from that of the continuous OOK-modulation transmission we think we are enabling using Random TX mode.

  • A burst will look different regardless of the modulation format since you get the spectrum splattering effect from the start and end of the packet in addition.

  • Does the spectral splatter not apply to OOK, in general?

    If the radio is turning on for a '1' and turning off for a '0', wouldn't the splatter affect every transition, not just at the beginning and ending of the packet? 

    Or is there something different in the behavior of the radio immediately following STX and SIDLE strobes?

  • Yes, OOK is very spectrum in-efficient since it splatters the spectrum for every 0->1 transition but for other modulation forms the splattering only occur at the start/ end of a packet. Hence if you use random data continuously, GFSK will look very different from OOK. Only if you send a continuously CW ('1') a OOK spectrum will look good.

  • That is what I would expect, as well, so it makes the behavior we are observing when using Random TX mode with OOK unexpected.

    I would expect that if the output signal was being modulated with random data at OOK, we would see spectral splatter with every transition and thus a spectrum that looks very different from a CW spectrum.

    However, what we observe is that the Random TX spectrum with OOK looks identical to the CW spectrum.

    It makes it seem as though the Random TX mode is not actually modulating the signal, at least when the CC1101 is set for OOK modulation.

  • Kelly Hawkins said:

    That is what I would expect, as well, so it makes the behavior we are observing when using Random TX mode with OOK unexpected.

    I would expect that if the output signal was being modulated with random data at OOK, we would see spectral splatter with every transition and thus a spectrum that looks very different from a CW spectrum.

    However, what we observe is that the Random TX spectrum with OOK looks identical to the CW spectrum.

    It makes it seem as though the Random TX mode is not actually modulating the signal, at least when the CC1101 is set for OOK modulation.

    There are a few caveats for using the random data. You must set the packet length to infinite for this too work. It also requires you to do certain things in a certain order.

    I assume you have set the power levels correctly for OOK (because it won't work without you using multiple power levels in the table without doing this).

    If you are using FSK you have to set it up slightly differently but for OOK you need to set the power level count and have the ramp levels stored correctly for it to ramp to the OOK level you want. For FSK you need to set 1 power level and then do the following.

    Set packet control register 0 to random data | NO CRC | infinite packet length.

    Then start transmission by issuing the STX command.

    Anyhow that is how I got it too work.

    code I use

    // send random data from the radio
    // turning on data whitening biases output (as it uses
    // the same random number generator to send random data)
    // you must set infinite packet length for this to work
    // one PA value
    mrfiSpiWriteReg(FREND0, 0x10);
    // set PA power value to 0db
    mrfiSpiWriteReg(PA_TABLE0, 0x8E);
    // random data | NO CRC | infinite packet length
    mrfiSpiWriteReg(PKTCTRL0, 0x20 | 0x00 | 0x02);
    // start transmitting first
    response = mrfiSpiCmdStrobe(STX);
    


    Stephen