- Mon Aug 20, 2007 10:31 am
#33963
Has anyone ever experienced that a nrf24l01 with no transmitter in the neighbourhood and AA+CRC enabled receives a load of crap sometimes? Mine does that and when it happens (and it happens often) it also doesn't receive any real packets anymore from another nrf? Somehow it craps out and stops receiving real packets..
Also somehow the RX_DR irq get set, when the RX buffer is empty, as it prints out X's (see code).
Both my nrf's do this, so most likely it is not a defective unit, but what can it be???
Please respond if you have any clue. I'm really stuck at the moment!
Also somehow the RX_DR irq get set, when the RX buffer is empty, as it prints out X's (see code).
Both my nrf's do this, so most likely it is not a defective unit, but what can it be???
Please respond if you have any clue. I'm really stuck at the moment!
Code: Select all
nrf24l01_clear_flush(); //clear interrupts and flush
while ( !(nrf24l01_irq_pin_active() && nrf24l01_irq_rx_dr_active()) && ReadTimer0() < maxListeningTime) // wait for packet
if (nrf24l01_irq_rx_dr_active()) // if recieved
{
if (nrf24l01_fifo_rx_empty()) // doublecheck. THIS X GETS PRINTED!! HOW????
{
UARTIntPutChar('X');
}
nrf24l01_irq_clear_all(); //clear interrupts
nrf24l01_read_rx_payload(&recievedData, 28); // read into char
DelayUS(500); // allow time to send ACK and settle as RX again (= ARD time)
if (okData[0] == recievedData[0] && okData[1] == recievedData[1]) // compare data
{
UARTIntPutChar('O');
return 1; // revieced an OK
}
if (falseData[0] == recievedData[0] && falseData[1] == recievedData[1])
{
UARTIntPutChar('N');
return 0; // recieved a Not OK
}
for (i = 0; i < 28; i++)
{
UARTIntPutChar(recievedData[i]); // THIS PUTS OUT A BUNCH OF CRAP
}
PORTAbits.RA0 = 0;
return 3;
}