-->
Page 2 of 4

Re: pwm

PostPosted: Fri May 01, 2015 5:13 am
by Michaelo
Any GPIO can be set up for PWM under software control but that's uses additional memory and process time and in some applications these may be at a premium. Hardware PWM pins have additional registers associated with them, you can basically set things up and forget until you need to change the pulse width...
Mike

Re: pwm

PostPosted: Fri May 01, 2015 5:54 am
by cherowley
Hi Michaelo,

Ah, so are we saying the nodemcu firmware is using software pwm and we are waiting to have hardware pwm on this "arduino" firmware?

Re: pwm

PostPosted: Sat May 02, 2015 9:02 am
by Michaelo
I haven't used nodemcu so I can't say for definite but if it's true that the ESP8266 has one hardware PWM pin, any code offering more must be using software PWM... not that is makes much difference either way... but hardware implementation makes coding simpler...

I'm hoping to following the Arduino ESP development closely, I'm hoping for working examples to verify ADC and PWM operation... we may already have some, haven't check lately and things in the ESP world happen fast...

Mike

Re: pwm

PostPosted: Thu May 07, 2015 4:10 am
by cherowley
Hiya!

I've just noticed on https://github.com/esp8266/Arduino:

" analogRead(A0) reads the value of the ADC channel connected to the TOUT pin.

analogWrite(pin, value) enables software PWM on the given pin. PWM may be used on pins 0 to 15. Call analogWrite(pin, 0) to disable PWM on the pin."

I'm sure this wasn't there before?!

Does this mean pwm is now available? Do I need to upgrade to the version on git (arduino-1.6.1-p1-windows.zip)?

Has it always been available?

My current arduino ide says its 1.6.1 and am also using visual micro.

I tried putting analogwrite into the ide and it accepted and compiled but cannot test it as at work at the moment lol