Re: Generating sound at microcontroller pin using pwm
- From: -jg <Jim.Granville@xxxxxxxxx>
- Date: Thu, 14 May 2009 14:52:49 -0700 (PDT)
On May 15, 12:20 am, Rohit <papakap...@xxxxxxxxx> wrote:
I do not understand this. could you please explain the process to do
this. I do not want to use a DAC.
Can i implement what you are suggesting with just pwm? Currently I am
generating square waves of 50% duty cycle
with different frequencies to produce different notes of keyboard.Do
you mean i must also vary duty cycle of the pulses.
You seem confused on what PWM is - you claimed to be using it, then
state here that you always use 50% ?.
If you want to vary the amplitude, you need other than 50% - Varying
the duty cycle is a cheap way to vary the energy, but it does also
affect the spectrum - if you want to preserve harmonic shape, then you
need an external means of Amplitude control.
In a simple uC, you could use one PWM as a slower DAC for envelope
shape, and a 2nd PWM driving an external SPCO Analog switch, to give
frequency control.
Or, you can just move up in frequency, and use single PWM as a faster
DAC, and use the uC to 'play back'
a recorded waveshape. That will give the best sound-effect quality by
far, and large flash memory really is cheap.
-jg
.
- References:
- Generating sound at microcontroller pin using pwm
- From: Rohit
- Re: Generating sound at microcontroller pin using pwm
- From: Legato
- Re: Generating sound at microcontroller pin using pwm
- From: Rich Webb
- Re: Generating sound at microcontroller pin using pwm
- From: Vladimir Vassilevsky
- Re: Generating sound at microcontroller pin using pwm
- From: Rohit
- Generating sound at microcontroller pin using pwm
- Prev by Date: Re: Searching SBC/DSP board/microcontroller; 4ADC/1kHz/USB Host
- Next by Date: Re: Problem Reading Serial Port (RS485)
- Previous by thread: Re: Generating sound at microcontroller pin using pwm
- Next by thread: Re: Generating sound at microcontroller pin using pwm
- Index(es):
Relevant Pages
|