Use of either LEDC or general timers for very short (<2us) pulses
Posted: Sat Nov 04, 2023 5:47 pm
Hello!
I have been working with an ESP32-S2 board to create a pretty simple, very low duty cycle (1kHz 0.1% duty or less) pulser. The application for this is to drive a circuit that creates very short high current pulses for testing laser diodes.
The LEDC peripheral works great for creating these pulses, even down to 500ns or less, and the pulse width is easily adjustable on the fly. My issue is that I need something like an interrupt on the falling edge of the pulse to trigger an ADC reading from a current sensor in the circuit (that part of the circuit works fine). I’m having trouble determining if this is possible with the LEDC peripheral.
Anyone able to help me with this? Or is a better solution to implement this using the general purpose timers? My experience is pretty limited when it comes to C and ESP-IDF, so I have not been able to determine for myself what the best path to follow is.
Thanks for any insight.
I have been working with an ESP32-S2 board to create a pretty simple, very low duty cycle (1kHz 0.1% duty or less) pulser. The application for this is to drive a circuit that creates very short high current pulses for testing laser diodes.
The LEDC peripheral works great for creating these pulses, even down to 500ns or less, and the pulse width is easily adjustable on the fly. My issue is that I need something like an interrupt on the falling edge of the pulse to trigger an ADC reading from a current sensor in the circuit (that part of the circuit works fine). I’m having trouble determining if this is possible with the LEDC peripheral.
Anyone able to help me with this? Or is a better solution to implement this using the general purpose timers? My experience is pretty limited when it comes to C and ESP-IDF, so I have not been able to determine for myself what the best path to follow is.
Thanks for any insight.