Go Down

Topic: ESP8266 PWM Signal frequency (Read 3021 times) 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.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

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.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

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