[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] PWM, to fast!
From: |
Alan Kilian |
Subject: |
Re: [avr-chat] PWM, to fast! |
Date: |
Mon, 06 Jun 2005 11:34:43 -0500 |
> I've just got the hang of PWM (i think) but it turns out that its just
> to fast! I need about 30Hz frequency and to vary the duty cycle from
> full(ish) to about 1/3. The idea is to control the speed of a fan by
> the PWM.
>
> Am i right in thinking: 8MHz / 128prescalar = 62500kHz is the
> slowest PWM I can make?
What AVR processor are you using?
I see the ATMEGA8 has a divide-by 1024 prescaler.
The 8 MHz / prescaler is the counter frequency INTO the PWM
function, so I believe you will get another divide-by 256 for an
8-bit PWM, and a divide-by 1024 for a 10-bit PWM. (I would need
to read the data sheet for the processor you are using to be
sure.)
What's wrong with a faster-than 30 HZ PWM period?
-Alan
--
- Alan Kilian <kilian(at)bobodyne.com>