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.

CC1120 weird RXFIFO read behaviour

Other Parts Discussed in Thread: CC1120

Hello,

I have two CC1120 radios i.e. A is transmitter with CRC enabled and B is receiver with APPEND_STATUS enabled and PKT_LEN set to 12 i.e. 0x0C. Radio A transmits a fixed length packet of 12 bytes. At the receiver, after PKT_SYNC_RXTX de-asserts, I read the NUM_RXBYTES register to know how many bytes to read from RXFIFO. The first time I read, the NUM_RXBYTES register returns 14 bytes i.e. 12 bytes payload + 2 status bytes, so I read 14 bytes from RXFIFO.

Issue #1:

The first (i.e. Byte[0]) and last (i.e. Byte[13]) bytes were garbage. Byte[1] through Byte[12] were the correct payload sent by the transmitter. I thought Byte[0] through Byte[11] should be the payload, while Byte[12] and Byte[13] are the status bytes, right?

Issue #2:

After I read the RXFIFO, I checked NUM_RXBYTES register again and it returns 1 bytes. I thought NUM_RXBYTES should returns 0 since I already read all 14 bytes from RXFIFO earlier.

Issue #3:

Radio A then sent another 12-byte packet. At the receiver, after PKT_SYNC_RXTX de-asserts, I read NUM_RXBYTES register and it now returns 15 bytes, presumably 14 bytes payload + 1 unknown byte left in the RXFIFO. When I read all 15 bytes from RXFIFO, Byte[0], Byte[1] and Byte[14] were garbage, while Byte[2] through Byte[13] were the correct payload. Again, after I have read RXFIFO and checked NUM_RXBYTES register, it still returns 1 byte. This is repeated for subsequent packets transmitted by radio A.

Question:

1. Why RXFIFO never empties when I have read all data from it?

2. Why I never actually receive status bytes appended at the end of the packet? Instead, I'm getting garbage bytes at the beginning and end of packet.

Appreciate if someone can help me out. Thanks. 

  • You are correct that the payload should be at index 0-11, and index 12 and 13 should contain the status byte. The NUM_RXBYTES should be 0 after reading the 14 bytes.

    Please provide your register settings so that we can take a look at them.

    The register settings should be on the same format as you get them from SmartRF Studio, so that we can easily import then to one of our existing code examples:

    static const registerSetting_t preferredSettings[]=

    {

        {CC1120_IOCFG3, 0xXX},

        {CC1120_IOCFG2, 0xXX},

        {CC1120_IOCFG1, 0xXX},

        {CC1120_IOCFG0, 0xXX},

        .

        .

        .

    BR

    Siri

     

     

  • Hi Siri,

    Thanks for your reply.

    I think I know what is wrong. It seems my SPI read FIFO always leaves one byte behind. So as workaround, I read one dummy byte at the beginning and this seems to solve the problem (found this from googling around).