ESP-Wroom-32D external ADC - SPI or I2C?

RodEnry
Posts: 2
Joined: Tue Feb 25, 2020 9:12 pm

ESP-Wroom-32D external ADC - SPI or I2C?

Postby RodEnry » Tue Feb 25, 2020 9:24 pm

Hello everyone,
I am struggling with a huge problem (for my inexperience)!

I am using a ESP-Wroom-32D ad I'm making my own PCB.
I need to acquire at 1000Hz analog signals form external sensors and I noticed that the ESP32's adc is not very usable for high precision measures. So, I decided to use an external ADC.

At the moment I have connected to the module the following devices:
- SD card through HSPI pins (25MHz)
- Gyroscope sensor through I2C (Wire in 400kHz mode)
- Some button and led to the GPIOs

The main question are: Which is the most convenient way in term of performances to connect the ADC?
1) I2C shared bus (at 400kHz) between the ADC and the gyro?
2) I2C with dedicated SDA and SCL for gyro and other two dedicated SDA and SCL pin for the ADC? (Both at 400kHz)
3)VSPI?


Thank you!
Harry

username
Posts: 539
Joined: Thu May 03, 2018 1:18 pm

Re: ESP-Wroom-32D external ADC - SPI or I2C?

Postby username » Wed Feb 26, 2020 5:23 am

VSPI will be mush, much faster than I2c.

RodEnry
Posts: 2
Joined: Tue Feb 25, 2020 9:12 pm

Re: ESP-Wroom-32D external ADC - SPI or I2C?

Postby RodEnry » Wed Feb 26, 2020 10:37 am

Thank you for the reply.
Using VSPI and HSPI at the same time affects the overall speed of both?

Recently I had an issue. I ran different tasks with SPI SD card and another with gyro I2C. The I2c often returned -1 instead of the correct value. This is was caused by SPI that block the I2C communication. I resolve this issue by pin SD to core 1 and gyro sensor to core 0.
I would avoid that adding VSPI can cause other similar issues

Many thanks
Cheers
Harry

Who is online

Users browsing this forum: No registered users and 118 guests