This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI returns 0x0F on any request after random period of time

Hi, im using nRF24L01+ to constantly transmit data and all working fine, but at some point SPI fails and the only returned values I get are 0x0F - doesnt matter which register I try to read or write. Any idea why is that happening?

Thanks, Sergey

  • Hi,

    Can you provide us with a bit more information?

    1. Does this happen on other nRF24L01+ that you're testing with?
    2. What SPI freq and voltage is used?
    3. Have you scoped the SPI-lines to see that the signal is nice and clean, and verify that 0x0F is going over the bus?
    4. Does every read-command return this, even read pipe address?
    5. When this happens, is it possible to recover by flushing RX and TX pipes?

    Best regards Håkon

  • Hi Håkon,

    I now know how the problem occurs, but not sure how to solve it.

    So the setup was: 1 receiver, 2 transmitters. They are time synced, so there is a form of TDMA going on to separate times when transmitters are sending. However because of not precise clock sometimes transmitting times overlap and there are multiple packets on air going to receiver. At that moment receiver freezes and gets into situation when all registers return 0x0F or in some cases it reports normal operation but it doesnt transmit or receive anything.

    Is there a way to detect collision on the receiver side and reset device or do something else?

    Answering your questions:

    1. Yes same situation happens on all receivers.
    2. voltage is 3.3v and the frequency is 4Mhz for SPI.
    3. Yes SPI communications are clear.
    4. All commands return 0x0F or as I just wrote it returns correct values, but chip doesnt do what it says its doing - no TX or RX happening
    5. Flushing doesnt help thats why i was thinking about reset of some kind?

    Kind regards, Sergey

  • Hi,

    actually now getting even weirder situation. 1 receiver, 1 transmitter. At some point receiver stops receiving and I checked CONFIG 0x00 register and it has CRCO set to 0. Initially it was set to 1. Of course in that case it wouldnt receive any packets. Question what does reset it to 0?

    Thanks, Sergey

  • And on another try it set CRC0 to 0 but left EN_CRC as 1. So im afraid registers are randomly being reset? Any idea how is that possible?

  • Hi,

    If you have "Dynamic Payload Length" enabled (en_dpl in FEATURE register, and "DYNPD" register), the state machine inside the nRF24L01+ can go into a unknown state if you receive a packet which is of length = 0 || length > 32 bytes. I have not seen SPI transaction byte errors in this state, but I have seen the RX deadlock situation.

    What you can do to prevent this is to add a check for your payload length:

    
    void radio_isr()
    {
    ....
    len = read_reg(R_RX_PL_WID);
    if (len == 0 || len > 32) 
      flush_rx_fifo();
    else 
      read_out_payload(&my_payload);
    ....
    }
    
    

    Best regards Håkon

Related