Closed Gei0r closed 5 years ago
Thank you for the report. I will have a look at this after new year's.
I took a look into the datasheet myself. As I suspected, the code in turnOffPwm()
only "freezes" the timer comparator, but it does not disable the PWM output driver.
For that, CCiE
/ CCiNE
in CCER
need to be cleared. It's fixed in the referenced pull request.
I have an issue with
analogWrite()
on the stm8blue board. A call toanalogWrite()
with 255 should set the pin constantly toHIGH
(disabling PWM). But that only works sometimes if there was another analog (PWM) value written there before:Exchanging the second
analogWrite()
withdigitalWrite()
doesn't make a difference.It seems that the pin gets "stuck at
LOW
" if the PWM is disabled while the pin is driven low by PWM.Maybe
turnOffPWM()
inwiring_digital.c
is insufficient?