555 or FPGA and speakers

Thread Starter

mbird

Joined Jan 29, 2009
35
I was experimenting with getting sound from my FPGA board or from a 555 Timer (so I create a digital circuit that can send out square wave at various frequencies).

The thing I don't understand is this:
My square waves are all zero to 3.3 volts (they are all positive). I run them through a simple NPN transistor to get some amplification (my 555 is 10mA source max) then to the speaker. So is it correct to say then that I am only using half the speaker's ability (so should a speaker be driven from -x to +x rather than 0 to x -- or does it not matter) -- and if it does go -x to +x then how do I go from a 555 that is 0-x to use the full range of the speaker.

Can I drive the speaker directly from the 555 or FPGA or do I need a capacitor in between.

As you can see I am just trying to learn about how to get digital sound to a simple speaker so any links that would help would be greatly appreciated!

Thank you!
 

KL7AJ

Joined Nov 4, 2008
2,229
I was experimenting with getting sound from my FPGA board or from a 555 Timer (so I create a digital circuit that can send out square wave at various frequencies).

The thing I don't understand is this:
My square waves are all zero to 3.3 volts (they are all positive). I run them through a simple NPN transistor to get some amplification (my 555 is 10mA source max) then to the speaker. So is it correct to say then that I am only using half the speaker's ability (so should a speaker be driven from -x to +x rather than 0 to x -- or does it not matter) -- and if it does go -x to +x then how do I go from a 555 that is 0-x to use the full range of the speaker.

Can I drive the speaker directly from the 555 or FPGA or do I need a capacitor in between.

As you can see I am just trying to learn about how to get digital sound to a simple speaker so any links that would help would be greatly appreciated!

Thank you!
One thing you do NOT want to do is directly drive a speaker from any digital device. The speaker impedance is FAR too low...you could fry your chip.

Are you trying to faithfully reproduce the sound of the square wave, or do you just want noise? Wihout feeding the speaker both directions, you can certainly get noise..but if you want to reproduce a complete waveform, you need a bit more.

eric
 

Thread Starter

mbird

Joined Jan 29, 2009
35
One thing you do NOT want to do is directly drive a speaker from any digital device. The speaker impedance is FAR too low...you could fry your chip.

Are you trying to faithfully reproduce the sound of the square wave, or do you just want noise? Wihout feeding the speaker both directions, you can certainly get noise..but if you want to reproduce a complete waveform, you need a bit more.

eric
Mostly I want to just get noise but noise that is meaningful (so I want to say make a 440Hz square wave and be able to hear it as an A).

Later I want to reproduce a complete waveform. I was thinking I would feed the output of my FPGA to a DAC -- is that they way it is done?

Yes, I would not connect the speaker directly, rather I use a simple NPN transistor to amplify the 10-20mA that comes from my 555 or FPGA. In any case I always use a buffer between my FPGA and my breadboard because as you said I don't want to fry my FPGA (Spartan 3 Starter Kit).

Thank you!
 

KL7AJ

Joined Nov 4, 2008
2,229
Mostly I want to just get noise but noise that is meaningful (so I want to say make a 440Hz square wave and be able to hear it as an A).

Later I want to reproduce a complete waveform. I was thinking I would feed the output of my FPGA to a DAC -- is that they way it is done?

Yes, I would not connect the speaker directly, rather I use a simple NPN transistor to amplify the 10-20mA that comes from my 555 or FPGA. In any case I always use a buffer between my FPGA and my breadboard because as you said I don't want to fry my FPGA (Spartan 3 Starter Kit).

Thank you!
I was thinking about getting myself a Spartan kit last year. How do you like it...does it have a lot of good tools?

As far as reproducing audio...yes a DAC can do the trick. Depends on what the digital format is you're using...whether it's PWM or some actual coding.

Eric
 

Thread Starter

mbird

Joined Jan 29, 2009
35
I was thinking about getting myself a Spartan kit last year. How do you like it...does it have a lot of good tools?
Eric
I love the kits from Digilent. Xilinx has the free ISE WebPack software and it is really great!. I got myself an adapter from Technology Arts so I could go from the Spartan board to my breadboard with a ribbon cable. Also, Xilinx has a soft processor called PicoBlaze (KCPSM3) that is free and loads of fun too! (PicoBlaze comes with a UART so I was able to connect my Spartan to my PC via the serial port and send/receiev data.) ISE WebPack is pretty cool even if you don't have a board because it has a schematic and simulator so you can experiment with digital designs.

Enjoy!
 

Wendy

Joined Mar 24, 2008
23,421
Do you want to use a 555 for a tone generator? I know several transistor drivers that will improve its performance.



If you want really loud use a second 555 (or the other half of a 556) configured as a invertor to form a H Bridge.

 
Top