rmteo,
No, post 11 doesn't answer the question... it again does not tell me why...
If i wanted 1 MHz pwm frequency and the pwm hardware is 10 bit then i'd have to give the PWM 'chip' a 1024MHz clock frequency...
If i give the PWM 'chip' a 1MHz clock and the resolution is 10bit then i would expect the pwm frequency to be (1,000,000/1024) = 976.5625Hz
Changing the bits based on clock input frequency (i believe your saying) is stupid...
Thats like building a car that will only turn left when the engine RPM is above 6,000 RPM...
If this 'variable' bit resolution is because the PWM hardware in the micro-controller can't keep up above certain speeds then it should be specified as rated upto a certain frequency...
This is how all but one PWM chips that I've previously programmed have worked... the one exception was a royal pain in the ass!
As it is, the frequency that i want is supported at 10 bits (apparently)... while my duty is 8 bit, it's just a few cpu cycles to times it by 4 and then do the PWM 'update'...
oky, so two lots of PR registers... one for 'pules duration' aka duty... the other for 'pulse period' apparently thats frequency... the PWM output frequency should be defined by the input clock divided by the resolution...scalerobotics
I found this helpful, maybe you will as well. It is mostly about the hardware, so it is a good example to understand it better. It was done by a company that makes a C compiler.
http://www.mikroe.com/eng/chapters/v...ntroller/#c3v7
Bookmarks