-->
Page 1 of 1

PWM Performance

PostPosted: Wed Jan 27, 2016 8:06 am
by Vitorbnc
Hi everybody!
I have an ESP-12E and also some doubts. I think it has no hardware pwm,right? And I read from the Arduino core docs that pins can have software pwm, but just at 1kHz. Does it mean servos on ESP8266 will have worst performance than if connected to an Arduino board?

Re: PWM Performance

PostPosted: Wed Jan 27, 2016 4:18 pm
by Barnabybear
Vitorbnc wrote:Hi everybody!
I have an ESP-12E and also some doubts. I think it has no hardware pwm,right? And I read from the Arduino core docs that pins can have software pwm, but just at 1kHz. Does it mean servos on ESP8266 will have worst performance than if connected to an Arduino board?

Hi, use a PCA9685 connected via I2C you can connect 16 steppers, set your own frequency and manage the loding, plus you don't get any jitter. Only £2.50 from China.
http://www.ebay.co.uk/itm/PCA9685-16-Channel-12-bit-PWM-Servo-motor-Driver-I2C-Module-For-Arduino-Robot-P5-/171953485273?hash=item280939f5d9:g:YAMAAOSwVL1WC4VL

Re: PWM Performance

PostPosted: Wed Jan 27, 2016 6:42 pm
by WereCatf
Vitorbnc wrote:I have an ESP-12E and also some doubts. I think it has no hardware pwm,right? And I read from the Arduino core docs that pins can have software pwm, but just at 1kHz. Does it mean servos on ESP8266 will have worst performance than if connected to an Arduino board?


You are correct that it is software-PWM. You can set the PWM-frequency higher or lower if you wish with AnalogWriteFreq(), but if you set it to 10KHz or more you should drop range to 8-bit values to speed the code up, ie. AnalogWriteRange(255). Or you could get an external PWM-driver, like the other commenter suggested, both are viable options depending on your needs.