Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] Generating sine waves with PWM

2005-12-05 by MuRaT KaRaDeNiZ

Hello,

There are other choices:
Check the avr tiny series. There are devices with special high speed pwm
peripherals. These micro(s) (I dont remember exact part number) have a
pll clock multiplier built in, just to generate high clock frequency for
this demanding 
peripherals, you get 100khz and more easily.

And there are the at90pwm2, at90pwm3 devices, they have >1mhz DAC
built-in. (beside complex high speed pwm peripherals). I will use these
devices in a few weeks in my thesis project.



Regards.

Murat Karadeniz
http://www.onlinefavbar.com/mukas




-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On
Behalf Of Jim Wagner
Sent: Monday, December 05, 2005 10:09 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] Generating sine waves with PWM


I'm working on a project with similar constraints (even
uses 2200Hz as one of the tones). There are not very many
ways to improve things. 

I am using an 6-bt R-2R DAC driven by six port pins. Since
the DAC output only has small steps in it, the harmonic
content is much lower and the rate and filtering are much
less demanding.

You can add a smoothing filter with more sections (poles).
I am actually using a 6-pole switched-capacitor filter that
is "tuned" according to an external clock (also provided by
the micro). A good filter like this can do wonders. With
such a small number of samples (points) per cycle, a simple 2-pole
active filter just won't hack it.

You can decrease the TOP value (that is, reduce the number
of bits) so that the PWM period is shorter and you can get
more of them in per tone cycle. With such few samples, it
makes little sense to try for a full 8-bits. Every halving
of TOP (from the standard value of 255) drops one
resolution bit and doubles the repetion frequency of the
PWM, doubling the number of samples per tone cycle.

Use the fastest possible main clock (that is, highest
frequency crystal). This will give you the fastest possible
PWM clock and that will give the highest possible PWM repetition rate. 

Not many other choices than these! That is why I chose not
to use PWM for this kind of application.

Jim Wagner

---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------



 
Yahoo! Groups Links

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.