SPI Slave Example code

Hello Everyone,

We are using ESP32C3 module. We have tested the SPI master example code, it was working fine. Now I want to test the SPI slave communication but I didn't find any SPI slave example in Arduino IDE 2.2.1. Can anyone help me.

Thanks & Regards,
D. Vineetha.

This is a good tutorial on SPI Master/Slave

I'm missing several slave items in that tutorial.

The lack of SS handling was already mentioned in a comment.

When to send a byte? If the slave is supposed to transfer the first byte in the first transfer then that byte has to be placed into SPDR before or just when the slave is selected. Subsequent bytes of a multi-byte output have to be put into SPDR in the ISR, after reading the preceding input byte from SPDR. The main loop can not place any other bytes into SPDR until the slave is deselected whereupon the transfer ends.

Nick Gammon on SPI using Arduino IDE.

Yes, it contains SPI slave/client? code.

Can you provide an example of SPI Slave for ESP32C3 module ?

Can you please, post your ESP32 Master SPI sketch?

What is different about SPI ports? Did you even look or try?

There are 3 SPI ports SPI0, SPI1 and SPI2. SPI2 is general purpose SPI.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.