← index #6945Issue #5965
Related · high · value 4.980
QUERY · ISSUE

ESP8266: PWM glitches when doing DHT measure

openby EddieParisopened 2021-02-21updated 2022-03-30
port-esp8266

When using a PWM channel in parallel of a DHT measure, there can be some glitches on the PWM channel at the measure time. This is because the DHT drivers locks interrupts for accurate protocol timing handling, and the PWM driver relies on these interrupts.

CANDIDATE · ISSUE

ESP8266: PWM glitches on a channel when setting duty on another one (ESP8266)

closedby EddieParisopened 2020-04-24updated 2020-06-10
port-esp8266

When having a PWM channel set on and changing the PWM duty on another channel, the first channel experiences glitches.

This is very visible when driving leds.

This is due to software PWM handling, the toggle between the current timing scheme and the prepared timing scheme can occur anytime.

Solution is to move the switch inside the interrupt when the last timer of the cycle occurs.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied