I am trying to send data from one MSP430 to another MSP430 using Nordic Semiconductor nRF24L01+ radios, but I am unable to receive transmitted packets. I am able to read from and write to the radio registers using SPI and I get interrupts from the transmitting radio when it reaches the maximum number of retransmissions, so I would guess the problem has to do with how I have the radios set up. Currently I have the transmitting radio sending a packet once a second. If I poll the RPD register of the receiving radio it's usually 0 but occasionally 1, which makes sense with the number of retransmissions taking place. Below are the register settings for both radios in the order that I write them:
Transmitting MSP430 main():
- Clear radio status flags
- Enable auto acknowledgement for data pipe 0
- Enable receive data pipe 0
- Set the address width to 5 bytes
- Set the retransmit register to wait 250 us between retransmissions and retransmit up to 15 times
- Change the RF channel to 50
- Change the RF setup register to 1 Mbps data rate and 0 dBm
- Change the receive pipe 0 payload width to 5
- Delay for 4.5 ms
- Change the config register so no interrupts are masked, CRC is enabled, CRC is 2 bytes, the radio is powered on, and the radio is in transmit mode
- Delay for 4.5 ms again
- Enable interrupts globally, go to LPM0 and wait for a timer interrupt once a second
To transmit after every second has passed:
- Clear the status flags
- Flush the transmit FIFO of any previous unsent packets
- Write the address of the receiver in the receive address data pipe 0 register (because auto acknowledgement is on)
- Write the address of the receiver in the transmit address register
- Write the transmit payload
- Set CE high, delay for 12.5 us, then set CE low again
Every interrupt I get is because the maximum number of retransmissions has been reached and the packet never leaves the transmit FIFO.
Receiving MSP430 main():
- Clear radio status flags
- Flush the Tx FIFO in case there's anything in it
- Enable auto acknowledgement for data pipe 0
- Enable receive data pipe 0
- Set the address width to 5 bytes
- Set the retransmit register to wait 250 us between retransmissions and retransmit up to 15 times
- Change the RF channel to 50
- Change the RF setup register to 1 Mbps data rate and 0 dBm
- Change the receive pipe 0 payload width to 5
- Write the receive address for data pipe 0
- Set the transmit address register to the same address as receive pipe 0 (I tried doing this in case the transmit address needs to be set for auto acknowledgement to work)
- Flush the receive FIFO in case it contains old packets
- Delay for 4.5 ms
- Change the config register so no interrupts are masked, CRC is enabled, CRC is 2 bytes, the radio is powered on, and the radio is in receive mode
- Delay for 4.5 ms again
- Set the CE pin high
It doesn't matter if I poll the status register every second or put the MSP430 to sleep and wait for the IRQ pin to go high, I never receive a packet, none of the flags in the status register change, and the receive and transmit FIFOs stay empty.
Any advice would be greatly appreciated because I am pulling my hair out trying to debug these radios.