This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Trouble with communication between two nRF24L01+ chips

I have worked with the nRF24L01+ for a couple of days now without getting it to work. The setup of the chip is done as described below, without any luck of getting a communication going from one chip to another. The routines are tested on a board with a TM4C123G micro controller with two nRF24L01+ breakout boards mounted to two separate SPI channels. The SPI communication seems to work fine (checked with a scope).

No matter what data is sent, the received data is all zeros. The status register does not change on either of the nRF24L01+ chips and seems to be the same before and after a send/receive.

Hopefully some of you can verify that the routines below is correct or point out the mistakes. Any help is appreciated.

Thanks in advance :-)

Read/Write routine

  1. Wait 10 µs
  2. Set CS low (chip select)
  3. SPI put (W_REGISTER + register address)
  4. SPI get STATUS byte
  5. For all data bytes
    1. If read mode: SPI put NOP and save returned value from SPI get
    2. If write mode: SPI put data byte and discard returned value from SPI get
    3. Wait 10 µs (for each byte)
  6. Set CS high (chip deselect)

Initialization

With the Read/Write routine shown above, the following operations are done in order to initialize the device (after voltage is applied to the MCU and nRF24L01+): image description

Reset

  1. Set CS low (select chip)
  2. Wait 10 µs
  3. SPI Put 0x27 (W_REGISTER + STATUS)
  4. Read 1 byte with SPI (discarded STATUS byte)
  5. Wait 10 µs
  6. SPI Put 0x70 (Clear IRQ bits in STATUS)
  7. Read 1 byte with SPI (discarded STATUS byte)
  8. Wait 10 µs
  9. Set CS high (deselect chip)

Transmit

  1. Send FLUSH_TX command
  2. Send W_TX_PAYLOAD with 5 byte data
  3. Wait 10 µs
  4. Set CE high (chip enable)
  5. Wait 20 µs
  6. Set CE low (chip disable)
  7. Wait 10 µs

Receive

  1. Set CE high (chip enable)
  2. Wait 130 µs
  3. Send command R_RX_PAYLOAD and save 5 bytes of data
  4. Reset registers (with routine above)
  5. Wait 130 µs
  6. Set CE low (chip disable)
  • On the receive side you should keep CE high until you receive the RX_DR. I would recommend that until you start getting reliable communication and understanding. Make sure the the PTX is actually sending by probing the VDD_PA pin. This will go up to 1.8 V when sending and that way you will at least be able to determine if it's the PTX or the PRX that's failing.

Related