LEDC Output Value - Register Access
Posted: Mon Dec 02, 2019 11:54 am
Hi,
In my project I need to be able to read the current output state of a PWM pin (configured using LEDC). I've looked through the datasheet and can't seem to find a register which holds this value.
I'd like to avoid a digitalRead as I'm running a time critical loop, and want this to be programmatically as efficient as possible. I've also had very mixed results with using a hardware interrupt, which triggers spuriously when the PWM signal is at 0 V. As such, directly accessing the value within the registers of the device is preferable to looping the signal back round to an input.
Does anybody know if this is possible?
Thanks in advance.
In my project I need to be able to read the current output state of a PWM pin (configured using LEDC). I've looked through the datasheet and can't seem to find a register which holds this value.
I'd like to avoid a digitalRead as I'm running a time critical loop, and want this to be programmatically as efficient as possible. I've also had very mixed results with using a hardware interrupt, which triggers spuriously when the PWM signal is at 0 V. As such, directly accessing the value within the registers of the device is preferable to looping the signal back round to an input.
Does anybody know if this is possible?
Thanks in advance.