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.

wireless PIR(433 Mhz) and cc1101

Other Parts Discussed in Thread: CC1101, TEST2

I have wireless PIR(433 Mhz) with remote control encoder SC2262. In datasheet written:

A Code Bit is the basic component of the encoded waveform, and can be classified as either an AD 

(Address/Data) Bit or a SYNC (Synchronous) Bit.
Address/Data (AD) Bit Waveform.
An AD Bit can be designated as Bit “0”, “1” or “f” if it is in low, high or floating state respectively. One bit
waveform consists of 2 pulse cycles. Each pulse cycle has 16 oscillating time periods. For further
details, please refer to the diagram below:

Synchronous (Sync.) Bit Waveform.
The Synchronous Bit Waveform is 4 bits long with 1/8 bit width pulse. Please refer to the diagram below:

A group of Code Bits is called a Code Word. A Code Word consists of 12 AD bits followed by one Sync Bit.
A Code Frame consists of four (4) continuous Code Words.

What I do:

Oscillator frequency of SC2262 is 10KHz. So Oscillating Clock Period(alpha) = 100Us.
4*alpha=400Us, so if i do data rate on cc1101 = 2500 baud, he must receive
AD BIT 0 as 10001000
AD BIT 1 as 11101110
AD BIT f as 10001000
Synchronous Bit as 10000000000000000000000000000000

AD bits set by tri-state jumpers. I have no jumpers, and my AD bits are ffffffffffff.
And I expect receive on cc1101 this frame:((AD BIT f)*12 + Sync)*4

10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010000000000000000000000000000000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100000000000000000000000000000001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000000000000000000000000000000010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010000000000000000000000000000000

My cc1101 register setting are:

(Base 433.92 Mhz, Data rate 2.5 kBaud, RX filter BW 101, asynchonous mode)

RF_SETTINGS = {
'IOCFG0':0x0D,
'PKTCTRL1':0x00,
'PKTCTRL0':0x32,
'FSCTRL1':0x06,
'FREQ2':0x10,
'FREQ1':0xB0,
'FREQ0':0x71,
'MDMCFG4':0xC6,
'MDMCFG3':0x93,
'MDMCFG2':0x30,
'DEVIATN':0x42,
'MCSM0':0x18,
'FOCCFG':0x14,
'BSCFG':0x1C,
'AGCCTRL2':0x04,
'AGCCTRL1':0x00,
'AGCCTRL0':0x92,
'WORCTRL':0xFB,
'FREND1':0x56,
'FREND0':0x11,
'FSCAL3':0xEA,
'FSCAL2':0x2A,
'FSCAL1':0x00,
'FSCAL0':0x1F,
'TEST0':0x09,
'TEST1':0x35,
'TEST2':0x81,
'FIFOTHR':0x47
}

And I receive 200-230 bits, 2 examples:

1000000111000111000000100111100010001110000000011111000000001110000000011100000000011110100000000100010000111100001100000000100000111010000001000010000000011101110000111000001001111110000000011000000111100000000111101111111

10010000000001011110000000000001111001110010001000111110000000010000110011110000000011111100010011100100010011100101000110111110001111010001001111011111000111000000000111100000000001110010000011100100000001000011100111001111111

When I change data rate to 5 kBaud (MDMCFG4=0xC7), I receive 225-235 bits, 2 examples:
1111000111000101001000000001110000000000001000000011010011100010011000110000011110001000010110010100000010000100010010010100000100011010001100110000000000011100000010000010001000011101010000000000011010000010001010011110111111111

11111111111110110011100011100000010010010011100000111000010000100100110100111000000011100000000000000011000011100011100111010000001000110001100000100000100000100000000111110001000000001010001000000111000000010010000100001001111111

Where i`m wrong, please help me. How receive frame on cc1101 from PIR.

  • Based on what you write the register settings are ok, although you should note that AGCCTRL2,1,0 affects sensitivity. Please refer to design note DN022 (www.ti.com/lit/swra215). Based on experience using 0x04 00 92 is a good starting point for 100 kHz RX filter BW. 

    One potential problem is that the data is not very balanced and this could potentially result in the gain in the RX path (LNA and digital gain) not being set correctly. That is, for OOK modulation we want the internal gain to be more or less constant so that the signal into the ADC has low level when receiving a logic 0 and a high level when receiving a logic 1. If there are long strings of 0's as in your case the gain will be increased by the AGC and this will cause problems when receiving the logic 1 (i.e the logic 1 cannot be distinguished from the logic 0). 

    As a test you should try to freeze the gain in the RX path. Set AGCCTRL0[3:2] = 3. The gain is then set by register AGCTEST.

    AGCTEST[7:6]: LNA1 gain. 0 = max gain, 01b medium gain, 10b minimum gain

    AGCTEST[5:3]: LNA2 gain. 0 = min gain, 111b minimum gain

    AGCTEST[2:0]: Digital gain. 0 = min gain, 111b minimum gain

    That is, AGCTEST = 0x1F is maximum gain. 

    When you freeze the gain as outlined above the input dynamic range will be limited. Note also, that if the input signal is strong you might want to reduce the LNA1 and/or LNA2 gain. 

    Another thing to check is if there is frequency offset between transmitter and receiver. Have you verified that the transmitter is at 433.92 MHz?

    Have you read the RSSI register when transmitter is on? Does the RSSI level increase? 

  • Thank you for reply!

    I forgot to say that PATABLE is (0,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d,0x1d)
    In wireless PIR set one port resonator R433D with frequency 433.92MHz.
    RSSI level in between 0xe5-0xf5, when transmitter is off.
    And RSSI level in between 0x05-0x15, when transmitter is on.

    When i freeze the gain(AGCCTRL0=0x9E) and AGCTEST=0x1f I receive 230-270 bit. 3 examples:
    00001000000000011000000000000000000000000000001001100000000000011111101100000110000111000000000010000000111000011000000000000100000100000000000101000100101100011010000001100000010111100110100010100010000111101100000001111111110111011110100101000011111111110111111111111 

    01001100000001100010010010100010110010110000011100001110010000010000100000000000000000000011100000110001100000101110001100000011000100000011100011000000111010000000001000010000000110000000001000000010000000000010001010001011111100011111111

    111011000001111111110110100000001101110001000100001111000000000000000000000000000000001000100000000000000000010000000100001100001100000000000001000011110111100000011111001001000001001000001110000000000010000010001000000000110000000001111111111

    RSSI level in between 0xe5-0xf5, when transmitter is off.

    And RSSI level is 0x80 and sometimes 0x1-0x12, when transmitter is on.