ESP IDF : periodic SPI write of small buffer

alb702
Posts: 10
Joined: Tue Dec 07, 2021 3:31 am

ESP IDF : periodic SPI write of small buffer

Postby alb702 » Wed Apr 24, 2024 9:46 am

Hello.

In our device on ESP32, used output-port extender on shift register. A good method is periodic loading shift register throug SPI interface.
Because on port extender connected also dynamic-leds indication, need to update shift register at period, no more 500 uS. This possible only from timer interrupt.

Transfer data size is 3 or 4 bytes. In fact, at SPI clock 30 MHz transfer time is ~ 1 uS .
But for all SPI transfer functions in ESP-IDF API, execution time is more 17 uS (ESP32-S3 /SPI2 ) .
This is bad for use in timer interrupt handler.

Is existing a ready decision to SPI tansfer without additional waiting, if :

- need only SPI write ;
- no need any queues : only one SPI user, transfer time always less, than period ;
- no need to analyse transfer result : transfer is periodic ;
- no need DMA : small transfer data size

?

Who is online

Users browsing this forum: irahul and 64 guests