please dont rip this site

PIC Microcontoller IO Routines

Pulse Width Modulation

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.6

See also: http://www.piclist.com/postbot.asp?by=time&id=piclist/2000/08/07/143402a

Questions:


file: /Techref/microchip/pwmrescalc.htm, 2KB, , updated: 2006/9/21 16:00, local time: 2024/10/31 18:02,
TOP NEW HELP FIND: 
3.144.17.43:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 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?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://sxlist.com/techref/microchip/pwmrescalc.htm"> How much PWM resolution can be achived given a prescaler setting and clock speed in a PIC cpu.</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to sxlist.com!


Site supported by
sales, advertizing,
& kind contributors
just like you!

Please don't rip/copy
(here's why

Copies of the site on CD
are available at minimal cost.
 

Welcome to sxlist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .