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: CCA and CS not working in CC1101

Part Number: CC1101
Other Parts Discussed in Thread: TEST2

Hi,

CCA Not working!!!

We have CCA issue in CC1101. We have two transmitter and two receiver on same frequency(Same Channel) but different address. Both are working individually perfectly but at same time transmitting none of them are working perfectly and it's malfunctioning. We have set CCA and CS as per below. I have done STX before TX.

TX

0x09, // IOCFG2 GDO2 Output Pin Configuration
0x2E, // IOCFG1 GDO1 Output Pin Configuration
0x80, // IOCFG0 GDO0 Output Pin Configuration
0x07, // FIFOTHR RX FIFO and TX FIFO Thresholds
0x57, // SYNC1 Sync Word, High Byte
0x43, // SYNC0 Sync Word, Low Byte
0x3E, // PKTLEN Packet Length
0x0E, // PKTCTRL1 Packet Automation Control
0x45, // PKTCTRL0 Packet Automation Control
0xFF, // ADDR Device Address
0x00, // CHANNR Channel Number
0x06, // FSCTRL1 Frequency Synthesizer Control
0x00, // FSCTRL0 Frequency Synthesizer Control
0x21, // FREQ2 Frequency Control Word, High Byte
0x65, // FREQ1 Frequency Control Word, Middle Byte
0x6A, // FREQ0 Frequency Control Word, Low Byte
0xF8, // MDMCFG4 Modem Configuration 0xCA 0xC8-100Khz
0x93, // MDMCFG3 Modem Configuration 0x83 10Kb-0x93
0x13, // MDMCFG2 Modem Configuration
0xA3, // MDMCFG1 Modem Configuration 0xA0
0xff, // MDMCFG0 Modem Configuration 0xF8
0x34, // DEVIATN Modem Deviation Setting
0x07, // MCSM2 Main Radio Control State Machine Configuration
0x2F,//0x2C, // MCSM1 Main Radio Control State Machine Configuration
0x18, // MCSM0 Main Radio Control State Machine Configuration
0x16, // FOCCFG Frequency Offset Compensation Configuration
0x6C, // BSCFG Bit Synchronization Configuration
0x43, // AGCCTRL2 AGC Control
0x50, // AGCCTRL1 AGC Control
0x91, // AGCCTRL0 AGC Control
0x02, // WOREVT1 High Byte Event0 Timeout
0x26, // WOREVT0 Low Byte Event0 Timeout
0x09, // WORCTRL Wake On Radio Control
0x56, // FREND1 Front End RX Configuration
0x17, // FREND0 Front End TX Configuration
0xA9, // FSCAL3 Frequency Synthesizer Calibration
0x0A, // FSCAL2 Frequency Synthesizer Calibration
0x00, // FSCAL1 Frequency Synthesizer Calibration
0x11, // FSCAL0 Frequency Synthesizer Calibration
0x41, // RCCTRL1 RC Oscillator Configuration
0x00, // RCCTRL0 RC Oscillator Configuration
0x59, // FSTEST Frequency Synthesizer Calibration Control,
0x7F, // PTEST Production Test
0x3F, // AGCTEST AGC Test
0x81, // TEST2 Various Test Settings
0x3F, // TEST1 Various Test Settings
0x0B // TEST0 Various Test Settings

RX

