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.

data loss with a cc1101

Other Parts Discussed in Thread: CC1101, TEST2

Hi all,

I am making a simple toy which has a wireless remote and a motor controller. Both ends have a CC1101. These are my settings at both ends.

#define CC1101_DEFVAL_IOCFG2     0x29        // GDO2 Output Pin Configuration
#define CC1101_DEFVAL_IOCFG1     0x2E        // GDO1 Output Pin Configuration
#define CC1101_DEFVAL_IOCFG0     0x06        // GDO0 Output Pin Configuration
#define CC1101_DEFVAL_FIFOTHR    0x07        // RX FIFO and TX FIFO Thresholds
#define CC1101_DEFVAL_SYNC1      0xB5        // Synchronization word, high unsigned char
#define CC1101_DEFVAL_SYNC0      0x47        // Synchronization word, low unsigned char
#define CC1101_DEFVAL_PKTLEN     0xFF        // Packet Length
#define CC1101_DEFVAL_PKTCTRL1   0x06        // Packet Automation Control
#define CC1101_DEFVAL_PKTCTRL0   0x45        // Packet Automation Control
#define CC1101_DEFVAL_ADDR       0x01        // Device Address
#define CC1101_DEFVAL_CHANNR     0x00        // Channel Number
#define CC1101_DEFVAL_FSCTRL1    0x08        // Frequency Synthesizer Control
#define CC1101_DEFVAL_FSCTRL0    0x00        // Frequency Synthesizer Control
// Carrier frequency = 868 MHz
#define CC1101_DEFVAL_FREQ2_868  0x21        // Frequency Control Word, High unsigned char
#define CC1101_DEFVAL_FREQ1_868  0x62        // Frequency Control Word, Middle unsigned char
#define CC1101_DEFVAL_FREQ0_868  0x76        // Frequency Control Word, Low unsigned char
// Carrier frequency = 902 MHz
#define CC1101_DEFVAL_FREQ2_915  0x22        // Frequency Control Word, High unsigned char
#define CC1101_DEFVAL_FREQ1_915  0xB1        // Frequency Control Word, Middle unsigned char
#define CC1101_DEFVAL_FREQ0_915  0x3B        // Frequency Control Word, Low unsigned char

#define CC1101_DEFVAL_MDMCFG4    0xCA        // Modem Configuration
#define CC1101_DEFVAL_MDMCFG3    0x83        // Modem Configuration
#define CC1101_DEFVAL_MDMCFG2    0x1B        // Modem Configuration
#define CC1101_DEFVAL_MDMCFG1    0x22        // Modem Configuration
#define CC1101_DEFVAL_MDMCFG0    0xF8        // Modem Configuration
#define CC1101_DEFVAL_DEVIATN    0x35        // Modem Deviation Setting
#define CC1101_DEFVAL_MCSM2      0x07        // Main Radio Control State Machine Configuration
//#define CC1101_DEFVAL_MCSM1      0x30        // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_MCSM1      0x20        // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_MCSM0      0x18        // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_FOCCFG     0x16        // Frequency Offset Compensation Configuration
#define CC1101_DEFVAL_BSCFG      0x6C        // Bit Synchronization Configuration
#define CC1101_DEFVAL_AGCCTRL2   0x03        // AGC Control(max dvga gain=0, max lna gain=0, magn target=3)
#define CC1101_DEFVAL_AGCCTRL1   0x49        // AGC Control(select between strategies for LNA gain adjustment,disable cs_rel_thr, enable cs_abs_thr 7 db below)
#define CC1101_DEFVAL_AGCCTRL0   0x91        // AGC Control(freeze AGC after sync word has been found, filter_length=64,
#define CC1101_DEFVAL_WOREVT1    0x87        // High unsigned char Event0 Timeout
#define CC1101_DEFVAL_WOREVT0    0x6B        // Low unsigned char Event0 Timeout
#define CC1101_DEFVAL_WORCTRL    0xFB        // Wake On Radio Control
#define CC1101_DEFVAL_FREND1     0x56        // Front End RX Configuration
#define CC1101_DEFVAL_FREND0     0x10        // Front End TX Configuration
#define CC1101_DEFVAL_FSCAL3     0xE9        // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL2     0x2A        // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL1     0x00        // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL0     0x1F        // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_RCCTRL1    0x41        // RC Oscillator Configuration
#define CC1101_DEFVAL_RCCTRL0    0x00        // RC Oscillator Configuration
#define CC1101_DEFVAL_FSTEST     0x59        // Frequency Synthesizer Calibration Control
#define CC1101_DEFVAL_PTEST      0x7F        // Production Test
#define CC1101_DEFVAL_AGCTEST    0x3F        // AGC Test
#define CC1101_DEFVAL_TEST2      0x81        // Various Test Settings
#define CC1101_DEFVAL_TEST1      0x35        // Various Test Settings
#define CC1101_DEFVAL_TEST0      0x09        // Various Test Settings

