Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By urbanze
#71909 Recently, I tested pwm (LED PWM) on ESP32, and got amazing results.

Theoretically this PWM is the base of 80MHz, so the maximum we get would be 40MHz.

I was testing the PWM with X bits up to the maximum frequency, I honestly did not expect it to reach 4MHz. However, I was able to reach 40MHz (but with 1bit resolution).

Table of data for maximum frequency with resolution X:

10b = ~78kHz
08b = 300kHz
06b = 1.25MHz
04b = 5MHz
02b = 20MHz
01b = 40MHz

Note: ESP8266 did not exceed 6.6MHz with 1b and 250kHz to all others resolutions

Here, some images of test with 8MHz, 18MHz and 20MHz. (2bit, 50% duty)
Image
Image
Image
User avatar
By @pUnto
#72619

try to use OS_TIMER_US, i tested and works! find in google how to active OS_TIMER_US, because is default "disable".. if you can't do this, tell me. i help you!


hi.... i am relatively new to this.... i want high frequency carrier signal for my project (say 4Mhz or 1Mhz etc) i have searched os_timer_us and but cant figure out how to generate the signal. in anutshell, sai i want to generate a triangular wave of 1Mhz or 4Mhz . It would be very helpful. Thank you.