|
From: | Marlin Unruh |
Subject: | Re: [avr-gcc-list] sine wave generator. ~~~ |
Date: | Fri, 26 Jul 2002 06:35:54 -0600 |
Peter,The R2R ladder network was one thing I was thinking about. Then use a lookup table of values to place on the port connected to the R2R network at a given time duration. This may be the solution.
I was also wandering if I could use the SPI output pin and shift out bit patterns and run them through a RC filter. If you sent out a series of zeros the voltage would go to ground, or a series of ones the voltage would go to VCC. If you keep shifting out 10101010 thru the RC filter the voltage would go to VCC/2, with some ripple. The RC filter would need to be matched to the clock rate on the SPI MOSI pin. This may not take that much overhead for the processor depending on the clock rate of the SPI. I would use the SPI data register empty interrupt to feed the SPI data register.
Does that sound stupid? Although for me it would cause some problem because I need the SPI port to communicate with another micro controller on the same PCB. I will have to think about it.
Thanks again. :-) Marlin At 07:41 AM 7/26/2002 +0200, you wrote:
How about this: http://www.myplace.nu/avr/minidds/ Always been meaning to try it out :-) >>> Marlin Unruh <address@hidden> 07/26/02 03:51AM >>> Hi, I am needing to generate a sine wave using an AVR. The sine wave needs to change in frequency between 1500Hz to 5500Hz approx. Is there a mostly digital solution? I could use an AVR that basically had nothing else to do but read a port as input and generate the sine wave. Using a resistor and capacitor on the PWM output for a wave shaper really wouldn't work because the frequency isn't constant. Right? I have several ideas,but think I am making it more complex that it really is. I hope I'm not abusing this forum with this question! Any pointers would be appreciated. Marlin avr-gcc-list at http://avr1.org avr-gcc-list at http://avr1.org
avr-gcc-list at http://avr1.org
[Prev in Thread] | Current Thread | [Next in Thread] |