Esp8266 Pwm 25khz

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
skylin008
Posts: 88
Joined: Wed Mar 11, 2015 6:21 am

Esp8266 Pwm 25khz

Post by skylin008 » Tue Nov 24, 2020 2:42 am

Hello, everyone! Esp8266 only can output the pwm frequency is 1000Hz,I want to control the fan, the pwm frequency needed 25Khz, how can I implementation this function. Thanks!

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: Esp8266 Pwm 25khz

Post by mattyt » Tue Nov 24, 2020 3:11 am

Your best bet would be to use an external chip and control it by I2C.

The ESP8266 has no dedicated hardware to generate a PWM waveform (bit banging is used to achieve the 1KHz rate used by MicroPython) and it will be extremely difficult to achieve that frequency.

The only possibility I can think of would be to create a hack to abuse SPI - which can be clocked at high rates. But I would suggest using an external chip or a different micro.

Post Reply