Minimum time possible to send 32byte data with NRF24L01 module ?

I've been trying to send fast data with NRF24L01 for a long time. In order for the project to meet its requests, 32bytes of data must be on the Receiver side at a maximum of 400us. I'm currently seeing 424us. The content of the code is as follows:
I init in NRF24L01 "main"
After 10ms, the first data is gone and after that, I send data by looking at the TX_DS bit. Whenever the TX_DS bit is one, I send 32bytes of data again and the transactions are carried out in this way at regular intervals.

This is my init function as you see on the picture above. In order to avoid delays I used shockburst mode instead of enhanced shockburst. 

I didnt use ARC to avoid delays.

My SPI works on 10MHZ and I also see this in SCK pin of NRF24L01.

There is not any switching between RX and TX, When I initialize one of the NRF24L01 as a TX it stays always in TX mode.

My SPI send 1 byte to the NRF24L01 at 2.9us and wait for other 1byte at 650ns (until 32byte)

What should I do to gain 24us? Should I focus on SPI or NRF24L01 initializatin? 

Parents
  • I recommend to get an oscilloscope or logic analyzer so you may measure SPI, CE, and VDD_PA pins. The VDD_PA pin should go high 150us after CE is pulled high, and VDD_PA will stay high during transmission. Typically transmitting 32byte data with 4byte address + 2byte crc @ 2Mbps will take: ((32+4+2)bytes*8bit/byte)/2Mbps= 152us. It's not possible to reduce 150us + 152us, so you will need to look into how to improve the SPI transfer.

    Kenneth

  • What should be done to make SPI faster? I use 10MHZ SPI frequency which is the maximum frequency that NRF24L01 accept. My MCU is PIC18F24K42.

    And Do I have to wait for the TX_DS bit to be 1 to send data again ? Do I have to wait for the time on air to send new data?

    As you calculate the dead time, for about 100us left to reach maximum 400us aim. If we use the maximum SPI frequency that NRF24L01 accept(10MHZ) our SPI speed should be 0.8us/per bytes let me say that as 1us including dead times between bytes. Totally we spend 38*1us + 4us(flush)+4us(reset status) = 46us for SPI. But in reality SPI spend more time than that.

Reply
  • What should be done to make SPI faster? I use 10MHZ SPI frequency which is the maximum frequency that NRF24L01 accept. My MCU is PIC18F24K42.

    And Do I have to wait for the TX_DS bit to be 1 to send data again ? Do I have to wait for the time on air to send new data?

    As you calculate the dead time, for about 100us left to reach maximum 400us aim. If we use the maximum SPI frequency that NRF24L01 accept(10MHZ) our SPI speed should be 0.8us/per bytes let me say that as 1us including dead times between bytes. Totally we spend 38*1us + 4us(flush)+4us(reset status) = 46us for SPI. But in reality SPI spend more time than that.

Children
Related