Looking for Audio Circuit

Hello all,

This is my first post here, so please excuse should I not follow accepted protocol on this newsgroup.

My "problem" is several-fold. I'm looking to use a small number of components (cheaper is better) to make a small MPU (8051/8052/avr/pic/etc) drive a speaker and give roughly 5 seconds of "reasonable" audio output to an 8 ohm speaker (small, 3cm in diameter). Oh, and it sorta needs to run off of 2.7v to 3v (two AA batteries).

Unfortunately, while I'm quite comfortable with the digital side of this problem, the "analog" side has me stumped. The question is, what combination of flash memory size (say we go for "16KHz" audio), DAC circuitry, and/or amplification would I need in order to have "human speaker" level of output on such a speaker?

While "single chip" solutions seem to be available (such as the Atmel AT89C51SND2C chip), they seem overkill. Also, it is questionable to me if it will drive my speaker adequately (440 mW amp inside the chip).

I'm sure there are other ways of doing this, but I'm hitting a wall here. Anyone happen to have some pointers as to where I can look for other/more information (what magic incantation do I type into the google search bar?) about the analog/audio side of this? :)

Thank you for any information,

--
 [100~Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax
Reply to
Tobias Weingartner
Loading thread data ...

I think most companies have an application note on something like that. I'm sure that TI does for the MSP-430, as they were demoing just such an application. Or else Softbaugh, who made the demo board TI was giving away. Also, I've seen similar application notes for the Microchip PIC (many years ago.) The others, probably have done something close if not exactly the same.

At least one of these application notes dealt with recording sound, as well. Probably most of them.

It depends. If you just generating a single tone, nothing much at all as it can be generated with a simple algorithm if you want to avoid storage of exact samples. For some things, such as speech, you could consider 4kHz of 8 bit data enough (there are a few "compression" algorithms, very simple in concept, that help a little in dynamic range if you want some slight improvement on 8 bits.) More is better, less is worse. 16kHz would be considered unusually good, I think. I think the phone company may use 8kHz with some algorithms applied, but I really don't know. Also, you could consider LPC predictive coding methods for serious compression of some signals. I haven't used it, but it appears to me to be very good at compressing speech into very few constants from what little I've been exposed.

Many computer speakers specify themselves at 2W. I'd figure that would be more than enough. If you plan to use an 8 ohm speaker, this implies an RMS of 4V, which means even more volts though. At say 2.7V rail, you might expect peak drive voltage swings of 2V or so with some linearity, with the RMS lower than that. My guess is that a 440mW amplifier may be more than you have a right to expect on a 2.7V system and it is probably just fine.

By the way, I've seen some fancy stuff done with the stupid "audio" of a PC speaker, which is roughly just a digital connection to the speaker -- on/off. If you do some math, you can figure out how to drive something that simple and get some reasonable output from it. I think there may be some web sites I've seen in the past discussing the details, but I don't have them handy.

If you want to design your own amplifier, that's one thing. If you want to buy it, that's another. If you can accept a digital control of the voltage on the speaker, that's yet another. If you depend on an external power amplifier, that's another still again. And if you keep it simple in hardware, say digital on/off pulsed control of the speaker, it gets more complex in software. If you keep it simple in software, you need more in hardware.

Look into LPC (linear predictive coding), audio compression, ulaw or mu-law or G.711, go to softbaugh's web site and look for boards they sell which demonstrate audio (they may have pre-built applications to do the job for you and they definitely will have the audio worked out), check out application notes at Texas Instruments for their MSP-430 and at Microchip for their PIC series. There are also play-record chips available at Radio Shack (or were, not so long ago) that do much of the work for you. Etc.

But like you, I'm no expert at this and I'd probably face some of the same thinking you will have to go through if I were doing this. Best of luck.

Jon

Reply to
Jonathan Kirwan

Just for perspective, I have a 2 1/2" speaker scrounged from a PC, and it's got ".25W" stamped on it, so .44 watts is WAY more than enough.

Cheers! Rich

Reply to
Rich Grise

It's surprisingly easy - just time the zero-crossings of the original wave. I once ran some demo S/W from, I think, TI, and it opened up with a fanfare that sounded like half a dozen clarions doing a "Tantara!" - through the PC's "digital" speaker.

Cheers! Rich

Reply to
Rich Grise

that's more than the power of a typical pocket radio... loud enough?

Bye. Jasen

Reply to
Jasen Betts

"modplay" was one such app, probably still available for download at simtel.net (and mirrors)

I had a play and managed 16 channel (8 bit) polyphonic sound at 19Khz sample rate using the PWM output of an obsolete 10Mhz AVR. The new 20Mhz model promises twice as many channels or twice the sample rate (or throgh improvements in the pwm) half as many at 4 times as the rate.

Bye. Jasen

Reply to
Jasen Betts

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.