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, 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?
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:
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
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