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: Sync word not detected

Part Number: CC1101

Hi,

I have no problem detecting preamble with my CC1101 but I'm unable to detect the sync word. I set up pin interrupt on my MCU for GDO0 (0x08 preamble PQI) and GDO2 (0x06 sync word sent/received). The GDO0 asserts when starting TX on another CC1101 (same config used except of device address) but nothing happens then. GDO2 pin remains low and the receiving CC1101 stays in RX mode (set to switch to IDLE when a packet is received). Also the RX buffer is empty (checking  the RXBYTES register).

At first, I used default register settings and only amended registers like base freq, data rate, sync word, device address etc. (cc1101_433MHz_GFSK_manual.xml - ignore GFSK in the file name please, it's 2-FSK)
Then, I used SmartRF studio to generate register settings (cc1101_433MHz_GFSK_SmartRF.xml)

The behavior was almost the same (preamble detected while sync word not), but dBm changed to cca -40 dBm with manual settings while only to cca -60dBm with those generated with SmartRf studio (both from cca -100dBm when transmitting CC1101 was quiet) when another CC1101 was transmitting.
The other difference was that the GDO0 pin (set to preamble detected) stayed high (until the end of transmitting - transimtter remained in TX state after finishing transmitting) ) with manual setting, but wen low very quickly with SmartRF studio settings. What's the desired behavior of the GDO0 pin here?

In the linked post, I read about synchronous and asynchronous mode advising that sync word detection doesn't work in asynchronous mode. Since my PKTCTRL0.PKT_FORMAT is set to Normal mode, how does sync word detection work here? Can't find more information about the Normal mode.

I'm not forced to stick with any particular RF settings (like frequency, modulation etc.) in my project.

So, I'd like to ask to find out why the sync word is not detected.

