Re: microcontroller for simple audio project

From: Mark Borgerson (mborgerson_at_comcast.net)
Date: 02/02/05


Date: Wed, 2 Feb 2005 13:09:46 -0800

In article <1107376351.002612.227710@c13g2000cwb.googlegroups.com>,
ethan.bordeaux@gmail.com says...
> i've thought about this, but am concerned about MIPS and power
> consumption. any idea on the processor overhead to implement this? is
> this something that could be implemented with PWM or a typical uC timer
> allowing for very low overhead? i want as many cycles as possible to
> calculate new outputs, so i'd rather not be stuck shifting bits. an
> onboard parallel DAC seems like the easy choice, but since i'm trying
> to be very cheap, i might not have the luxury of going the easy route!
>
>
Yes, this chore is something that many MCUs with a hardware PWM
capability could handle. Changing the output voltage then becomes a
matter of storing the new value in a register.

The output sample rate is then limited by the timer clock rate and
the number of bits resolution. For a timer with an 8MHz clock and
8 bits output resolution, the PWM period is 256 cycles, or
about 31,250 steps per second. That, and the acceptable
distortion, will limit your maximum output frequency.

If you only need 5KHz output response, you could use a
slower clock speed or more bits of resolution. The PWM
generation will probably not be the limiting factor in
determining your maximum frequency. It will take only
a microsecond or two to adjust the output. You still
have to calculate the next output before the next
output sampling point.

Mark Borgerson



Relevant Pages

  • Re: Minimum Oscillator Frequency
    ... On each PWM period, the output will be high for a certain time T, and low for the rest of the period, or Ts-T. ... You could implement it with a DDS (to generate the sine samples) which outputs a sample every Ts. ... Then using a main clock, of frequency Fc, you decrement this counter. ... Now using the minimum and maximum duty cycle specs of your class-D amp, you can determine that your sine samples should be between 2% and 98% of 200, this means 4 and 196. ...
    (comp.arch.fpga)
  • Re: Microcontroller issue
    ... On 07/14/2010 10:49 AM, Jim Thompson wrote: ... You can play fractional-N aka noise shaping games to increase PWM ... resolution. ... You also generally need more than eight bits of output resolution for good control -- but the "good control" bits can use the plant to average out a dithered 8-bit signal, so you can use a sigma-delta technique either at the loop's update rate or at the PWM's update rate. ...
    (sci.electronics.design)
  • Re: Programmable pulse generator
    ... the user to enter the pulse width and rep rate. ... cycle of the divided clock isn't 50% and I still don't know how to ... from the uC PWM, and then stop, and hold until the next trigger edge, after NNN clock cycles. ... Setup an edge detector from the PWM, and The JK FF is set on this, the same one-clock pulse does the SyncLoad of the 160s. ...
    (comp.arch.fpga)
  • Re: Recommendation for Digital to Analog Converter
    ... Voltage output ... Two reference voltages - output is linearly scaled such that [0, ... lines for PWM to be ran through a unity gain for buffering? ... The resolution is as good as the timer you're using. ...
    (sci.electronics.components)
  • Re: Microcontroller issue
    ... On 07/14/2010 05:47 PM, Jim Thompson wrote: ... You can play fractional-N aka noise shaping games to increase PWM ... resolution. ... "Applied Control Theory for Embedded Systems" was written for you. ...
    (sci.electronics.design)