Page 1 of 1

LEDC triggers ADC

Posted: Fri Oct 27, 2017 10:56 pm
by ardiehl
I'm not sure if it is possible with the ESP32 (using esp-idf):

i need to create a 1 KHZ pulse with variable duty cycle, should be easy using ledc. However, i need to measure a voltage (8 bit resolution would be ok) at the high time of the cycle. I could simply connect 2 pins to generate an interrupt at the start of each cycle, but:
Is it possible to measure a voltage from within an interrupt routine ?
Would the timing allow me to measure the voltage, lets say, for a 10% duty cycle ?

Thx