Chat freely about anything...

User avatar
By FlyingHacker
#21168
tytower wrote:Just to confirm I set up blink on the ESP-12 and 1023 works for me too Thanks FlyingHacker


No worries. Just out of curiosity, which pin(s) were you using for output? Also, which function call? analogWrite()?

Thanks.
User avatar
By tytower
#22943 FlyingHacker-In another thread I have been trying to understand ericsl 's explanation of PWM . He has written a library and states it is the equivalent of a 16 bit PWM . So I clearly have more to learn here and wondered what you thought of his post below . Is it factual ? Does the chip not have any hardware capability ? I don't understand that .If its right, how is the pulse produced ? I mean where is the software that produces it then.

eriksl wrote:Your quoting the wikipedia that is based on an older SDK.

I repeat, the ESP8266 does NOT have any hardware for PWM. The old SDK had a more limited software implementation than the current one. Nothing more nothing less.

It's not really that difficult to implement a software PWM, I've done it myself. Just program the interrupt of a fast enough timer to go when the next PWM GPIO should flip and when the interrupt fires, flip the GPIO and calculate the time to the next PWM GPIO in clock ticks, and program the timer interrupt compare register for that. That's why multiple PWM's can't have duty cycles that are very close together, in the time the compare register is programmed, the timer already reached that point.

The thread is here viewtopic.php?f=11&t=3212&start=30
Last edited by tytower on Fri Jul 10, 2015 3:10 pm, edited 1 time in total.