I am using ATmega32s to drive the nRF24L01+ chips and a low dropout 3.3v regulator (TI’s LP2950) to power the nRF from the five volt buss. Both the transmitter and receiver use the same code. I use a digital I/O pin to select whether to transmit or receive. I have positive indication through LEDs of which mode each chip is in. I have verified communication via the SPI and am able to set register values and read them back reliably. I do minimum initialization based on reading some of this forum, although I’ve tried initializing channel numbers, transmission speed, power, retry delay, addresses, payload width, and number of retries with the same result. The initialization procedure for the nRF is:
- Clear the PWR_UP bit in the CONFIG register
- Wait 100 ms
- Sets the PWR_UP bit in the CONFIG register
- Set RX_PW_P0 to 3 bytes Depending on the mode (RX or TX) the program does the following: In receive mode:
- Set the PRIM_RX bit in the CONFIG register
- Wait for 130 us
- Pull the CE pin high. In transmit mode:
- Pull the CE pin low
- Clear the PRIM_RX bit in the CONFIG register
- Wait for 130 us
- Issue a FLUSH_TX command
- Write a 3-byte packet using the W_TX_PAYLOAD command
- Pull the CE pin high
- Wait 10 us
- Pull the CE pin low
- Set the PRIM_RX bit in the CONFIG register
- Wait for 130 us I am able to confirm that the FLUSH_TX command and W_TX_PAYLOAD seem to be working by pausing the program before and after these commands and checking the TX_EMPTY bit in the FIFO_STATUS register. I also confirm the pipe receive address and the transmit address as well as the receive payload width. However it seems the packet is never transmitted. I power both units up in received mode and switch one to transmit mode. The FIFO_STATUS register on the transmitter has only the RX_EMPTY bit set. The TX_EMPTY bit is clear mean there is still data in the TX FIFO. On the receiver the RX_EMPTY bit and the TX_EMPTY bits are both set showing that nothing has been received.