-->
Page 1 of 14

High Frequency pwm?!

PostPosted: Tue Jun 13, 2017 10:52 am
by urbanze
hello again guys! i make some test's with pwm.. i need to know (for write in tutorial), max frequency on pwm in esp8266.

i try to use TIMER1 in arduino ide, this timer1 and 0 is hardware timer? i know OS_TIMER is software, but timer1 and timer0 function's is for hardware timer if not, how can i use hardware timer? After my test's, max pwm is about 250kHz. I need something about 1-10MHz.

Re: High Frequency pwm?!

PostPosted: Tue Jun 13, 2017 12:22 pm
by rudy
You will need to use new added hardware.

Assume that you have an oscillator frequency of 160MHz. If you have a 8 bit pwm then 160000000/256=625000Hz. That is assuming that the clock is used directly without any prescaling or division.

Re: High Frequency pwm?!

PostPosted: Tue Jun 13, 2017 2:14 pm
by urbanze
rudy wrote:You will need to use new added hardware.

Assume that you have an oscillator frequency of 160MHz. If you have a 8 bit pwm then 160000000/256=625000Hz. That is assuming that the clock is used directly without any prescaling or division.


i used port register manipulation and timer1 with interrupt, just this. it's IMPOSSIBLE to make max 250kHz. arduino with timer can 4-8Mhz, and esp?!

Re: High Frequency pwm?!

PostPosted: Tue Jun 13, 2017 3:03 pm
by rudy