ESP32 signal capture and replay

Job ID: 32521994

Budget: $30 – $250 USD

I have a need for capturing a single I/O pin on a ESP32. Think of this as a single channel (digital) logic analyzer capture. The signal will always have a 1000ns low pulse followed by a variable length high period, before the start of the same 1000ns low pulse again. I need to know the low-to-low time, which will always be between 1800ns and 20000ns. I need to capture the duration at a 25ns (40MHz) or 50ns (20MHz) capture resolution, storing that time as a 16 bit value in RAM preferably to local RAM using DMA. However, a basic interrupt handler could do this as well.

I also need to be able to "replay" the same captured data by using the 16 bit values from RAM and having the same 1000ns low pulse followed by the remainder high output on a different GPIO pin.

This code must work with both the standard ESP32 and the ESP32-S2. I need this compatible with the standard Arduino IDE.
Related categories: C Programming Arduino Firmware