Bob Bullock of Western Support Group Ltd. says:
In my previous post I mentioned the formula in the manual to calculate the maximum PWM resolution (in bits) for a given PWM frequency appeared to be accurate only for a prescaler setting of 1:1. I did confirm this. These three combinations of PR2 and prescaler settings all have the same PWM frequency, but require a different value for CCPR1L for a 50% duty cycle and therefore have different max PWM resolutions.PR2 prescaler CCPR1L duty cycle 255 1:1 128 50% 64 1:4 32 50% 16 1:16 8 50%The corrected formula that takes into account the prescaler setting should be:
bits resolution = LOG(Fosc / (Fpwm * (Timer2 prescaler value))) / LOG(2)the lowest 2 bits are the two bits in CCP1CON
Dan Michaels from Oricom says:
------- PWM --------- xtal 10-bit 8-bit 20 Mhz 19.53 Khz 78.12 Khz 10 9.7 39.06 8 7.8 31.2 5 4.9 19.53 4 3.9 15.6See also: http://www.piclist.com/postbot.asp?by=time&id=piclist/2000/08/07/143402a
Questions:
file: /Techref/microchip/pwmrescalc.htm, NaNKB (1 imgs) in 0.09s is NaNKBps, updated: 2006/9/21 16:00, local time: 2025/4/21 02:30,
3.15.219.78:LOG IN
|
©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://massmind.ecomorder.com/techref/microchip/pwmrescalc.htm"> How much PWM resolution can be achived given a prescaler setting and clock speed in a PIC cpu.</A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to massmind.ecomorder.com! |
.