What is the lowest PWM freq. possible?

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

:roll:

Thanks.

8)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

not entirely sure, but i think you can daisy chain timers to get the wanted effect. letting the output of first timer be the input of the second. this way you can adjust frequency on the first timer, and duty cycle on the second. you should use the 16 bit timer for the frequency.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A 1.6mhz AVR with a 1024 clock divider using a 50% duty cycle, will have a frequency of about 6 hertz.

-Curiosity may have killed the cat
-But that's why they have nine lives

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RoBSki! wrote:
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:

Just set your output pin high, and wait..

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

Alan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

20-20k sounds like audio testing. You need to generate a fairly clean sine wave? You can geberate a very lo distortion sine wave with a 12 or 14 bit dac... but counting up 14 bits and back down at 20khz is tough. Maybe 8 bits? Using the 'phase accumulator' technique where you increment a pointer into a sin table every N samples.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.