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 15:00, local time: 2019/2/18 15:44,
TOP NEW HELP FIND: 
52.23.192.92:LOG IN

 ©2019 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://www.piclist.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 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?

  PICList 2019 contributors:
o List host: MIT, Site host massmind.org, Top posters @20190218 David Van Horn, RussellMc, Neil, AB Pearce - UKRI STFC, James Cameron, Allen Mulvey, David C Brown, Denny Esterline, mike brown, Bob Blick,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
 

Welcome to www.piclist.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .