ESP32 as an SPI ADC sampler and Wi-Fi broadcast questions

User avatar
luca.gamma
Posts: 15
Joined: Tue Apr 19, 2016 8:40 pm
Location: Switzerland

ESP32 as an SPI ADC sampler and Wi-Fi broadcast questions

Postby luca.gamma » Tue Nov 08, 2016 10:22 am

I want to port an ESP8266-based (+ host CPU) solution to the ESP32. Currently I have a number (2-4) of high-speed ADCs controlled by a host CPU via SPI using 16-bit data words (hence need 2-4 hardware controlled CSn lines). Samples are then stored to an SD card or transferred via UART to the ESP8266 with a transparent UART-to-WiFi firmware. Now I would like to remove the host CPU and use the ESP32 (actually an ESP-WROOM-32 module) to control the ADCs and stream out raw data directly via a Wi-Fi link using DMA having the Wi-Fi possibly configured as (soft-)AP. The best scenario would be using one core (e.g. CPU0) for continuous ADC sampling and the other core (e.g. CPU1) for continuous data transfer (payload bit rate should be >= 9Mbps!).

My questions:
- Is it possible to configure an SPI (and which one) as a master with 16-bit data word (i.e. assert CS, transfer 16 bit, de-assert CS)?
- Is there any reference on how to configure the SPI registers and use DMA to transfer data to the Wi-Fi stack (TCP/UDP)?

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

Re: ESP32 as an SPI ADC sampler and Wi-Fi broadcast questions

Postby ESP_Sprite » Wed Nov 09, 2016 3:09 am

Yes, it's most definitively possible to transfer in 16 bit of information. We're working on SPI documentation and drivers. Documentation probably will be included in the very next documentation release; the driver is scheduled to go into esp-idf 1.0.

User avatar
luca.gamma
Posts: 15
Joined: Tue Apr 19, 2016 8:40 pm
Location: Switzerland

Re: ESP32 as an SPI ADC sampler and Wi-Fi broadcast questions

Postby luca.gamma » Mon Nov 21, 2016 11:52 am

Thanks for your answer, this sounds very interesting. Do you think it could be possible to have a preview of the SPI driver? While my question is about the timing I would like to be sure that SPI and GPIO are fast enough to control 4 devices (even using 4x GPIOs as chip select).

Who is online

Users browsing this forum: No registered users and 138 guests