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.

Wake on Radio Packet Error - CC1101

Other Parts Discussed in Thread: CC1101

Hi,

I'm trying to communicate a couple of CC1101 modules on WOR mode. I'm on the 433Mhz with 464kHz channel bandwidth at 1.2kbps.

I have used the settings for wor, on this link  where Siri posted. 

From transmitter I'm transmitting 140ms of preamble and send the data afterwards. Receiver successfully catch the packet. So no problem on catching packet. Also packet length is correct. But the real data inside the package is broken. It seems like did not successfully catch the packet bytes even though catch at correct length.

Note: As I noticed now it catches the first byte right after the length byte correctly. So in my guess, maybe somehow RX mode finishes and bytes corrupt.

What can be the cause for a situation like this? Upon your request I can supply the all settings etc.

  • I am afraid I will need your register settings and packet format to be able to help you.

    If I do I can set up a small test where I use your settings and transmit the same packet as you are and I can see if I get the same problems as you are experiencing.

    BR

    Siri

  • Packet is:

    unsigned char packet[10] = { 0x09, 0x21, 0x01, 0x01, 0x00 ,0x01, 0x02, 0x00, 0x01, 0x00};

    (P.s: As I stated I'm able to receive 0x21 also but not after that)

    This is the transmitter settings, no wor mode active on trasnmitter side:

    struct sCC1101
    {
      unsigned char iocfg2;   // GDO2 output pin configuration
      unsigned char iocfg1;   // GDO1 output pin configuration
      unsigned char iocfg0;   // GDO0 output pin configuration
      unsigned char fifothr;  // RXFIFO and TXFIFO thresholds
      unsigned char sync1;    // Sync word, high byte
      unsigned char sync0;    // Sync word, low byte
      unsigned char pktlen;   // Packet length
      unsigned char pktctrl1; // Packet automation control
      unsigned char pktctrl0; // Packet automation control
      unsigned char addr;     // Device address
      unsigned char channr;   // Channel number
      unsigned char fsctrl1;  // Frequency synthesizer control
      unsigned char fsctrl0;  // Frequency synthesizer control
      unsigned char freq2;    // Frequency control word, high byte
      unsigned char freq1;    // Frequency control word, middle byte
      unsigned char freq0;    // Frequency control word, low byte
      unsigned char mdmcfg4;  // Modem configuration 4
      unsigned char mdmcfg3;  // Modem configuration 3
      unsigned char mdmcfg2;  // Modem configuration 2
      unsigned char mdmcfg1;  // Modem configuration 1
      unsigned char mdmcfg0;  // Modem configuration 0
      unsigned char deviatn;  // Modem deviation setting
      unsigned char mcsm2;    // Main radio control state machine configuration
      unsigned char mcsm1;    // Main radio control state machine configuration
      unsigned char mcsm0;    // Main radio control state machine configuration
      unsigned char foccfg;   // Frequency offset compensation configuration
      unsigned char bscfg;    // Bit synchronization configuration
      unsigned char agcctrl2; // AGC control 2
      unsigned char agcctrl1; // AGC control 1
      unsigned char agcctrl0; // AGC control 0
      unsigned char worevt1;  // High byte event0 timeout
      unsigned char worevt0;  // Low byte event0 timeout
      unsigned char worctrl;  // Wake on radio control
      unsigned char frend1;   // Front end RX configuration
      unsigned char frend0;   // Front end TX configuration
      unsigned char fscal3;   // Frequency synthesizer calibration
      unsigned char fscal2;   // Frequency synthesizer calibration
      unsigned char fscal1;   // Frequency synthesizer calibration
      unsigned char fscal0;   // Frequency synthesizer calibration
      unsigned char rcctrl1;  // RC oscillator configuration
      unsigned char rcctrl0;  // RC oscillator configuration
      unsigned char fstest;   // Frequency synthesizer calibration control
      unsigned char ptest;    // Production test
      unsigned char agctest;  // AGC test
      unsigned char test2;    // Various test settings 2
      unsigned char test1;    // Various test settings 1
      unsigned char test0;    // Various test settings 0
    };
    
    static const struct sCC1101 gCC1101Settings = {
      //	GDx Pin Config
      0x2E,               // GDO2 output pin configuration.
      0x2E,               // GDO1 output pin configuration.
      0x06,               // GDO0 output pin configuration.
    
      // FIFO thresholds
      0x07,               // RXFIFO and TXFIFO thresholds.
    
      //	SYNC WORDS
      0xD3,               // Sync word, high byte
      0x91,               // Sync word, low byte
    
      //	PACKET LENGTH: 255
      0xFF,               // Packet length.
    
      //	PACKET AUTOMATION CONTROL
      0x0C,               // Packet automation control.
      0x05,               // Packet automation control.
    
      //	DEVICE ADDRESS
      0x00,               // Device address.
    
      //	CHANNEL NUMBER
      0x00,               // Channel number.
    
      //	FREQUENCY SYNTHESIZER
      0x0A,               // Frequency synthesizer control.
      0x00,               // Frequency synthesizer control.
    
      // FREQUENCY CONTROL : 433mhz
      0x10,               // Frequency control word, high byte.
      0xA7,               // Frequency control word, middle byte.
      0x62,               // Frequency control word, low byte.
    
      //	MODEM CONFIGURATION
      0x36,               // Modem configuration.
      0x83,               // Modem configuration.
      0x03,               // Modem configuration.
      0x21,               // Modem configuration.
      0xEE,               // Modem configuration.
    
      //	MODEM DEVIATION
      0x65,               // Modem deviation setting (when FSK modulation is enabled).
      //  15 yapsakta olur
    
      //	State Machine Configuration
      0x07,               // Main Radio Control State Machine configuration.
      0x00,               // Main Radio Control State Machine configuration.
      0x18,               // Main Radio Control State Machine configuration.
    
      //	FREQUENCY OFFSET
      0x16,               // Frequency Offset Compensation Configuration.
    
      //	BIT SYNC
      0x6C,               // Bit synchronization Configuration.
    
      //	AGC control
      0x07,               // AGC control.
      0x40,               // AGC control.
      0x91,               // AGC control.
    
      //	Even timeout
      0x87,               // High byte Event 0 timeout
      0x6B,               // Low byte Event 0 timeout
    
      //	Wake On Radio (WOR)
      0xF8,               // Wake On Radio control
    
      //	RX Config
      0x57,               // Front end RX configuration.
      0x10,               // Front end RX configuration.
    
      //	SYNTHESIZER CALIBRATION
      0xE9,               // Frequency synthesizer calibration.
      0x2A,               // Frequency synthesizer calibration.
      0x00,               // Frequency synthesizer calibration.
      0x1F,               // Frequency synthesizer calibration.
    
      //	RF Oscillator Config
      0x41,               // RC oscillator configuration
      0x00,               // RC oscillator configuration
    
      //	SYNTHESIZER CALIBRATION
      0x59,               // Frequency synthesizer calibration control
    
      //	VARIOUS TESTS
      0x7F,               // Production test
      0x3C,               // AGC test
      0x88,               // Various test settings.
      0x35,               // Various test settings.
      0x09                // Various test settings.
    };
    

    On the receiver side these are the settings:

    static const struct sCC1101 gCC1101Settings = {
      //	GDx Pin Config
      0x2E,               // GDO2 output pin configuration.
      0x2E,               // GDO1 output pin configuration.
      0x06,               // GDO0 output pin configuration.
    
      // FIFO thresholds
      0x07,               // RXFIFO and TXFIFO thresholds.
    
      //	SYNC WORDS
      0xD3,               // Sync word, high byte
      0x91,               // Sync word, low byte
    
      //	PACKET LENGTH: 255
      0xFF,               // Packet length.
    
      //	PACKET AUTOMATION CONTROL
      0x64,               // Packet automation control.//4C auto flush if crc fail
      0x05,               // Packet automation control.
    
      //	DEVICE ADDRESS
      0x00,               // Device address.
    
      //	CHANNEL NUMBER
      0x00,               // Channel number.
    
      //	FREQUENCY SYNTHESIZER
      0x0A,               // Frequency synthesizer control.
      0x00,               // Frequency synthesizer control.
    
      // FREQUENCY CONTROL : 433mhz
      0x10,               // Frequency control word, high byte.
      0xA7,               // Frequency control word, middle byte.
      0x62,               // Frequency control word, low byte.
    
      //	MODEM CONFIGURATION
      0x36,               // Modem configuration.
      0x83,               // Modem configuration.
      0x03,               // Modem configuration.
      0x21,               // Modem configuration.
      0xEE,               // Modem configuration.
    
      //	MODEM DEVIATION
      0x65,               // Modem deviation setting (when FSK modulation is enabled).
     
    
      //	State Machine Configuration
      0x18,               // Main Radio Control State Machine configuration.
      0x00,               // Main Radio Control State Machine configuration.
      0x18,               // Main Radio Control State Machine configuration.
    
      //	FREQUENCY OFFSET
      0x16,               // Frequency Offset Compensation Configuration.
    
      //	BIT SYNC
      0x6C,               // Bit synchronization Configuration.
    
      //	AGC control
      0x07,               // AGC control.
      0x40,               // AGC control.
      0x91,               // AGC control.
    
      //	Even timeout
      0x11,               // High byte Event 0 timeout
      0x9A,               // Low byte Event 0 timeout
      // 
      //	Wake On Radio (WOR)
      0x78,               // Wake On Radio control
    
      //	RX Config
      0x57,               // Front end RX configuration.
      0x10,               // Front end RX configuration.
    
      //	SYNTHESIZER CALIBRATION
      0xE9,               // Frequency synthesizer calibration.
      0x2A,               // Frequency synthesizer calibration.
      0x00,               // Frequency synthesizer calibration.
      0x1F,               // Frequency synthesizer calibration.
    
      //	RF Oscillator Config
      0x41,               // RC oscillator configuration
      0x00,               // RC oscillator configuration
    
      //	SYNTHESIZER CALIBRATION
      0x59,               // Frequency synthesizer calibration control
    
      //	VARIOUS TESTS
      0x7F,               // Production test
      0x3C,               // AGC test
      0x88,               // Various test settings.
      0x35,               // Various test settings.
      0x09                // Various test settings.
    };

  • Hi

    I am afraid I am a bit confused here. You are saying that you are using 1.2 kbps and are sending 140 ms preamble but your settings show a data rate of 2.4 kbps and that you are sending 4 bytes of preamble.

    4 bytes of preamble takes 13.3 ms to send.

    The radio needs about 4 bytes of preamble for settling so using WOR will not work.

    In the example I posted the transmitter transmits 24 bytes of preamble at 1.2 kbps. This takes 160 ms. You need to make sure you wake up often enough to make sure that you receive at least 4 bytes preamble. This means that your wake-up interval is 133 ms.

    Siri

  • Hello,

    Sorry for confusion, my mistake I forget I changed the baud rate for trying at last night . 

    About preambling, actually I'm doing it manually comparing to your 24 byte preamble settings solution.

    I set the radio on TX mode and wait for 140ms on mcu and then load the FIFO and send the data. 

    On the receiver side as I stated before it receives the packet even first data byte correctly. If it is not settling, how it is taking length and first data byte correctly? 

    EDIT:

    As it is really interesting, after your post I tried with 24 bytes preamble setting instead of my stone aged manuall preamble technique. And I received the packet with CRC OK. So in this case my problem seems solved. Thanks for your help.

    But I'm still confused about why the data corrupts in my way where I wait for 140ms manually.

  • Hi

    I tested 1.2 kbps with a BW of 464 kHz and was not able to receive any data. By reducing the RX Filter BW to 323 kHz everything worked fine. I programmed the transmitter to transmit 24 bytes of preamble and disabled PQT.

    My settings are found below:

    static const registerSetting_t preferredSettings[]={

      {CC1101_IOCFG0,        0x06},
      {CC1101_PKTCTRL0,      0x05},
      {CC1101_FSCTRL1,       0x08},
      {CC1101_FREQ2,         0x10},
      {CC1101_FREQ1,         0xA7},
      {CC1101_FREQ0,         0x62},
      {CC1101_MDMCFG4,       0x55},
      {CC1101_MDMCFG3,       0x83},
      {CC1101_MDMCFG2,       0x13},
      {CC1101_MDMCFG1,       0x72},
      {CC1101_DEVIATN,       0x15},
      {CC1101_MCSM0,         0x18},
      {CC1101_FOCCFG,        0x1D},
      {CC1101_BSCFG,         0x1C},
      {CC1101_AGCCTRL2,      0xC7},
      {CC1101_AGCCTRL1,      0x00},
      {CC1101_AGCCTRL0,      0xB2},
      {CC1101_WORCTRL,       0xFB},
      {CC1101_FREND1,        0xB6},
      {CC1101_FSCAL3,        0xE9},
      {CC1101_FSCAL2,        0x2A},
      {CC1101_FSCAL1,        0x00},
      {CC1101_FSCAL0,        0x1F},
      {CC1101_TEST0,         0x09},
      {CC1101_RSSI,          0x80},
      {CC1101_MARCSTATE,     0x01},
      {CC1101_VCO_VC_DAC,    0x94},
      {CC1101_WORCTRL,       0x78},
      {CC1101_WOREVT1,       0x11},
      {CC1101_WOREVT0,       0x9A},
      {CC1101_MCSM2,         0x18},
    };

    BR

    Siri