Thanks, Zdenek

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE configuration SYSTEM "C:/Program Files (x86)/Texas Instruments/SmartRF Tools/SmartRF Studio 7/config/xml/configdata.dtd"[]>
<dcpanelconfiguration>
    <Devicename>CC1101</Devicename>
    <Description>Saved configuration data</Description>
    <registersettings>
        <Register>
            <Name>ADDR</Name>
            <Value>0x02</Value>
        </Register>
        <Register>
            <Name>AGCCTRL2</Name>
            <Value>0x43</Value>
        </Register>
        <Register>
            <Name>DEVIATN</Name>
            <Value>0x35</Value>
        </Register>
        <Register>
            <Name>FIFOTHR</Name>
            <Value>0x47</Value>
        </Register>
        <Register>
            <Name>FOCCFG</Name>
            <Value>0x16</Value>
        </Register>
        <Register>
            <Name>FREQ0</Name>
            <Value>0x62</Value>
        </Register>
        <Register>
            <Name>FREQ1</Name>
            <Value>0xa7</Value>
        </Register>
        <Register>
            <Name>FREQ2</Name>
            <Value>0x10</Value>
        </Register>
        <Register>
            <Name>FSCAL0</Name>
            <Value>0x1f</Value>
        </Register>
        <Register>
            <Name>FSCAL1</Name>
            <Value>0x00</Value>
        </Register>
        <Register>
            <Name>FSCAL2</Name>
            <Value>0x2a</Value>
        </Register>
        <Register>
            <Name>FSCAL3</Name>
            <Value>0xe9</Value>
        </Register>
        <Register>
            <Name>FSCTRL1</Name>
            <Value>0x06</Value>
        </Register>
        <Register>
            <Name>IOCFG0</Name>
            <Value>0x08</Value>
        </Register>
        <Register>
            <Name>IOCFG2</Name>
            <Value>0x06</Value>
        </Register>
        <Register>
            <Name>MCSM0</Name>
            <Value>0x18</Value>
        </Register>
        <Register>
            <Name>MCSM1</Name>
            <Value>0x32</Value>
        </Register>
        <Register>
            <Name>MDMCFG2</Name>
            <Value>0x13</Value>
        </Register>
        <Register>
            <Name>MDMCFG3</Name>
            <Value>0x83</Value>
        </Register>
        <Register>
            <Name>MDMCFG4</Name>
            <Value>0xca</Value>
        </Register>
        <Register>
            <Name>PA_TABLE0</Name>
            <Value>0x60</Value>
        </Register>
        <Register>
            <Name>PKTCTRL0</Name>
            <Value>0x05</Value>
        </Register>
        <Register>
            <Name>PKTCTRL1</Name>
            <Value>0xc5</Value>
        </Register>
        <Register>
            <Name>TEST0</Name>
            <Value>0x09</Value>
        </Register>
        <Register>
            <Name>TEST1</Name>
            <Value>0x35</Value>
        </Register>
        <Register>
            <Name>TEST2</Name>
            <Value>0x81</Value>
        </Register>
        <Register>
            <Name>WORCTRL</Name>
            <Value>0xfb</Value>
        </Register>
    </registersettings>
    <dcpanel>
        <Property role="44" name="m_chkRegView">2</Property>
        <Property role="44" name="m_chkCmdView">0</Property>
        <Property role="44" name="m_chkRfParameters">2</Property>
        <Property role="46" name="m_cmbUserMode">1</Property>
        <Property role="33" name="m_easyModeSettings">-1</Property>
        <Property role="33" name="m_typicalSettings">-1</Property>
        <Property role="37" name="m_testFuncPanel">2</Property>
    </dcpanel>
    <rfparameters>
        <Property role="46" name="m_cmbFrontends">0</Property>
        <Property role="44" name="m_chkHGMorBYP">2</Property>
        <Property role="46" name="m_cmbEmRevs">-1</Property>
        <Property role="46" name="Xtal Frequency">26.000000</Property>
    </rfparameters>
    <conttx>
        <Property role="45" name="m_rbtModulated">1</Property>
        <Property role="45" name="m_rbtUnmodulated">0</Property>
        <Property role="46" name="m_cmbDataFormat">-1</Property>
        <Property role="44" name="m_chkFreqSweep">0</Property>
        <Property role="44" name="m_chkChanSweep">0</Property>
    </conttx>
    <contrx>
        <Property role="46" name="m_cmbDataFormat">-1</Property>
        <Property role="44" name="m_chkAutoScroll">2</Property>
    </contrx>
    <packettx>
        <Property role="42" name="m_edtPayloadSize">30</Property>
        <Property role="42" name="m_edtPacketCount">100</Property>
        <Property role="42" name="m_edtPacketCountEsy">100</Property>
        <Property role="42" name="m_edtRandomPacketData">13 0d 89 0a 1c db ae 32 20 9a 50 ee 40 78 36 fd 12 49 32 f6 9e 7d 49 dc ad 4f 14 f2 </Property>
        <Property role="42" name="m_edtPacketData"></Property>
        <Property role="42" name="m_edtAccessAddress"></Property>
        <Property role="42" name="m_edtDeviceAddress"></Property>
        <Property role="44" name="m_chkAddSeqNbr">2</Property>
        <Property role="44" name="m_chkInfinite">0</Property>
        <Property role="44" name="m_chkInfiniteEsy">0</Property>
        <Property role="45" name="m_rbtRandom">1</Property>
        <Property role="45" name="m_rbtText">0</Property>
        <Property role="45" name="m_rbtHex">0</Property>
        <Property role="44" name="m_chkAdvanced">0</Property>
    </packettx>
    <packetrx>
        <Property role="42" name="m_edtPacketCount">100</Property>
        <Property role="42" name="m_edtPacketCountEsy">100</Property>
        <Property role="42" name="m_edtAccessAddress"></Property>
        <Property role="44" name="m_chkInfinite">0</Property>
        <Property role="44" name="m_chkInfiniteEsy">0</Property>
        <Property role="46" name="m_cmbViewFormat">0</Property>
        <Property role="44" name="m_chkSeqNbrIncluded">2</Property>
        <Property role="42" name="m_edtDumpFile"></Property>
        <Property role="44" name="m_chkAdvanced">0</Property>
        <Property role="44" name="m_chk802154gMode">0</Property>
    </packetrx>
    <commandpanel>
        <Property role="44" name="m_chkInsertLength">0</Property>
        <Property role="42" name="m_edtTxFifo"></Property>
        <Property role="42" name="m_edtRxFifo"></Property>
        <Property role="46" name="m_cmbInstrInput">-1</Property>
    </commandpanel>
