These are chat archives for SmingHub/Sming

Mar 2017
Pieter Hollants
Mar 29 2017 10:54
Greetings. I'm a bit confused by the PWM options. If I see correctly there's the "normal" software PWM (from EspressIf I assume?), Stefan Bruens' "custom" software PWM enabled when compiling with ENABLE_CUSTOM_PWM=1 and then there's hardware PWM? When would I want to pick which one?
Pieter Hollants
Mar 29 2017 20:30
so it seems things are a bit different:
First, there is Sming/SmingCore/DriverPWM.cpp which is used by samples/Basic_PWM -- for this one I can't find minimum and maximum values for analogWrite() defined and what is worse, a simple AnalogWrite(pin, 1) already seems to output a higher mean voltage than the alternatives
Second, there is HardwarePWM, either from the Espressif SDK or, when compiled with ENABLE_CUSTOM_PWM=1, Stefan Bruens' drop-in replacement. For this analogWrite minimum and maximum values are defined and a simple AnalogWrite(pin, 1) works well for me
is it this easy and fair to say that HardwarePWM, in one of the two variants, is "better" than DriverPWM or are there some other differences that might make DriverPWM more suitable?