Using the SPI functionality of the ESP32-C3-MINI-1 with both 8-bit and 24-bit Transmit/Recive

Ameboid
Posts: 3
Joined: Wed May 29, 2024 12:55 pm

Using the SPI functionality of the ESP32-C3-MINI-1 with both 8-bit and 24-bit Transmit/Recive

Postby Ameboid » Wed May 29, 2024 1:23 pm

I am currently working on a personal project, and am using I2C, SPI, and I2S for it. This is being built "from the ground up"(At least some of it) with the following IC's and their datasheets, in case any advice one might give could conflict with what I have:

TCA6424ARGJR (I/O Expander in I2C, Code is done)- https://www.ti.com/lit/ds/symlink/tca6424a.pdfts=1716924767361&ref_url=https%253A%252F%252Fwww.google.com%252F

MKDN256GCL (NAND Memory, 256 GBit in SPI, can act like SD)- https://www.sd-nand.com/datasheet/MK%20Nano%20SD%20NAND%20128_256_512GbA%20Datasheet_Commercial%20Grade%2020230906.pdf

FUSB302MPX (USB PD, I2C, working on it)- https://www.onsemi.com/pdf/datasheet/fusb302b-d.pdf

CH280QV10 (LCD, in SPI, provided by Adafruit using ILI9341 Control chip) - https://cdn-shop.adafruit.com/product-files/2770/SPEC-CH280QV10-CT_Rev.D.pdf

CJC4344 (DAC, I2S, working on it) - https://www.lcsc.com/datasheet/lcsc_datasheet_2311101743_ESHINE-CJC4344_C7431492.pdf

AD7789BRMZ (SPI, 24 bit output, 8 bit input) - https://www.analog.com/media/en/technical-documentation/data-sheets/AD7788_7789.pdf

BQ24259RGER (Battery Charger, I2C, done) - https://www.ti.com/lit/ds/symlink/bq24259.pdf

ESP32-C3-MINI-1-N4 (Processor, all pins are used and set up to correct operation, TX/RX are broken out, but not used by any device. the ESP used USB to send and receive data for programming) - https://www.espressif.com/sites/default/files/documentation/esp32-c3-mini-1_datasheet_en.pdf

These are all the parts I used, and I listed them just in case their functionality might conflict with any features. The following is what pins I have everything on:
I2S_DIN = 1, I2S_LRCLK = 9, I2S_MCLK = 10
TFT_CS = 2, TFT_DC = 8, IO_INT_PIN = 4
I2C_SDA = 3
CLK_PIN = 5, SPI_DIN = 6, SPI_DOUT = 7
The CLK_PIN is the clock for all devices on the I2C, SPI, and I2S bus, as only one device with one protocol will be used at a time.

I have looked through the given ESP datasheet and it's associated links for technical documentation, and have found no mention of what SPI pins to use on this module. I had thought of using the QSPI lanes, but quickly realized they were not broken out on this module.

What I can do:
- I can change any pin assignment if needed
- IC's can be changed, although I might not have success in finding a replacement
- Software. I would rather spend time trying to see if something worked and learn rather than be given the answer. I am only asking because I've procrastinated the SPI functionality of the ESP32 for so long

Any help is both wanted and needed, so thank you.

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: Using the SPI functionality of the ESP32-C3-MINI-1 with both 8-bit and 24-bit Transmit/Recive

Postby ESP_Sprite » Thu May 30, 2024 2:48 am

You can route SPI (and I2C, and I2s) to any not otherwise occupied GPIO. However, using one clock pin for all peripherals may be a tad hairy; you might need to mess with the GPIO matrix directly to mux that.

Ameboid
Posts: 3
Joined: Wed May 29, 2024 12:55 pm

Re: Using the SPI functionality of the ESP32-C3-MINI-1 with both 8-bit and 24-bit Transmit/Recive

Postby Ameboid » Thu May 30, 2024 12:13 pm

That is what I already have, but since I have to have the INT pin of the TCA6424 connected to the ESP, the CS and D/C of the LCD must also be connected to the ESP, since I really don't feel like modifying the Adafruit Library to accommodate the change in pins. I could do it, but I would rather not risk breaking something more critical of the library by doing so.

Ameboid
Posts: 3
Joined: Wed May 29, 2024 12:55 pm

Re: Using the SPI functionality of the ESP32-C3-MINI-1 with both 8-bit and 24-bit Transmit/Recive

Postby Ameboid » Thu May 30, 2024 1:46 pm

This might also be the same with I2S, as the general Arduino Library does not support using custom pins.

Who is online

Users browsing this forum: No registered users and 43 guests