Reducing the latency of Chip Select when issuing continuous SPI command

Hi:

I am attempting to issue frequency change command on a BK5811 device using the RF24 library.
I notice that the latency between each chip select can go up to 15usec.
I would like to reduce the timing to 1usec using an Uno.

Any idea what can be done?

Ben_Tan:
I am attempting to issue frequency change command on a BK5811 device using the RF24 library.

What is a BK5811 and where is the link to its datasheet?
Which RF24 library are you using, where is your code using it?

Ben_Tan:
I notice that the latency between each chip select can go up to 15usec.

Probably some code gets executed between the device accesses, so what?

Ben_Tan:
I would like to reduce the timing to 1usec using an Uno.

Why would you want that?

Ben_Tan:
Any idea what can be done?

Remove any superfluous code between device accesses.

The datasheet https://www.hobbielektronika.hu/forum/getfile.php?id=291458

I am using RadioHead RF24 library.

I am attempting to mimic an existing board to control the chip as such would need to follow its existing performance as close as possible.

The CS latency between the following command to the next is:

nrf24.spiWrite 13.25usec
nrf24.spiBurstWriteRegister 13.75usec
nrf24.spiBurstWriteRegister 12.63usec
nrf24.spiWrite 24.12usec
nrf24.send 15.35usec

The code is attached below:

// nrf24_server.pde
// -- mode: C++ --
// Example sketch showing how to create a simple messageing server
// with the RH_NRF24 class. RH_NRF24 class does not provide for addressing or
// reliability, so you should only use RH_NRF24 if you do not need the higher
// level messaging abilities.
// It is designed to work with the other example nrf24_client
// Tested on Uno with Sparkfun NRF25L01 module
// Tested on Anarduino Mini (Anarduino Mini Details) with RFM73 module
// Tested on Arduino Mega with Sparkfun WRL-00691 NRF25L01 module

#include <SPI.h>
#include <RH_NRF24.h>

// Singleton instance of the radio driver
RH_NRF24 nrf24(7,8); // 7-CE, 8-CSN
// RH_NRF24 nrf24(8, 7); // use this to be electrically compatible with Mirf
// RH_NRF24 nrf24(8, 10);// For Leonardo, need explicit SS pin
// RH_NRF24 nrf24(8, 7); // For RFM73 on Anarduino Mini
byte rx_addr ={0x11,0x22,0x33,0x44,0x03}; // Default rx addr
byte tx_addr ={0x30,0x3B,0x2F,0xCA,0x30}; // Default tx addr
byte fhss_schema={63, 28, 78, 43, 58, 23, 73, 38, 88, 53, 18, 68, 33, 83, 48, 13}; // **** Use this as FHSS

byte payload_data={0x81, 0x0, 0x0, 0x93, 0xA9, 0x68, 0x77, 0x6A, 0x3C, 0x1C, 0x4C, 0x93, 0xA9, 0x68, 0x77, 0x6A, 0x3C, 0x1C, 0x4C, 0x93, 0xA9, 0x68, 0x77, 0x6A, 0x3C, 0x1C, 0x4C, 0x59};

void setup()
{
Serial.begin(115200); //Seems to be the limit for now is 115200 4M
while (!Serial)
; // wait for serial port to connect. Needed for Leonardo only
if (!nrf24.init())
Serial.println(“init failed”);
}

void loop()
{
for (int ptr_fhss_schema = 0; ptr_fhss_schema < sizeof(fhss_schema); ptr_fhss_schema++)
{
nrf24.spiWrite(0x25,fhss_schema[ptr_fhss_schema]);
nrf24.spiBurstWriteRegister(0x2A, rx_addr, sizeof(rx_addr));
nrf24.spiBurstWriteRegister(0x30, tx_addr, sizeof(tx_addr));
nrf24.spiWrite(0x17,0x00);
nrf24.send(payload_data, sizeof(payload_data));
}

}

I never used the RadioHead RF24, never felt the need for additional layers above a driver.

I have no idea what transmission speed you are using, whether dynamic payloads are enabled and what the timeout/retry settings of your NRF24 are, and what the SPI transfer speed is.

I assume you full code uses non-constant payloads, if it is constant it can be resent by the chip directly.

I see no relation between the BK5811 and your program.