nRF24L01 - writing to registers fails but reading works

Hi all,

I am trying hard to use a nRF24L01 with my AVR USBKEY (at90usb1287). I am using a reworked version of Atmels sourcecode to drive the nRF. The Problem is: After doing all the initialization to the registers I read all registers back to dump them of the CDC-USART. I can read all the default values perfectly without any error, but ich can’t write the registers.

Even such easy code as

NRF_select();           // CSN low, init SPI transaction
SPDR = 0x05 | 0x20;
while ((SPSR & (1<<SPIF)) == 0);
SPDR = 8;
while ((SPSR & (1<<SPIF)) == 0);
NRF_unselect();         // CSN high again

for setting the channel to 8 isn’t working. As I can read the registers I doubt that there is an error in the wiring and so.

Any ideas?

Best regards,

Robert

Hi all,

for other people who might be struggling: I used the HWB-Button of my usbkey to trigger the read of all the register values. As this button is debounced using a capacitor with 220nF it was able to “reset” the nRF24L01 on each keypress. Funny to mention that the AT90USB1287 was totally unaffected by this! So I suggest everyone to take care of a very clean voltage supply, because it looks like the nRF is very sensitive to this. Two 100nF capacitor nearby the nRF solved the issue!

BR

Robert