2
\$\begingroup\$

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():

  1. Clear radio status flags
  2. Enable auto acknowledgement for data pipe 0
  3. Enable receive data pipe 0
  4. Set the address width to 5 bytes
  5. Set the retransmit register to wait 250 us between retransmissions and retransmit up to 15 times
  6. Change the RF channel to 50
  7. Change the RF setup register to 1 Mbps data rate and 0 dBm
  8. Change the receive pipe 0 payload width to 5
  9. Delay for 4.5 ms
  10. 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
  11. Delay for 4.5 ms again
  12. Enable interrupts globally, go to LPM0 and wait for a timer interrupt once a second

To transmit after every second has passed:

  1. Clear the status flags
  2. Flush the transmit FIFO of any previous unsent packets
  3. Write the address of the receiver in the receive address data pipe 0 register (because auto acknowledgement is on)
  4. Write the address of the receiver in the transmit address register
  5. Write the transmit payload
  6. 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():

  1. Clear radio status flags
  2. Flush the Tx FIFO in case there's anything in it
  3. Enable auto acknowledgement for data pipe 0
  4. Enable receive data pipe 0
  5. Set the address width to 5 bytes
  6. Set the retransmit register to wait 250 us between retransmissions and retransmit up to 15 times
  7. Change the RF channel to 50
  8. Change the RF setup register to 1 Mbps data rate and 0 dBm
  9. Change the receive pipe 0 payload width to 5
  10. Write the receive address for data pipe 0
  11. 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)
  12. Flush the receive FIFO in case it contains old packets
  13. Delay for 4.5 ms
  14. 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
  15. Delay for 4.5 ms again
  16. 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.

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

The problem was solved making sure powering on the radios was the last step taken before starting to transmit or receive, by inserting a delay of at least Tpd2stby (specified in the datasheet as 4.5 ms) after changing the config register to power the radios on, and after starting a transmission waiting for the transmission to end before changing the config register again to power the radio down (it will take at least Tstby2a, specified in the datasheet as 130 us).

Here's the datasheet: https://www.sparkfun.com/datasheets/Wireless/Nordic/nRF24L01P_Product_Specification_1_0.pdf

The time values come from table 6.1.7 Timing Information and there is a state transition diagram on page 22.

\$\endgroup\$
2
  • \$\begingroup\$ Can you elaborate on this a bit more? Also having trouble getting my NRF24L01 to work. Are you saying to add a delay after declaring the radio in code? \$\endgroup\$ Commented Apr 20, 2022 at 4:40
  • \$\begingroup\$ @JacobWaters I don't know anything about the nRF24L01. I used the nRF24L01+ and I'm not sure what changes were made. I edited my answer to mention the datasheet. I didn't do any declaring, I just set up the MSP430's SPI registers, digital I/O pins and interrupts to communicate with the radio. \$\endgroup\$
    – dman
    Commented Apr 21, 2022 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.