I am using the ESP32-S3 on a custom designed board. I generate a periodic interrupt with the General Purpose Timer. The frequency is up to 38 kHz (every 26 µs). Within the ISR I would like to push out data with octal SPI. I am using the SPI Master Driver.
I am struggling with getting SPI to work within the ISR at all. It works well in the main loop, but not within the timer generated ISR. What could be the reason?
Furthermore, it looks like the SPI controller is very slow. It takes about 10µs, until data transfer starts. The latency is not constant and varies widely.
What is the reason for the slow response? Is there a way to speed up reaction time significantly?
fast SPI transfer in periodic ISR
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: fast SPI transfer in periodic ISR
You can't do too much in an ISR, specifically not any blocking function. The FreeRTOS way to do this would be to use an inter-task communication method (e.g. a semaphore or task notification) to unblock a high-priority task that then does the sending.
The SPI driver is written for universality and data throughput, not latency - but you can try polling requests and acquiring the bus permanently if you want to try getting the latency down.
The SPI driver is written for universality and data throughput, not latency - but you can try polling requests and acquiring the bus permanently if you want to try getting the latency down.
Who is online
Users browsing this forum: Google [Bot] and 106 guests