ESP32-S3 : Use of SPI in slave mode without CS line. Is it possible ?
Posted: Fri Mar 31, 2023 6:44 am
Good morning,
I am working on a ESP32-S3 microcontroller and I need to implement the following feature.
I have an external component that generates a 4000Hz Clock and sends datas on the Rising Edge of the Clock on another
line (Let's say DATA line).
I need to latch the DATA bits on the rising edges of the Clock using the ESP32-S3 but I don't want to do this using interrupts
on the CLK signal because the period is 250us. Every 250us, I would have an interrupt in my program and because I
have a lot of processes to do, I fear this might disturb the processes.
I see that this is typically what SPI in slave mode can do (Except the fact that there is no CS line in our case).
Using the SPI Slave driver, I wanted to get the datas on the DATA line on the rising edges of the CLOCK.
However, because I have no CS line, it seems that the :
err = spi_slave_transmit(SPI2_HOST, &Transaction, portMAX_DELAY);
never exits.
The driver does not seem to understand that a transaction occur.
So my question is the following. Is it possible to use the SPI driver in Slave mode without the use of a CS line ?
If the answer is no, is it possible to use the SPI in Slave mode without the driver and without the CS line and how ?
Do you have another idea please ?
Thank you for your help on the subject,
Best regards,
Thomas TRUILHE
I am working on a ESP32-S3 microcontroller and I need to implement the following feature.
I have an external component that generates a 4000Hz Clock and sends datas on the Rising Edge of the Clock on another
line (Let's say DATA line).
I need to latch the DATA bits on the rising edges of the Clock using the ESP32-S3 but I don't want to do this using interrupts
on the CLK signal because the period is 250us. Every 250us, I would have an interrupt in my program and because I
have a lot of processes to do, I fear this might disturb the processes.
I see that this is typically what SPI in slave mode can do (Except the fact that there is no CS line in our case).
Using the SPI Slave driver, I wanted to get the datas on the DATA line on the rising edges of the CLOCK.
However, because I have no CS line, it seems that the :
err = spi_slave_transmit(SPI2_HOST, &Transaction, portMAX_DELAY);
never exits.
The driver does not seem to understand that a transaction occur.
So my question is the following. Is it possible to use the SPI driver in Slave mode without the use of a CS line ?
If the answer is no, is it possible to use the SPI in Slave mode without the driver and without the CS line and how ?
Do you have another idea please ?
Thank you for your help on the subject,
Best regards,
Thomas TRUILHE