0x0E,//0x09, // IOCFG2 GDO2 Output Pin Configuration
0x2E, // IOCFG1 GDO1 Output Pin Configuration
0x80, // IOCFG0 GDO0 Output Pin Configuration
0x07, // FIFOTHR RX FIFO and TX FIFO Thresholds
0x57, // SYNC1 Sync Word, High Byte
0x43, // SYNC0 Sync Word, Low Byte
0x3E, // PKTLEN Packet Length
0x0E, // PKTCTRL1 Packet Automation Control
0x45, // PKTCTRL0 Packet Automation Control
0xFF, // ADDR Device Address
0x00, // CHANNR Channel Number
0x06, // FSCTRL1 Frequency Synthesizer Control
0x00, // FSCTRL0 Frequency Synthesizer Control
0x21, // FREQ2 Frequency Control Word, High Byte
0x65, // FREQ1 Frequency Control Word, Middle Byte
0x6A, // FREQ0 Frequency Control Word, Low Byte
0xF8, // MDMCFG4 Modem Configuration 0xCA 0xC8-100Khz
0x93, // MDMCFG3 Modem Configuration 0x83 10Kb-0x93
0x17,//0x13, // MDMCFG2 Modem Configuration
0xA3, // MDMCFG1 Modem Configuration 0xA0
0xff, // MDMCFG0 Modem Configuration 0xF8
0x34, // DEVIATN Modem Deviation Setting
0x07, // MCSM2 Main Radio Control State Machine Configuration
0x2C, // MCSM1 Main Radio Control State Machine Configuration
0x18, // MCSM0 Main Radio Control State Machine Configuration
0x16, // FOCCFG Frequency Offset Compensation Configuration
0x6C, // BSCFG Bit Synchronization Configuration
0x43, // AGCCTRL2 AGC Control
0x50, // AGCCTRL1 AGC Control
0x91, // AGCCTRL0 AGC Control
0x02, // WOREVT1 High Byte Event0 Timeout
0x26, // WOREVT0 Low Byte Event0 Timeout
0x09, // WORCTRL Wake On Radio Control
0x56, // FREND1 Front End RX Configuration
0x17, // FREND0 Front End TX Configuration
0xA9, // FSCAL3 Frequency Synthesizer Calibration
0x0A, // FSCAL2 Frequency Synthesizer Calibration
0x00, // FSCAL1 Frequency Synthesizer Calibration
0x11, // FSCAL0 Frequency Synthesizer Calibration
0x41, // RCCTRL1 RC Oscillator Configuration
0x00, // RCCTRL0 RC Oscillator Configuration
0x59, // FSTEST Frequency Synthesizer Calibration Control,
0x7F, // PTEST Production Test
0x3F, // AGCTEST AGC Test
0x81, // TEST2 Various Test Settings
0x3F, // TEST1 Various Test Settings
0x0B // TEST0 Various Test Settings

  • Hi Harsh,

    I have assigned this thread to an expert. They will get back to you with some feedback. 

    Regards,
    Siddanth

  • Please provide info regarding what settings from SmartRF Studio you are using, so that I do not need to go through every register and field to figure out your configuration.

    Also, what do you mean by “not working”? How is it failing?

    I see that you use CCA_MODE = 2 (unless currently receiving a packet). This means that your device will enter TX even if another device has started to send for example preamble. If this is the case, more than one device will send at the same time, and none of the packets will be received.

    You should also avoid using off modes (at least when you are testing). This way it is much easier to figure out what state the device is in, and what is going on.

    I assume that you meant that you strobe SRX before TX, and not STX? If, not, it is no wonder CCA is not working, as the device must be in RX to be able to figure out if the channel is available or not.

    Also, why are you using different settings in RX and TX?

    A simple test you can do is to use one of the default settings in SmartRF Studio and then just enable CCA (Set CCA mode = 1 or 3). Write a packet to the TX FIFO, Strobe SRX and then STX.

    Use another device to be the jammer. You can then see that if a jammer is present, strobing STX after SRX will cause the device to stay in RX, while it will go to TX and then IDLE, if the channel is clear.

    If you use CCA mode = 2 and do the same exercise, and have a jammer just sending modulated data, the packet will be send even if the jammer is really strong, since the radio has not found any sync word.

  • Please provide info regarding what settings from SmartRF Studio you are using, so that I do not need to go through every register and field to figure out your configuration.

    Here is setting from SmartRF Studio.

    Also, what do you mean by “not working”? How is it failing?

    We have two receiver and two transmitter as same place. Both are working individually but at same time its not working. Both receiver are on same channel and but different address. We want to work both at same time but its not working.

    I see that you use CCA_MODE = 2 (unless currently receiving a packet). This means that your device will enter TX even if another device has started to send for example preamble. If this is the case, more than one device will send at the same time, and none of the packets will be received.

    Yes i have use CCA_MODE = 2. Than which mode should i use for that? I have also check with CCA_MODE = 1 and CCA_MODE = 3 but not working.

    You should also avoid using off modes (at least when you are testing). This way it is much easier to figure out what state the device is in, and what is going on.

    Now i'll check with IDEL Mode.

    I assume that you meant that you strobe SRX before TX, and not STX? If, not, it is no wonder CCA is not working, as the device must be in RX to be able to figure out if the channel is available or not.

    I have corrected this but still its not working.

    Also, why are you using different settings in RX and TX?

    For RX i used Carrier sense and for TX i used CCA.

    Do you have any flow chart so that we can follow that chart for CCA to work.

    Best regards

    Harsh

  • I understand that your application is not working the way you want it to, but this does not mean that CCA is not working.

    The first thing you need to do is to test the CCA feature separately to make sure that it works.

    You should then use recommended settings from SmartRF Studio based on your RF parameters, without doing a lot of packet handling changes and other changes (you are modifying WOR register, address filtering, off modes etc.) I also noted that you are making changes to registers that are stated that you need to use settings from SmartRF Studio (for example MDMCFG1). You should not do that.

    From SmartRF Studio you get the following settings for the RF parameters that you have chosen:

    // Address Config = No address check 
    // Base Frequency = 314.999664 
    // CRC Autoflush = false 
    // CRC Enable = true 
    // Carrier Frequency = 314.999664 
    // Channel Number = 0 
    // Channel Spacing = 338.012695 
    // Data Format = Normal mode 
    // Data Rate = 9.9926 
    // Deviation = 19.042969 
    // Device Address = 0 
    // Manchester Enable = false 
    // Modulated = true 
    // Modulation Format = GFSK 
    // PA Ramping = true 
    // 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 = 58.035714 
    // Sync Word Qualifier Mode = 30/32 sync word bits detected 
    // TX Power = 0 
    // Whitening = true 
    // PA table 
    #define PA_TABLE {0x00,0x12,0x0d,0x33,0x69,0x63,0x52,0x51}
    
    static const registerSetting_t preferredSettings[]= 
    {
        {CC1101_IOCFG0, 0x06},
        {CC1101_FIFOTHR, 0x47},
        {CC1101_FSCTRL1, 0x06},
        {CC1101_FREQ2, 0x0C},
        {CC1101_FREQ1, 0x1D},
        {CC1101_FREQ0, 0x89},
        {CC1101_MDMCFG4, 0xF8},
        {CC1101_MDMCFG3, 0x93},
        {CC1101_MDMCFG2, 0x13},
        {CC1101_MDMCFG1, 0x23},
        {CC1101_MDMCFG0, 0xAA},
        {CC1101_DEVIATN, 0x34},
        {CC1101_MCSM0, 0x18},
        {CC1101_FOCCFG, 0x16},
        {CC1101_AGCCTRL2, 0x43},
        {CC1101_WORCTRL, 0xFB},
        {CC1101_FREND0, 0x17},
        {CC1101_FSCAL3, 0xE9},
        {CC1101_FSCAL2, 0x2A},
        {CC1101_FSCAL1, 0x00},
        {CC1101_FSCAL0, 0x1F},
        {CC1101_TEST2, 0x81},
        {CC1101_TEST1, 0x35},
    };
    

    To test CCA you do not have to do anything to these settings.

    • Make a small test program where you do the following:
    • Init MCU
    • Init radio with the settings above
    • Write a packet to the TX FIFO
    • Strobe SRX to enter RX Mode (you can here poll marcstate to make sure that the radio has had time to enter RX before you strobe STX)
    • Strobe STX to transmit the packet

    If the channel is available the packet will be sent and the radio will enter IDLE state

    If the channel is BUSY, the radio will remain in RX.

    The test above is what you need to start testing, to verify that your CS Threshold is set correctly.

    Once you have verified that this works (it can even be tested with SmartRF Studio as I explained in the first post), you need to start debug your application to figure out why it does not work.

    To debug this it is useful to output the LNA and PA signals to some GDO pins to figure out when your devices are in RX and TX, to better understand what goes wrong.

    Siri

  • Thank you very much for update.

    To test CCA you do not have to do anything to these settings.

    • Make a small test program where you do the following:
    • Init MCU
    • Init radio with the settings above
    • Write a packet to the TX FIFO
    • Strobe SRX to enter RX Mode (you can here poll marcstate to make sure that the radio has had time to enter RX before you strobe STX)
    • Strobe STX to transmit the packet

    If the channel is available the packet will be sent and the radio will enter IDLE state

    If the channel is BUSY, the radio will remain in RX.

    The test above is what you need to start testing, to verify that your CS Threshold is set correctly.

    Once you have verified that this works (it can even be tested with SmartRF Studio as I explained in the first post), you need to start debug your application to figure out why it does not work.

    I'll check with Smart RF Studio (I'll connect CC debugger to CC1101) with above setting. After that I'll post an update.

     

    To debug this it is useful to output the LNA and PA signals to some GDO pins to figure out when your devices are in RX and TX, to better understand what goes wrong.

    For this i use GDO_CFG = 0x09(Clear channel assessment) or 0x0E(Carrier sense)

    Harsh