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
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
February 13, 2018, 5:25am
4
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
6v6gt
February 13, 2018, 8:35am
5
Exactly. But look at analogWriteFreq() for the ESP8266.
@dinesh4761 , do not cross-post. Threads merged.
PaulRB
February 13, 2018, 3:24pm
7
dinesh4761:
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.