</dcpanelconfiguration>

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE configuration SYSTEM "C:/Program Files (x86)/Texas Instruments/SmartRF Tools/SmartRF Studio 7/config/xml/configdata.dtd"[]>
<dcpanelconfiguration>
    <Devicename>CC1101</Devicename>
    <Description>Saved configuration data</Description>
    <registersettings>
        <Register>
            <Name>ADDR</Name>
            <Value>0x02</Value>
        </Register>
        <Register>
            <Name>FIFOTHR</Name>
            <Value>0x47</Value>
        </Register>
        <Register>
            <Name>FOCCFG</Name>
            <Value>0x76</Value>
        </Register>
        <Register>
            <Name>FREQ0</Name>
            <Value>0x62</Value>
        </Register>
        <Register>
            <Name>FREQ1</Name>
            <Value>0xa7</Value>
        </Register>
        <Register>
            <Name>FREQ2</Name>
            <Value>0x10</Value>
        </Register>
        <Register>
            <Name>IOCFG0</Name>
            <Value>0x08</Value>
        </Register>
        <Register>
            <Name>IOCFG2</Name>
            <Value>0x06</Value>
        </Register>
        <Register>
            <Name>MCSM0</Name>
            <Value>0x14</Value>
        </Register>
        <Register>
            <Name>MDMCFG2</Name>
            <Value>0x01</Value>
        </Register>
        <Register>
            <Name>MDMCFG3</Name>
            <Value>0xf8</Value>
        </Register>
        <Register>
            <Name>MDMCFG4</Name>
            <Value>0x88</Value>
        </Register>
        <Register>
            <Name>PA_TABLE0</Name>
            <Value>0x60</Value>
        </Register>
        <Register>
            <Name>PKTCTRL1</Name>
            <Value>0xa5</Value>
        </Register>
    </registersettings>
    <dcpanel>
        <Property name="m_chkRegView" role="44">2</Property>
        <Property name="m_chkCmdView" role="44">0</Property>
        <Property name="m_chkRfParameters" role="44">2</Property>
        <Property name="m_cmbUserMode" role="46">1</Property>
        <Property name="m_easyModeSettings" role="33">1</Property>
        <Property name="m_typicalSettings" role="33">-1</Property>
        <Property name="m_testFuncPanel" role="37">2</Property>
    </dcpanel>
    <rfparameters>
        <Property name="m_cmbFrontends" role="46">0</Property>
        <Property name="m_chkHGMorBYP" role="44">2</Property>
        <Property name="m_cmbEmRevs" role="46">-1</Property>
        <Property name="Xtal Frequency" role="46">26.000000</Property>
    </rfparameters>
    <conttx>
        <Property name="m_rbtModulated" role="45">1</Property>
        <Property name="m_rbtUnmodulated" role="45">0</Property>
        <Property name="m_cmbDataFormat" role="46">-1</Property>
        <Property name="m_chkFreqSweep" role="44">0</Property>
        <Property name="m_chkChanSweep" role="44">0</Property>
    </conttx>
    <contrx>
        <Property name="m_cmbDataFormat" role="46">-1</Property>
        <Property name="m_chkAutoScroll" role="44">2</Property>
    </contrx>
    <packettx>
        <Property name="m_edtPayloadSize" role="42">30</Property>
        <Property name="m_edtPacketCount" role="42">100</Property>
        <Property name="m_edtPacketCountEsy" role="42">100</Property>
        <Property name="m_edtRandomPacketData" role="42">13 0d 89 0a 1c db ae 32 20 9a 50 ee 40 78 36 fd 12 49 32 f6 9e 7d 49 dc ad 4f 14 f2 </Property>
        <Property name="m_edtPacketData" role="42"></Property>
        <Property name="m_edtAccessAddress" role="42"></Property>
        <Property name="m_edtDeviceAddress" role="42"></Property>
        <Property name="m_chkAddSeqNbr" role="44">2</Property>
        <Property name="m_chkInfinite" role="44">0</Property>
        <Property name="m_chkInfiniteEsy" role="44">0</Property>
        <Property name="m_rbtRandom" role="45">1</Property>
        <Property name="m_rbtText" role="45">0</Property>
        <Property name="m_rbtHex" role="45">0</Property>
        <Property name="m_chkAdvanced" role="44">0</Property>
    </packettx>
    <packetrx>
        <Property name="m_edtPacketCount" role="42">100</Property>
        <Property name="m_edtPacketCountEsy" role="42">100</Property>
        <Property name="m_edtAccessAddress" role="42"></Property>
        <Property name="m_chkInfinite" role="44">0</Property>
        <Property name="m_chkInfiniteEsy" role="44">0</Property>
        <Property name="m_cmbViewFormat" role="46">0</Property>
        <Property name="m_chkSeqNbrIncluded" role="44">2</Property>
        <Property name="m_edtDumpFile" role="42"></Property>
        <Property name="m_chkAdvanced" role="44">0</Property>
        <Property name="m_chk802154gMode" role="44">0</Property>
    </packetrx>
    <commandpanel>
        <Property name="m_chkInsertLength" role="44">0</Property>
        <Property name="m_edtTxFifo" role="42"></Property>
        <Property name="m_edtRxFifo" role="42"></Property>
        <Property name="m_cmbInstrInput" role="46">-1</Property>
    </commandpanel>
