Go Down

Topic: ESP8266 PWM Signal frequency (Read 1 time) previous topic - next topic

dinesh4761


Hi,

Greetings!

I have just started development on ESP8266 platform using arduino.
I am trying to generate PWM signal (50% duty cycle) in range of 20KHz to 50KHz.

Till now I am able to generate 20KHz only.
Please note that I have tried with analogWrite, ticker and timer1.

Kindly suggest me proper method to generate PWM signal of desired frequency.

Regards,

Dinesh

dinesh4761

Hi,

Greetings!

I have just started development on ESP8266 platform using arduino.
I am trying to generate PWM signal (50% duty cycle) in range of 20KHz to 50KHz.

Till now I am able to generate 20KHz only.
Please note that I have tried with analogWrite, ticker and timer1.

Kindly suggest me proper method to generate PWM signal of desired frequency.

Regards,

Dinesh

larryd

#2
Feb 13, 2018, 06:19 am Last Edit: Feb 13, 2018, 06:20 am by larryd
No technical PMs.
The last thing you did is where you should start looking.

larryd

#3
Feb 13, 2018, 06:25 am Last Edit: Feb 13, 2018, 06:25 am by larryd
Quote
I am trying to generate PWM signal (50% duty cycle) in range of 20KHz to 50KHz.
50%?   Try tone();

Or

Try the Timer1 library.

Example:
https://github.com/PaulStoffregen/TimerOne/blob/master/examples/FanSpeed/FanSpeed.pde


No technical PMs.
The last thing you did is where you should start looking.

6v6gt

Exactly. But look at analogWriteFreq() for the ESP8266.

Coding Badly


@dinesh4761, do not cross-post.  Threads merged.


PaulRB

I am trying to generate PWM signal (50% duty cycle)
If the duty cycle is always 50% then it is not a "PWM" signal. PWM is short for "Pulse Width Modulated". If the duty cycle is always 50% then there is no modulation. What you meant to say was "FM", Frequency Modulated.

Go Up