Author Topic: ESP32 Generic Parallel Interface?  (Read 2146 times)

0 Members and 1 Guest are viewing this topic.

Offline blazyTopic starter

  • Newbie
  • Posts: 4
  • Country: at
ESP32 Generic Parallel Interface?
« on: November 04, 2022, 02:14:21 pm »
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 15W

Thanks for any constructive input in advance :)
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 231
  • Country: us
Re: ESP32 Generic Parallel Interface?
« Reply #1 on: November 04, 2022, 04:43:20 pm »
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.

 

Offline blazyTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Re: ESP32 Generic Parallel Interface?
« Reply #2 on: November 04, 2022, 06:10:32 pm »
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) :P
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.
« Last Edit: November 04, 2022, 06:18:27 pm by blazy »
 

Offline globoy

  • Regular Contributor
  • *
  • Posts: 231
  • Country: us
Re: ESP32 Generic Parallel Interface?
« Reply #3 on: November 04, 2022, 07:37:12 pm »
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?
 

Offline blazyTopic starter

  • Newbie
  • Posts: 4
  • Country: at
Re: ESP32 Generic Parallel Interface?
« Reply #4 on: November 04, 2022, 08:16:43 pm »
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.
1631422-0" alt="" class="bbc_img" />
Then write a Flutter app with some basic osci features that shows the waveform and triggers softwareside (hw trigger isnt feasible without an fpga of some sort i suppose).
If that ever happens to work out i can think of adding stuff step for step:
1 Experiment with programmable sample clock to reduce the sample rate to make more use of the 16k samplepoints for when theres a lower freq signal you wouldnt possibly see in 32uSec (16k/500M if im thinking correctly)
2 Maybe (have to research if theres a benefit to it instead of doing it software-side) add vertical offset in the front end
3 Look through lots and lots of application notes, books etc and try to implement a somewhat useable frontend with variable gain, coupling etc
(4) if needed or helpful, ditch the usb port and add BT or Wifi and make it battery powered and a full fledged handheld device

No matter how far i get, anything is better then throwing this little guy away or to leave him in his reel where he looks at me everyday at work through the thin peel-of foil of the reel that kept him seperated from the real world for years ;D
« Last Edit: November 04, 2022, 08:24:57 pm by blazy »
 
The following users thanked this post: globoy

Offline globoy

  • Regular Contributor
  • *
  • Posts: 231
  • Country: us
Re: ESP32 Generic Parallel Interface?
« Reply #5 on: November 04, 2022, 08:53:50 pm »
Quote
No matter how far i get, anything is better then throwing this little guy away or to leave him in his reel where he looks at me everyday at work through the thin peel-of foil of the reel that kept him seperated from the real world for years ;D

Oh 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!

 

Online tooki

  • Super Contributor
  • ***
  • Posts: 12551
  • Country: ch
Re: ESP32 Generic Parallel Interface?
« Reply #6 on: January 08, 2023, 02:12:03 pm »
Take a look at how this project does it: https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA

It uses the LCD interface to control parallel RGB video wall modules.

The ESP32 has peripherals that are very much named for a single use, but are intended for much broader purposes. So don’t get hung up on the names.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf