I wonder what is the lowest PWM frequency possible for an AVR?

Highest is 500kHz fast PWM, but is there also a slow PWM function (trick)?

:roll:

Author

Message

I wonder what is the lowest PWM frequency possible for an AVR?

Highest is 500kHz fast PWM, but is there also a slow PWM function (trick)?

:roll:

Why there should be a lower limit ?

If the biggest prescaler and resolution was not slow enough, then you have enough time to build the PWM in software.

Also you can slow down the clock frequency, because the AVR work down to 0Hz.

But in practice such very slow PWM was fully useless.

E.g. it make no sense, if a PWM controlled lamp flicker one times per minute.

In general to do some tasks with a certain speed, there is always only an upper limit, but never a lower limit.

Peter

I want a sweep from 20Hz to 20kHz, is this possible with the PWM of the AVR?

:roll:

Thanks.

8)

Highest is 500kHz fast PWM, but is there also a slow PWM function (trick)?:roll:

Just set your output pin high, and wait..

Been over 2 years now, so the answer is at least 4 year period..

Alan

Level: Raving Lunatic

Joined: Sat. Sep 20, 2003

Posts: 6192 View posts

Location: Underneath the Cotswolds escarpment, England.

Quote:

Been over 2 years now, so the answer is at least 4 year period..

Really? What if the duty cycle is set for 99 percent?

I used a phase accumulator once in a DTMF generator. There's practically no lower limit on the frequency you can generate. Rather than drive a DAC, I used a 15-bit phase accumulator (truncated to 8 MSB before the SIN table lookup), and drove an 8-bit PWM. Around 3 KHz, the sine output began to noticeably alias with the PWM.

I did the phase accumulator calculations on each PWM interrupt (IIRC about 30 microseconds).

This was at 8 MHz on a Mega8.