Searching \ for '[PIC]: Lowest frequency with PWM module' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=pwm
Search entire site for: 'Lowest frequency with PWM module'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Lowest frequency with PWM module'
2002\06\08@134831 by Andy Shaw

flavicon
face
Hi,
What is the lowest frequency you can get using the PWM module (on say an
16F877 with 4MHz xtal)? From looking at the docs it seems to me it is
1000000/16/256  which is approx 244Hz. Is this correct I've been thinking of
using the PWM module to generate a standard R/C servo control pulse but this
has a frequency of 50Hz. I've not really used the PWM module before so just
exploring options at the moment. Failing this any other ways of using the
hardware to generate the pulse train. I've used the CCP module to do it but
that still involves code to start the process off every 20ms or so.

Thanks

Andy

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\06\08@160624 by M. Adam Davis

flavicon
face
PWM period = [(PR) + 1] * 4 * TOSC * (TMR2 prescale value)

The maximum is when PR and TMR2 prescaler are at their highest values:
Longest PWM Period = [1023 + 1] * 4 * [ 1 / 4,000,000 ] * 16

Which is a period of 0.016384, and a frequency of 61.035.  Should be
just fine for servo use.

Check those equations, though - I've never used the PWM and am just
giving you a hold-over answer until someone who does use them with
servos can answer.  I took this from the f877 data sheet, Page 61.

It may actually be easier to do this with an interrupt anyway - there
are several servo routines out there, and a few multiple servo routines
(need to run 8 servos from one PIC?)

-Adam

Andy Shaw wrote:

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\06\08@173143 by Thomas C. Sefranek

face picon face
Look at the Compare Module.
It's not strictly hardware by at 50 Hz who cares?

On 8 Jun 2002 at 17:41, Andy Shaw wrote:

{Quote hidden}

 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\06\08@181158 by Olin Lathrop

face picon face
> What is the lowest frequency you can get using the PWM module (on say an
> 16F877 with 4MHz xtal)? From looking at the docs it seems to me it is
> 1000000/16/256  which is approx 244Hz. Is this correct

I think so.  I get the same answer.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\06\08@182253 by Olin Lathrop

face picon face
> PWM period = [(PR) + 1] * 4 * TOSC * (TMR2 prescale value)
>
> The maximum is when PR and TMR2 prescaler are at their highest values:
> Longest PWM Period = [1023 + 1] * 4 * [ 1 / 4,000,000 ] * 16

What is "PR" and where did that 1023 come from?  The only thing that fits is
the timer 2 period value, which can cause a divide by 256 at most, not 1024.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2002\06\08@200434 by Jinx

face picon face
> What is the lowest frequency you can get using the PWM module
> (on say an 16F877 with 4MHz xtal)? From looking at the docs it
> seems to me it is 1000000/16/256  which is approx 244Hz

I found exactly that a few weeks ago. To get a low range of PWM
frequencies with an 877 I've had to use a variable R on the osc

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...