ESP32 Generic Parallel Interface? - Page 1
Forum section: electronics / general

author: blazy
author_rank: Newbie
timestamp: November 04, 2022, 02:14:21 pm
content: Hey there,i've recently started to have a look at the esp32-s3 and really like its wide variety of peripheral modules, but i still cant make out if you can have some type of generic parallel interface. I've already read about the LCD and camera interface, but i suppose these are only controllable through their libraries which are most likely purpose-built for these (LCD or cam) protocols.Reason for this question is, that i have a spare ad6641 lying around and the price for these makes them too precious to let them decompose themselfs inside their unopened reel. The internal FIFO restricts it from longer sampling with an FPGA and Memory, but possibly opens a new way to make something less power-hungry by using an ESP and potentially use its DMA to stream the data directly over bluetooth or USB for further processing.According to their datasheet, fastest way would be cmos parallel or LVDS at 62.5mhz, second fastest is Sport, while this definitely doesnt seem like an option since the UART of the ESP is limited to 5Mbps, and slowest would be SPI. Therefore i would like to see if theres a way to use the parallel mode without trying to repurpose and adapt the lcd or cam part. I know that the ESP most likely wont be able to get the data off to BT or USB as fast as wanted, but id much rather have the bottleneck on this side, than to already be limited by the adc-esp interface.It seems that this is not really possible since theres no generic clock input for that, but i still wanted to ask here if anyone of you can see a way to make this work or possibly another way to implement a not to power hungry device that streams over BT or USB and gets powered by USB 2.0 or worst case USB-C 15WThanks for any constructive input in advance

author: globoy
author_rank: Frequent Contributor
timestamp: November 04, 2022, 04:43:20 pm
content: I too am excited by the S3. It seems really capable and inexpensive. I have a dev board on my desk but no time yet to play with it.Good news is that the driver source is available, as is a reasonable complete description of the CAM/LCD peripheral so you might be able to roll your own custom driver. The CAM peripheral can take 16-bit data in so you'd just tie the upper 4 bits to zero. You'd turn off the YUV-RGB conversion.Bad news is that there's no way to get the ESP32 to output a 500 MHz clock to source your ADC (max is 40 MHz for 16-bit mode) and it can't handle a 62.5 MHz pixel clock from the ADC (max seems to be 30 MHz). The other thing you'd have to do probably is have external circuitry to generate a VSYNC equivalent signal and gate the output of valid data (the peripheral can be configured not to require HSYNC). Of course you'd have to worry about memory. Internal RAM is faster than PSRAM but the S3 now supports an 8-bit interface to the external PSRAM @ 80 MHz which is double the original ESP32. Finally as you mention, the USB OTG peripheral is limited to 12 Mbps so offloading data would be slow. Wifi would be faster. Sadly it looks like they ditched the RMII interface that let the ESP32 talk to an external ethernet PHY for 100 Mpbs networking.Bottom line is that I think it could be possible but it wouldn't be trivial. You'd have to write your own driver. You couldn't run the ADC at the full 500 MHz rate and you'd have to have a little external circuitry (like a small FPGA or other programmable logic) to generate a timing pulse and gate the data.

author: blazy
author_rank: Newbie
timestamp: November 04, 2022, 06:10:32 pm
content: It really seems counterintuitive that they added all these compatible cam/lcd standards but not a more generic parallel interface possibility... but anything is possible since they removed the dac modules (and RMII as you mention)I've searched until the last google page but the only promising looking implementation is a repurpose of the i2s module from someone on github (https://github.com/TobleMiner/esp_i2s_parallel)Anyways, i've got no intention to give myself headaches repurposing smth thats not intended in this way, so i'm probably gonna resort to another Devkit i have lying around and forgot about: The EZ-USB FX3 -> 32 bit parallel GPIF Interface with a max of 100mhz. Should be fast enough to ideally stream it directly to USB so that you dont loose too much time where the fifo is full and get an ideal sample-duty-cycle of 20% which is nice (if nearly achievable) to compensate for the low memory depth of a single sample. If needed i should be able to add an external BT or Wifi module or even another esp32 which just handles the wireless part at a slower pace.Is there any disadvantage if the CLK for the ADC comes directly from a crystal in this case? Its then internally divided by 8 and outputted at the data interface which is then used for this gpif interface of the FX3, which has to be in slave mode to accept clk inputs.

author: globoy
author_rank: Frequent Contributor
timestamp: November 04, 2022, 07:37:12 pm
content: Sorry, I can't give an informed opinion about the clock input without more in-depth spec reading sadly. Seems ok? 500 MHz will take some care I think :-)So what are you planning to measure with your fast ADC?

author: blazy
author_rank: Newbie
timestamp: November 04, 2022, 08:16:43 pm
content: Ideally some sort of USB-scope, but i think given the fact that analog front end of real DSOs are the part that everything revolves around and needs the most development for good behavior, i think i should first be happy to get it working as this specific "Observation Receiver" is intended: ac-coupled 50ohm input with fixed voltage range and a single lowpass.

author: globoy
author_rank: Frequent Contributor
timestamp: November 04, 2022, 08:53:50 pm
content: QuoteOh boy, I think we all know that feeling :-) I just went through a fall cleaning where I got rid of a whole bunch (maybe > 30%) of my electronics stuff but there were some things I just couldn't part with and they went into a "use it up" pile. Devices I want to make a project around someday like you are doing. Good luck!

author: tooki
author_rank: Super Contributor
timestamp: January 08, 2023, 02:12:03 pm
content: Take a look at how this project does it:https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMAIt uses the LCD interface to control parallel RGB video wall modules.The ESP32 has peripherals that are very muchnamedfor a single use, but are intended for much broader purposes. So don’t get hung up on the names.