I am trying to operate at 902MHz. To turn the motor forward I send 0x01,0x21,0x02,0x0F,0x00,0xDF,0x04 and to turn it backwards I send 0x01,0x21,0x02,0xF1,0xFF,0xDF,0x04.

The forward command experiences a lot of data loss. I have tried Can someone tell me what could be happening here. I have enabled manchester encoding and data whitening but there seems to be no effect.

The  system works correctly when the same data is sent via UART. So, I dont think this is an application issue.

Any help will be appreciated

Thanks!

Sid

  • Hi,

    FSCTRL1 should be 0x06 and FIFOTHR should be 0x47. Have you tried the default sync word to see if that improves performance? 

  • Hi,

    I don't think changing the FSCTRL1 and FIFOTHR helped me.

    My current settings for sync words are

    #define CC1101_DEFVAL_SYNC1      0xB5        // Synchronization word, high unsigned char
    #define CC1101_DEFVAL_SYNC0      0x47        // Synchronization word, low unsigned char

    When you say default, do you want me to try the following?

    #define CC1101_DEFVAL_SYNC1      0xD3        // Synchronization word, high unsigned char
    #define CC1101_DEFVAL_SYNC0      0x91        // Synchronization word, low unsigned char

    The RSSI values read from packets that failed CRC at the receiving end during failure was about 0xE0 and the LQI value was 0x50.

    When I have the transmitter and the receiving end at 3 feet from each other, the RSSI obtained was 0x56 and the LQI values were 0x1F. Do these values seem correct?


    Thanks for your help!

    Sid

  • We did a few experiments and found when the PWM to the motor driver is on, we are observing the radio communication via CC1101 become very unreliable (lot of bad CRCs and or missed data).

    What PWM frequencies are best to use so that we donot affect the CC1101. Currently our PWM duty cycle is 200KHz. The performance improved slightly at 98.35KHz. Based on my settings above, can you suggest a PWM frequency that will not have harmonics at 915MHz?

    The Motor driver is also a negative chopper. How can we make sure this noise source is not entering the RF section.

    Thanks for your help!

    Sid

  • First, I would increase the distance or reduce the output power to keep the receiver well away from the saturation. What happens if you then test communication without the motor running? Have you tried shielding to reduce the interference from the motor?

  • Hi CHS,

    If I do not generate the PWM that gets fed to the motor driver, the communication worked well providing good range. There were still a few lost packets though. We used a simple aluminum tape connected to ground to see if shielding improved the range. The range did not improve. Please send us an email at sid@bluesparq.com or ahed@bluesparq.com and we may be able to share the layout and schematics for you to take a look at it.

    Next, I lowered the data rate to 4.8Kbps from 38.4Kbps. I also, increased the filter _length to 64 on the receiver side. The range improved significantly.

    These are my new configuration settings on both Tx and Rx:

    #define CC1101_DEFVAL_IOCFG2     0x29        // GDO2 Output Pin Configuration
    #define CC1101_DEFVAL_IOCFG1     0x2E        // GDO1 Output Pin Configuration
    #define CC1101_DEFVAL_IOCFG0     0x06        // GDO0 Output Pin Configuration
    #define CC1101_DEFVAL_FIFOTHR    0x47        // RX FIFO and TX FIFO Thresholds
    #define CC1101_DEFVAL_SYNC1      0xD3        // Synchronization word, high unsigned char
    #define CC1101_DEFVAL_SYNC0      0x91        // Synchronization word, low unsigned char
    #define CC1101_DEFVAL_PKTLEN     0xFF        // Packet Length
    #define CC1101_DEFVAL_PKTCTRL1   0x06        // Packet Automation Control
    #define CC1101_DEFVAL_PKTCTRL0   0x45        // Packet Automation Control
    #define CC1101_DEFVAL_ADDR       0x01        // Device Address
    #define CC1101_DEFVAL_CHANNR     0x00        // Channel Number
    #define CC1101_DEFVAL_FSCTRL1    0x06        // Frequency Synthesizer Control
    #define CC1101_DEFVAL_FSCTRL0    0x00        // Frequency Synthesizer Control
    // Carrier frequency = 868 MHz
    #define CC1101_DEFVAL_FREQ2_868  0x21        // Frequency Control Word, High unsigned char
    #define CC1101_DEFVAL_FREQ1_868  0x62        // Frequency Control Word, Middle unsigned char
    #define CC1101_DEFVAL_FREQ0_868  0x76        // Frequency Control Word, Low unsigned char
    // Carrier frequency = 902 MHz
    #define CC1101_DEFVAL_FREQ2_915  0x23        // Frequency Control Word, High unsigned char
    #define CC1101_DEFVAL_FREQ1_915  0x31        // Frequency Control Word, Middle unsigned char
    #define CC1101_DEFVAL_FREQ0_915  0x3B        // Frequency Control Word, Low unsigned char

    #define CC1101_DEFVAL_MDMCFG4    0xC7        // Modem Configuration
    #define CC1101_DEFVAL_MDMCFG3    0x83        // Modem Configuration
    #define CC1101_DEFVAL_MDMCFG2    0x1B        // Modem Configuration
    #define CC1101_DEFVAL_MDMCFG1    0x22        // Modem Configuration
    #define CC1101_DEFVAL_MDMCFG0    0xF8        // Modem Configuration
    #define CC1101_DEFVAL_DEVIATN    0x40        // Modem Deviation Setting
    #define CC1101_DEFVAL_MCSM2      0x07        // Main Radio Control State Machine Configuration
    //#define CC1101_DEFVAL_MCSM1      0x30        // Main Radio Control State Machine Configuration
    #define CC1101_DEFVAL_MCSM1      0x20        // Main Radio Control State Machine Configuration
    #define CC1101_DEFVAL_MCSM0      0x18        // Main Radio Control State Machine Configuration
    #define CC1101_DEFVAL_FOCCFG     0x16        // Frequency Offset Compensation Configuration
    #define CC1101_DEFVAL_BSCFG      0x6C        // Bit Synchronization Configuration
    #define CC1101_DEFVAL_AGCCTRL2   0x03        // AGC Control(max dvga gain=0, max lna gain=0, magn target=3)
    #define CC1101_DEFVAL_AGCCTRL1   0x49        // AGC Control(select between strategies for LNA gain adjustment,disable cs_rel_thr, enable cs_abs_thr 7 db below)
    #define CC1101_DEFVAL_AGCCTRL0   0x93        // AGC Control
    #define CC1101_DEFVAL_WOREVT1    0x87        // High unsigned char Event0 Timeout
    #define CC1101_DEFVAL_WOREVT0    0x6B        // Low unsigned char Event0 Timeout
    #define CC1101_DEFVAL_WORCTRL    0xFB        // Wake On Radio Control
    #define CC1101_DEFVAL_FREND1     0x56        // Front End RX Configuration
    #define CC1101_DEFVAL_FREND0     0x10        // Front End TX Configuration
    #define CC1101_DEFVAL_FSCAL3     0xE9        // Frequency Synthesizer Calibration
    #define CC1101_DEFVAL_FSCAL2     0x2A        // Frequency Synthesizer Calibration
    #define CC1101_DEFVAL_FSCAL1     0x00        // Frequency Synthesizer Calibration
    #define CC1101_DEFVAL_FSCAL0     0x1F        // Frequency Synthesizer Calibration
    #define CC1101_DEFVAL_RCCTRL1    0x41        // RC Oscillator Configuration
    #define CC1101_DEFVAL_RCCTRL0    0x00        // RC Oscillator Configuration
    #define CC1101_DEFVAL_FSTEST     0x59        // Frequency Synthesizer Calibration Control
    #define CC1101_DEFVAL_PTEST      0x7F        // Production Test
    #define CC1101_DEFVAL_AGCTEST    0x3F        // AGC Test
    #define CC1101_DEFVAL_TEST2      0x81        // Various Test Settings
    #define CC1101_DEFVAL_TEST1      0x35        // Various Test Settings
    #define CC1101_DEFVAL_TEST0      0x09        // Various Test Settings

    The patable is initialized with the following:

    unsigned char paTable[8] = {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

    However, we now seem to have run into a new issue with the communication. After a while, the wireless communication breaks down.

    During one such failures, I could see my transmitter transmitting data by probing  the SPI lines and GDO0. I had to restart the receiving module for communication to resume.

    But on two other instances, I got the system working again by restarting the transmitter.

    Why do you think this could be happening?

    Sid

  • Sid, 

    I recommend connecting the supply to an oscilloscope so that you can get an idea of how much ripple your PWM driver is causing on the main supply for the RF chip. It will likely show you that you need more decoupling on the supply rails.

    Regards,
    /TA