</dcpanelconfiguration>

  • Please provide information about what HW you are running and what SW you are running. There is nothing wrong with your settings. I tested them in SmartRF Studio (I use the CC1101EMs at 433 MHz.) and the SYNC found signal was asserted for every packet.

    You need to use SmartRF Studio generate settings for you.

    Siri
  • Thank you for a quick response.

    I got devices like this (I've got more of them, I've also changed them to check for hw failure):
    www.aliexpress.com/.../32295982608.html

    For sw, I run my custom code on a STM32 chip. Transmitting looks ok, I initialize the CC1101, fill in the FIFO and start transmitting then. I poll the status byte, it changes states accordingly (even when changing data rate or payload length, the transmission time changes appropriately). RSSI on the RX CC1101 side indicates quite strong signal, so it looks really ok.

    With SmartRF settings, I noticed that GDO pin (set to 0x08) rises for a very short time and goes low then (unlike with former settings), never goes high again until I stop TX and start it again. Is that ok? It means that preamble ended and maybe the sync word is there (the TX CC1101 is set to stay in TX after sending a packet) ? Knowing how that GDO pin (with 0x08 value) should behave when preamble is read and the sync word is being detected as well could help a lot.

    So you mean using Normal mode with sync word detection is no problem?

    Regards,
    Zdenek

  • Sync detection in Normal mode is not a problem.

    I opened you setting file in SmartRF STudio and did a code export to the CC1101 code example found here:

    The exported settings are shown below:

    // Address Config = Address check, no broadcast 
    // Base Frequency = 432.999817 
    // CRC Autoflush = false 
    // CRC Enable = true 
    // Carrier Frequency = 432.999817 
    // Channel Number = 0 
    // Channel Spacing = 199.951172 
    // Data Format = Normal mode 
    // Data Rate = 38.3835 
    // Deviation = 20.629883 
    // Device Address = 2 
    // Manchester Enable = false 
    // Modulated = true 
    // Modulation Format = GFSK 
    // PA Ramping = false 
    // Packet Length = 255 
    // Packet Length Mode = Variable packet length mode. Packet length configured by the first byte after sync word 
    // Preamble Count = 4 
    // RX Filter BW = 101.562500 
    // Sync Word Qualifier Mode = 30/32 sync word bits detected 
    // TX Power = 0 
    // Whitening = false 
    // PA table 
    #define PA_TABLE {0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
    
    static const registerSetting_t preferredSettings[]= 
    {
      {CC1101_IOCFG2,      0x06},
      {CC1101_IOCFG0,      0x08},
      {CC1101_FIFOTHR,     0x47},
      {CC1101_PKTCTRL1,    0xC5},
      {CC1101_PKTCTRL0,    0x05},
      {CC1101_ADDR,        0x02},
      {CC1101_FSCTRL1,     0x06},
      {CC1101_FREQ2,       0x10},
      {CC1101_FREQ1,       0xA7},
      {CC1101_FREQ0,       0x62},
      {CC1101_MDMCFG4,     0xCA},
      {CC1101_MDMCFG3,     0x83},
      {CC1101_MDMCFG2,     0x13},
      {CC1101_DEVIATN,     0x35},
      {CC1101_MCSM1,       0x32},
      {CC1101_MCSM0,       0x18},
      {CC1101_FOCCFG,      0x16},
      {CC1101_AGCCTRL2,    0x43},
      {CC1101_WORCTRL,     0xFB},
      {CC1101_FSCAL3,      0xE9},
      {CC1101_FSCAL2,      0x2A},
      {CC1101_FSCAL1,      0x00},
      {CC1101_FSCAL0,      0x1F},
      {CC1101_TEST2,       0x81},
      {CC1101_TEST1,       0x35},
      {CC1101_TEST0,       0x09},
    };

    The only thing I had to change in the code (cc1101_easy_link_tx.c) was the createPacket function. This is because you had enabled address filtering, so I hadd to add the address to the packet:

    static void createPacket(uint8 txBuffer[]) {
    
        txBuffer[0] = PKTLEN;                           // Length byte
        txBuffer[1] = 0x02;                             // ADDR
        txBuffer[2] = (uint8) (packetCounter >> 8);     // MSB of packetCounter
        txBuffer[3] = (uint8)  packetCounter;           // LSB of packetCounter
    
        // Fill rest of buffer with random bytes
        for(uint8 i = 4; i < (PKTLEN + 1); i++) {
            txBuffer[i] = (uint8)rand();
        }
    }

    BR

    Siri

  • Hi,
    thanks for the code and export. Still struggling with the sync word detection, everything else seems to be fine.
    Just one question ... If the packet is all sent correctly, how should the GDO pin behave when set to 0x08? Should it go low as soon as preamble is received and another part of packet (sync word) is beeing processed? Or something else makes the pin go low?

    Thanks for helping,

    Zdenek
  • ... and with transmitting phase (in normal mode) ... I just set up the registers, fill in the TX FIFO and start transmitting with the STX command probe, is that enough? It transmitts the preamble, sync word and the rest of packet automatically?
  • The GDO programmed as 0x08 should be asserted during preamble and go low when the sync word comes along.

    All the steps you need to transmit and receive a packet you will find in the code example I referred to.

    TX:
    Init MCU
    Init radio (reset radio ad configure settings)
    Write packet to TX FIFO: With the settings you have you need to write the length byte first and then the ADDR (0x02) before the rest of the payload
    Strobe STX
    Wait for falling edge interrupt on GDO2 (IOCFG2 = 0x06)

    A valid TX packet could be: 0x06, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05 (Where 0x06 is the length byte, and the first 0x02 is the address)

    RX:
    Init MCU
    Init RAdio
    Strobe SRX
    Wait for falling edge interrupt on GDO2 (IOCFG2 = 0x06)
    Check if data is actualy put in the FIFO (not filtered away dues to address or length filtering)
    Read RX FIFO

    Siri
  • Hi Siri,
    I used CC1101 boards tuned to 868MHz instead of my former 433MHz as there are presets for 868MHz version only in the SmartRF studio, but it still worked very odd. Then I found a testing code that polls the transmitting CC1101 frequently during transmission. I used that to confirm it goes through all the states it should.
    When I removed that polling code, it started to work like a charm.
    So thank you very much for helping, at least I could be sure I do TX/RX correctly. I also didn't know before that I need to use the SmartRF studio to generate register values.

    Best regards,
    Zdenek