Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Pakaran
PostPosted: Mar 27, 2011 - 01:05 AM
Newbie


Joined: Mar 27, 2011
Posts: 1


I am generating a sinewave and outputting it directly to an MX7224, an 8 bit DAC. From there, I want to amplify it and send it to an 8 ohm speaker. I have an LM386, but it distorts the signal by adding higher frequency components and making it more square than sinusoidal. The entire circuit runs on 5V. I'd like to have it be audible throughout a quiet room.

Could someone point me towards a suitable LM386 set up for this situation, because the ones I have used before (the applications on the datasheet) haven't sounded too great. Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
ka7ehk
PostPosted: Mar 27, 2011 - 03:14 AM
10k+ Postman


Joined: Nov 22, 2002
Posts: 14098
Location: Tangent, OR, USA

If the sine is clipped, it is being over driven. Reduce the input amplitude or the feedback resistor.. The high frequency components are probably due to cross-over distortion which this amp is notorious for, though the clipping will also do it. Get the gain down so that it does not clip, then check the sound quality.

Jim

_________________
Jim Wagner
Oregon Research Electronics, Consulting Div.
Tangent, OR, USA

There are some answers that have no questions.
 
 View user's profile Send private message  
Reply with quote Back to top
js
PostPosted: Mar 27, 2011 - 03:16 AM
10k+ Postman


Joined: Mar 28, 2001
Posts: 22850
Location: Sydney, Australia (Gum trees, Koalas and Kangaroos, No Edelweiss)

A volume control comes to mind.

_________________
John Samperi
Ampertronics Pty. Ltd.
www.ampertronics.com.au
* Electronic Design * Custom Products * Contract Assembly
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
valusoft
PostPosted: Mar 27, 2011 - 04:58 AM
Raving lunatic


Joined: Jul 02, 2005
Posts: 7642
Location: Melbourne, Australia

Pakaran wrote:
I am generating a sinewave and outputting it directly to an MX7224, an 8 bit DAC. From there, I want to amplify it and send it to an 8 ohm speaker.
I usually find that being able to describe the situation accurately helps to clarify the problem. Above you say that you are feeding a sinewave into a DAC. I assume that really you are generating a sequence of 8 parallel bits which when fed into a DAC then generates your version of a sinewave. The MX7224 has a reference voltage that scales the resultant analog output. What voltage are you using for the reference? If it is 1 volt, that will be the maximum analogue signal level that your DAC will produce. Let's say you are using a 1 volt reference. The MX7224 has a unity gain non-inverting output stage, so your output will be a direct function of the reference voltage and your maximum digital code, so a maximum of 1 volt.

The LM386 has a minimum voltage gain of 20, so I guess you now have a 1 volt maximum input being amplified by 20 to 20 volts. And if your LM386 supply rail is less than 20 volts, your signal is now being "clipped" with the resultant audible distortion (some rock bands like this; I don't).

What is the solution? As others have already said; reduce the input signal to your LM386. But I would like you to think carefully about why your got to this situation.

Cheers,

Ross

_________________
Ross McKenzie
ValuSoft
Melbourne Australia
 
 View user's profile Send private message  
Reply with quote Back to top
theusch
PostPosted: Mar 27, 2011 - 05:12 PM
10k+ Postman


Joined: Feb 19, 2001
Posts: 29288
Location: Wisconsin USA

Quote:

And if your LM386 supply rail is less than 20 volts, ...

???

Quote:

LM386 Low Voltage Audio Power Amplifier

Features
...
Wide supply voltage range: 4V-12V or 5V-18V
...
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 27, 2011 - 05:39 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71936
Location: (using avr-gcc in) Finchingfield, Essex, England

Here's an LM386 circuit I know will work well with AVR (I had to move things around and paste a couple of sheets together so apologies for any inaccuracies introduced in doing this)

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
pykedgew
PostPosted: Mar 30, 2011 - 01:01 AM
Posting Freak


Joined: Jun 18, 2001
Posts: 1085
Location: Brisbane Queensland Australia

If your DAC can output max approx (5V - 0.6V) for emitter base voltage drop then
use an emitter follower transistor to drive the speaker.

You setup the reference voltage to 4.4V (have trim pot on pin 3) on the MX7224.

Ken
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits