I want to connect a speaker to a 5LP device. In the past, I used a simple buzzer feeded with square wave signal to generate sounds (was quite good enough to play simple melodies). This time I want to have something like a 'real DDS device', capable of playing at least square, triangle, sawtooth, sine, etc. (in general let's say the 'basic' waveforms...).
Of course, I'd also be glad if the result of the project would be something like a 'real soundcard' device (e.g. playing 8-bit recorded sounds or something like MIDI sounds).
In fact it's my first project with heavy 'analog load' from my current point of view...
So, the first questions are about the speaker drive circuit and its performance. I see two ways:
1) use the WAVDAC component with dynamic waveform tables
2) use a class-D amplifier approach with PWM output (dual output? )
For both approaches, I'd connect the OpAmps as a impedance converter (unity gain buffer) due to the 25mA sink/source capability. In case of the WAVDAC approach, one OpAmp needs to invert the waveform.
So, which drive circuit and its control would be more efficient?
I've already implemented a sine output generator with variable frequency by the WAVDAC component. Here, the WAVDAC component gets a varying input clock from a timer. Practical limitation with a 200 sample waveform was about 500 Hz output with 1Hz resolution. So this approach doesn't seem to be useful for this project due to the audible range up to ~20kHz (my target range is about ~5kHz).
I've no experience with the DDS approach. As far as I understand, DDS would be the same as my WAVDAC implementation, but instead of increasing the frequency of the DAC output, some of the output values would be skipped to get a higher frequency, right?
So, regarding performance, which approach uses less CPU ressources and/or gives better results?
From my understanding, both the DAC and the class-D amplifier approach can be used with DDS.
And how to design the corresponding speaker circuit? For both output circuits, I'd place diodes to VDD/VSS close to the speaker to ensure that there's no overvoltage damaging the 5LP due to the inductive load. Also I'd place series resistors to keep the maximum current within +-25mA.
For the class-D amplifier circuit, I wonder if it's possible to realize the low-pass filter directly with the OpAmps, since this would give a better filter than a simple L-C combination.
Any help appreciated 😃
Solved! Go to Solution.
Check this thread also:
It has some "synth oscillator" project which may be of interest (unchecked). Audible sounds in 5 kHz range can be generated with much flexibility using CPU only, but most of processor clock will be spared in the process.
As to what is more efficient: 8-bit VDAC or PWM/PRS, for 5-kHz sound output it probably does not matter. Use stock D-class amplifier like PAM8403 to amplify PSoC output.
thank you for those links. I'll use the DDS component, it looks promising 😃