This is the code for the pwm generator. This code operates at a frequency of 40 kHz with generation, but not exactly 40 kHz. I want to reach frequencies between 300-320 kHz. But it is impossible to enter the values in float type of course. My microcontroller's pwm is 16 bit. Please help me. _________________ @electsoftware
Ttelmah
Joined: 11 Mar 2010 Posts: 19497
Posted: Fri Dec 10, 2021 1:21 am
Key questions.
What Fosc are you running?. From what source?.
If you just want a square wave, look at the NCO, rather than the PWM.
Gives higher resolution at small division ratios.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum