hi, can someone tell me the highest pwm frequency does a arduino uno can have?
i am trying to set the pwm to 10us period of time. all i can find online is that they are set to 62.5Khz max. it is possible for 100Khz with 1024 resoltuion?
possible for 100Khz with 1024 resoltuion?
No.
The highest frequency you can get with 1024bit resolution would be 16MHz/1024.
About 16kHz.
So a 100khz is about 160 resolution?
Is there any arduino thay can generate pwm more than a hundred kilo hertz with minimum 512 resolution?
Nope. You can get something around there on a tiny85, but resolution is poor.
Clock from PLL 64MHz, that's 640 counts. Prescale of 2 leave 320 counts, no good. Prescale of 4 leaves 160 counts. If you could tweak OSCCAL far enough to get the RC oscillator down to 6.4MHz (not sure you can get it down that far), the PLL would be 51.2MHz, prescale by 2 to get 256 counts per cycle, so you'd have the full 8-bit (256) resolution.
Might be able to get resolution of 640 out of a tiny861 since that's a 10-bit timer (and it also has the high-speed timer and 64MHz PLL to clock the timer from)
Those are the only AVRs I know of with the high speed timer - other chips the best you can do is clock off system clock, 16MHz, 20 if you use a 20MHz crystal instead of 16MHz, while your timer needs to be counting at 102.4 MHz to get 10 bits of accuracy, 51.2 to get 8 bits.
This suggests that you need a much fancier microcontroller than this, or an external chip to generate the PWM.
I must wonder what you're planning to PWM at 100kHz? Particularly if you're switching a MOSFET, because if you are, you will also need a gate driver to make it switch that fast.
jumpin:
So a 100khz is about 160 resolution?
Is there any arduino thay can generate pwm more than a hundred kilo hertz with minimum 512 resolution?
Arduino DUE.
In addition to the Arduino Due, the SAMD21 used on the Arduino Zero and MKR boards is also capable of 100kHz PWM at 9.9-bit (960) resolution.
Although the SAMD21 only operates at 48MHz, its TCC timers are capable of being driven by its on-chip Digital Phase Locked Loop (DPLL) at up to 96MHz.
Adafruit's Arduino compatible, 120MHz SAMD51 based M4 boards also have TCC and TC timers are able to meet your criteria, with most able to operate at 200MHz.
If you use the SAMD21 or 51, you’ll need the superb information in this thread from MartinL on how to setup the device.
https://forum.arduino.cc/index.php?topic=589655.0
Based on his numbers, the SAMD51 with a 120 MHz clock could provide 10.3 bits of resolution at 100 KHz.