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 signal receiving problem

Other Parts Discussed in Thread: CC1101, MSP430F1232, MSP430F2274

Hi,

I'm currently using cc1101 in my project trying. I followed the application note and designed a transmitter and a receiver. To test them, I made a series of data on the transmitter side, and expect to receive the same data on the receiver side. However, I never received the same data. 

I controlled the transmitter side and let it send out 1 packet at a time, and the receiver side gives me a indication once it received 1 packet otherwise it would stay in RX mode. For example, I sent a series of 20 bytes, where the first byte indicated the length of the packet since I am using variable packet length mode

sent:   {0x12, 0x13, 0x05, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}

received: {0xED, 0xF2, 0x18, 0x65, 0x12, 0x7A,0xCC, 0xDB, 0x15, 0x85, 0x2D, 0xC6, 0x8F, 0x68, 0xA8,0x F5, 0xAB, 0x82, 0xD2, 0x72}

None of the received data are the same. However, the first received byte is always the 1's complement of the first sent byte

The register settings for both sides are exactly the same. I guess the pre-amble and the sync words receiving is alright, since the receiver received the packet promptly right after I sent the packet from the transmitter side.

Thanks in advance!

 

Yang

  • Hi Shuozhi

    It is hard to determine the cause of this without more information.

    Is it possible to post your register settings and  code snippet for the TX and RX operation?

    Br

    Martin

  • Thanks for your reply! I actually already solved the problem. It might be caused by the SPI register writing/reading timing.  I don't know if this a common issue. I used MSP430F1232 and MSP430F2274 in my two ends, and the same SPI register access timing problem occurred for both MCUs, which operate in different frequencies (4.9MHz and 16MHz). SPI baud rate is a half of the MCLK speed. I don't see any documentation on the timing after writing/reading the radio register, or maybe I missed them.

    Originally, I used the same code as provided in the MSP430-to-CC1101 interfacing example program, and I had this issue for both MCUs. I added some delay to each of the the SPI register access functions from MSP430-to-CC1101 interfacing example program, and all the data look alright now. For example:

    void TI_CC_SPIWriteReg(char addr, char value)

    {

      TI_CC_CSn_PxOUT &= ~TI_CC_CSn_PIN;        // /CS enable

      while (!(IFG2&UTXIFG0));                  // Wait for TX to finish

      U0TXBUF = addr;                           // Send address

      while (!(IFG2&UTXIFG0));                  // Wait for TX to finish

      U0TXBUF = value;                          // Send value

      while(!(UTCTL0&TXEPT));                   // Wait for TX complete

      TI_CC_CSn_PxOUT |= TI_CC_CSn_PIN;         // /CS disable

      TI_CC_Wait(45);

    }

    If there is any explanation on this, I would really appreciate!

    Thanks!

  • Can you read from the registers? This will ensure that the SPI connection is working correct. Try to read out the part number (should be 0x00) and version number (should be 0x04).

    If the SPI connection is working, that you should check the settings of the packet length and packet mode. You have to choose if you want to sent a packet in variable, fixed of infinite mode. The most easiest way to check of the wireless connection is working, is to send an packet of 10 bytes, where the packet length  is 0x0A and the packet mode is fixed. You should also turn the CRC16 and status append off.

     

    greetings,

     

    Rick

  • Yes, reading and writing to the registers are all fine. I read all the registers one by one after writing the initial settings to them. 

    I actually found the problem, the example code does not check the status of the radio core. When it enables CS pin, it only uses the following code to check the status of the SPI interface:

    {

    TI_CC_CSn_PxOUT &= ~TI_CC_CSn_PIN;        // /CS enable 

    while (!(IFG2&UCB0TXIFG));

    }

    However, according to CC1101 transceiver manual page 28, MCU must wait till SO pin goes low indicating the radio core crystal is running. So I added one piece of code in between.

    {

     

    TI_CC_CSn_PxOUT &= ~TI_CC_CSn_PIN;        // /CS enable 

    while(TI_CC_SPI_USCIB0_PxIN & TI_CC_SPI_USCIB0_SOMI);

    while (!(IFG2&UCB0TXIFG));

    }

    Now everything is working well. Thank you very much for all you guy's help!

     

    Yang