I'm playing around with sigma-delat ADC and DAC for audio. It's amazing how good this works without any active components. Just Rs and Cs. The question now is: Can I hook a speaker direct to the output pins of an FPGA? The idea is to omit any passive components as the speaker acts as low-pass filter and to use two pins, feeding one with the inverted sigma-delta stream (or PDM), to build a bridge amplifier (class D?). With 3V3 output swing this should result (on an 8 Ohm speaker) in an output power of: Peff = Ueff^2/R = (Up/sqrt(2))^2/R = = (3.3V/2*sqrt(2)/sqrt(2))^2/8Ohm = 340mW First question: Is the multiplication with sqrt(2) correct? The idea is that it is a class D amplifier with rectangular output resulting in a sine wave that is sqrt(2) times higher than Up of the square wave. Second question: Is the inductive load from the speaker an issue for the output drivers? Martin
Direct audio output from FPGA pins
Started by ●June 30, 2005
Reply by ●June 30, 20052005-06-30
On Thu, 30 Jun 2005 14:52:21 -0700, Martin Schoeberl wrote:> I'm playing around with sigma-delat ADC and DAC for audio. It's amazing > how good this works without any active components. Just Rs and Cs. > > The question now is: Can I hook a speaker direct to the output pins of > an FPGA? > > The idea is to omit any passive components as the speaker acts as > low-pass filter and to use two pins, feeding one with the inverted > sigma-delta stream (or PDM), to build a bridge amplifier (class D?). > With 3V3 output swing this should result (on an 8 Ohm speaker) in an > output power of: > > Peff = Ueff^2/R = (Up/sqrt(2))^2/R = > = (3.3V/2*sqrt(2)/sqrt(2))^2/8Ohm = 340mW > > First question: Is the multiplication with sqrt(2) correct? The idea is > that it is a class D amplifier with rectangular output resulting in a > sine wave that is sqrt(2) times higher than Up of the square wave. > > Second question: Is the inductive load from the speaker an issue for the > output drivers? > > MartinI think the thing you have forgotten is the output driver resistance (or drive current capability). Peak current would be ~400 mA! Would probably work ok with about 20 outputs in parallel... (or one of those little PMOS/NMOS SOT23 MOSFET pairs) Peter Wallace
Reply by ●June 30, 20052005-06-30
Martin Schoeberl wrote:> I'm playing around with sigma-delat ADC and DAC for audio. It's amazing > how good this works without any active components. Just Rs and Cs. > > The question now is: Can I hook a speaker direct to the output pins of > an FPGA? > > The idea is to omit any passive components as the speaker acts as > low-pass filter and to use two pins, feeding one with the inverted > sigma-delta stream (or PDM), to build a bridge amplifier (class D?). > With 3V3 output swing this should result (on an 8 Ohm speaker) in an > output power of: > > Peff = Ueff^2/R = (Up/sqrt(2))^2/R = > = (3.3V/2*sqrt(2)/sqrt(2))^2/8Ohm = 340mW > > First question: Is the multiplication with sqrt(2) correct? The idea > is that it is a class D amplifier with rectangular output resulting > in a sine wave that is sqrt(2) times higher than Up of the square wave. > > Second question: Is the inductive load from the speaker an issue for > the output drivers? > > MartinTI have a range of Class D amplifiers, so their data gives good info on Filterless Class D. You are pushing things a little doing this straight into the FPGA [ I hope it's a cheap one :) ] If you work 3.3V / 8 Ohms, that's 412mA, into a bridge load, you are asking for - from a single IO pin.... ?! Possibly on a whole port/bridge side ? -jg
Reply by ●June 30, 20052005-06-30
So you would have one pin driving a High into the 8 Ohm speaker, while the other pin sinks a Low. No pin would ever be negative, but you have the drive impedance plus the sink impedance in series with the speaker. Each of the three might be around 8 Ohm, for a total of 24 Ohm, and a peak current closer to 100 mA. If you pick the strongest output standard, you still will have limited aplitude. I agree with the suggestion of a low-cost Clas-D amplifier instead. Peter Alfke
Reply by ●July 1, 20052005-07-01
> So you would have one pin driving a High into the 8 Ohm speaker, while > the other pin sinks a Low. > No pin would ever be negative, but you have the drive impedance plus > the sink impedance in series with the speaker. Each of the three might > be around 8 Ohm, for a total of 24 Ohm, and a peak current closer to > 100 mA. > If you pick the strongest output standard, you still will have limited > aplitude. > I agree with the suggestion of a low-cost Clas-D amplifier instead.OK, I forgot the output resistance. So let's suppose Imax of 100mA: Peff = (Imax/2)^2*R = 20mW That's perhaps enough for a head phone. However, the question if I will burn my FPGA still remains. Two issues: The maximum current: There is no maximum rating in the data sheet of the Spartan-3, in the Cyclone data sheet the absoulte maximum rating is 25mA. The second: A speaker is an inductive load. When we switch the output the energy stored in the L will still drive the current resulting in high voltage peaks until the 'current finds it's way'. Will this damage the output driver? Shall I use external diodes to VCC and GND like the self-induction recuperation diode used on a relay? Martin
Reply by ●July 1, 20052005-07-01
"Martin Schoeberl" <mschoebe@mail.tuwien.ac.at> wrote in message news:42c51713$0$12384$3b214f66@tunews.univie.ac.at...> > However, the question if I will burn my FPGA still remains. Two issues: > The maximum current: There is no maximum rating in the data sheet of > the Spartan-3, in the Cyclone data sheet the absoulte maximum rating is > 25mA. >I used most of the Xilinx FPGAs over the years, and never broke any of them with a short to ground or Vcco. They just warm up a bit!> > The second: A speaker is an inductive load. When we switch the output > the energy stored in the L will still drive the current resulting in > high voltage peaks until the 'current finds it's way'. Will this damage > the output driver? Shall I use external diodes to VCC and GND like > the self-induction recuperation diode used on a relay? >Provided you never tri-state the output pins, there's always a path for the current. However, as you switch, this happens:- Immediately before switching Output_1 => Vout1 --this one is driving high Output_2 => Vout2 --this one is driving low Immediately after switching (current in speaker remains constant) Output_1 => -Vout2 --this one now driving low Output_2 => 2Vcco - Vout1 --this one now driving high Where Vcco is the IO supply. This assumes that the output resistance of the positive driving and negative driving IO pins stays constant with voltage. You could simulate with (or just read) the IBIS files to get exact answers. So, I reckon an 8 ohm speaker is gonna break your pins, unless you use a awful lot of them so that Rout << 8 ohms. HTH, Syms.
Reply by ●July 1, 20052005-07-01
Martin Schoeberl wrote:> I'm playing around with sigma-delat ADC and DAC for audio. It's amazing > how good this works without any active components. Just Rs and Cs. > > The question now is: Can I hook a speaker direct to the output pins of > an FPGA?FWIW, we did a pattern generator based on an FPGA. Some of the outputs ran through RS-422 drivers. As a goofy test, we cooked up a pattern that would use PWM to play music through the diff output. We used caps between the diff driver and the speaker as a DC block. It sounded like an AM radio, but it worked. -a
Reply by ●July 1, 20052005-07-01
No need for capacitors if your digital signal is dc-balanced, i.e. on average the same length of time High as Low. That's the beauty of the bridge output. Peter Alfke Andy Peters wrote:> Martin Schoeberl wrote: > > I'm playing around with sigma-delat ADC and DAC for audio. It's amazing > > how good this works without any active components. Just Rs and Cs. > > > > The question now is: Can I hook a speaker direct to the output pins of > > an FPGA? > > FWIW, we did a pattern generator based on an FPGA. Some of the outputs > ran through RS-422 drivers. As a goofy test, we cooked up a pattern > that would use PWM to play music through the diff output. We used caps > between the diff driver and the speaker as a DC block. > > It sounded like an AM radio, but it worked. > > -a
Reply by ●July 1, 20052005-07-01
Martin Schoeberl (mschoebe@mail.tuwien.ac.at) wrote: : I'm playing around with sigma-delat ADC and DAC for audio. It's amazing : how good this works without any active components. Just Rs and Cs. : The question now is: Can I hook a speaker direct to the output pins of : an FPGA? Others have commented on the mismatched driver and speaker resistance which will limit power transfer - you might get better results from a single raw IO pin using a piezo sounder, as found in 'novelty' cards and crystal earpieces - I don't have any numbers to hand but I'm guessing these will have a higher capacitance, lower inductance and higher resistance, so will still provide low pass filtering, but will represent better power transfer from the FPGA. After all you can build an AM reciever using one of these that is audiable where the only powre source is 15 meters antanna wire... --- cds
Reply by ●July 7, 20052005-07-07
Martin Schoeberl wrote:>I'm playing around with sigma-delat ADC and DAC for audio. It's amazing >how good this works without any active components. Just Rs and Cs. > >The sigma-delta works really well, and the faster you clock it the more equivalent bits you get. You'll have to parallel a bunch of pins to get enough drive for an 8 ohm speaker, and you'll still end up with a sizable loss due to the driver impedance. You could add a simple transistor stage to each pin to boost the current up and still keep the parts count low. The sigma-delta will drive a 600 ohm headset with no problem (I did that with the shortwave radio demo shown on my website). You can also drive a set of powered PC speakers through a single pin. -- --Ray Andraka, P.E. President, the Andraka Consulting Group, Inc. 401/884-7930 Fax 401/884-7950 email ray@andraka.com http://www.andraka.com "They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759






