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.

CC110L chip ready when reading from FIFO

Other Parts Discussed in Thread: CC110L

Hi All,

I recently got my CC110L transmitting and receiving with the launchpad kit. I have a query though: When I am reading from the Rx FIFO my code gets stuck in the "wait for chip ready" line which waits for the CC110L to pull the MISO/GDO1 line low after setting CSn low to show it is ready. If I use an additional function for a SPI command and forgo this line (for reading the FIFO only, all other SPI commands wait on chip ready) I get no problems, but is this normal?

  • It's not clear for me exactly where you get stuck in the code, could you post the relevant part of the code?

  • Hi,

    I have attached some working code for reading FIFO data used on the TrxEB. This should work in your application with very little modifications.

    If you compare this to your code, maybe you'll find something. 

  • Thanks Fredrik,

    My SPI code is very similar:

    char SPI_Write(char data)
    {
        static char rx_data = 0;

        while(P1IN & MISO); // wait for CC110L to pull MISO low - STICKS HERE ON FIFO READ

        while (!(IFG2 & UCB0TXIFG));    // USCI_B0 TX buffer ready?
        UCB0TXBUF = data;                  // Send data
        while (!(IFG2 & UCB0RXIFG));       // USCI_B0 RX Received?
        rx_data = UCB0RXBUF;               // Store received data

        return rx_data;
    }

    It hooks up while waiting for the CC110L to pull MISO low, but only during the read of Rx FIFO. However, I found that I can remove that line and I can reliably read data out from the FIFO, I just don't understand why this is? I can R/W to config registers and it's fine (as in the CC110L pulls the line low and the code continues to execute).

  • Hi, Gordon

    I have looked over your code once more and I think I found an error.

    You are waiting for MISO to go low each time you are writing, but this is only done when beginning communication in our code. Instead in your SPI_Write function you should wait for RX interrupt from the microcontroller, like this:

    while(!(UCB0IFG & UCRXIFG));

    So the correct flow of operation should be:

    1. Pull CS_N low
    2. Wait for MISO
    3. Send address
    4. Wait for RX interrupt
    5. Loop your function as before, just switch the line waiting for MISO with a line waiting for RX interrupt.

    Hope this helps!

  • Thanks Fredrik, it seems to be working (not that it was broken, but I did wonder if I was missing something).

    Gordon