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.

Strange cc2500 Receive Problem

Other Parts Discussed in Thread: CC2500

I am writing my own CC2500 radio libraries using the ez430-rf2500 as a test platform.

When I receive a packet, several bytes are left shifted by one bit. For example, if I send a packet with data 0x0101010101, I might receive 0x0101020101, or send 0x555555 and receive 0xaa55aa.

The interesting part is that I have CRC_AUTOFLUSH=1, so the shift either occurs before transmission or after reception from/to the CC2500.

I initially suspected my SPI configuration on the MSP430 to be the problem, but I connected the SPI pins to a protocol analyzer and that does not seem to be the problem. When transmitting over SPI from MSP430 to CC2500, the data stays intact.

I then thought that maybe it is the CC2500's SPI, so I decided to do a burst read of the CC2500's configuration registers to see if there was any bit-shifting. Unfortunately, this was not the case.

Am I missing something here? If reading the configuration registers works fine, the SPI interface should be working fine. At the same time, if the bits are shifting over-the-air(upon reception or transmisison) the CRC should not check out and the packet should be flushed and never sent over SPI.

I would appreciate any suggestions to what I could check next.

- Alvaro

 

Here is the capture of the transmission from MSP430 to CC2500 of a packet full of ones.

 

Here is the capture of the reception from CC2500 to MSP430 of a packet full of ones. (You can see how some are reported as twos)

For reference, the code I used can be seen here:

https://github.com/alvarop/cc430bsn/blob/ez430-rf2500/cc2500test/cc2500test.c

Radio library:
https://github.com/alvarop/cc430bsn/blob/ez430-rf2500/lib/radio_cc2500.c
SPI configuration:
https://github.com/alvarop/cc430bsn/blob/ez430-rf2500/lib/uart_ez430.c

  • I think I've isolated the problem. I programmed one of the ez430-rf2500 using the TI sample code in windows( with CCS ) and transmitted the same data.

    Whenever I transmit data with that one, I receive it just fine. On the other hand, when I send it using my own libraries compiled with msp430-gcc, the data received is already distorted.

    I decided to take SPI captures of both versions while transmitting the same data to see if there were any differences.

    The first capture shows the one working correctly, while the second shows the faulty one. It seems that the clock (CHANNEL 1) on the second one skips the constant breaks between bytes that the correct one has.

    Any ideas as to why this could happen? As far as I can tell, I'm using the same code as the examples.

    UPDATE: I solved the problem as I was writing this. I added a __no_operation() between byte transmissions in this function:

    /
    // @fn write_burst_register( uint8_t address, uint8_t* buffer, uint8_t size )
    // @brief Write multiple values to CC2500
    //
    void write_burst_register( uint8_t address, uint8_t* buffer, uint8_t size )
    {
      uint16_t index;
     
      P3OUT &= ~BIT0;                 // CSn enable
     
      while ( !( IFG2&UCB0TXIFG ) );  // USCI_B0 TX buffer ready?
      UCB0TXBUF = address | BURST_BIT;// send address byte
     
      for( index = 0; index < size; index++ )
      {
        while ( !( IFG2 & UCB0TXIFG ) );// USCI_B0 TX buffer ready?
        UCB0TXBUF = buffer[index];
        __no_operation();
      }
     
      while ( UCB0STAT & UCBUSY );    // wait for TX to complete

      P3OUT |= BIT0;                  // CSn disable
    }