Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

DAC not able to sound my speaker. Please help

Status
Not open for further replies.

tnecniv

New Member
I have done the hardware implementation using the planned schematic below. but somehow no sound seem to be able to play from the speaker except some noises. Anyone can help me check if something is wrong with DAC shematic?

Components used:

DAC - DAC0832LCN
2Mbit EEPROM - M27C2001-12F1
amplifier - MIK3860825/2
8bit Latch - SN74HCT573N
AND Gate - MM74HCT08N
speaker is 8ohm speaker

please advise. At a lost bcos not sure is hardware having problem or software.
Hardware is exactly the same as the schematic.

short description: sound files are burnt into eeprom. uP sends the sound data from the eeprom to the DAC. DAC output is amplified via the LM386 and put through to the speaker

eeprom segment address starts from 4000H, DAC is on PCS2
currently trying to take any data from 4000H onwards to be sent to the DAC
 

Attachments

  • DACv1.pdf
    607 KB · Views: 227
Last edited:
You could give a short description of the complete system. How it is supposed to work?

1) Hard to read, but it seems like you have positive feedback instead of negative (at LM386).
2) Vs of the LM386 is connected to ground.
 
Last edited:
You could give a short description of the complete system. How it is supposed to work?

1) Hard to read, but it seems like you have positive feedback instead of negative (at LM386).
2) Vs of the LM386 is connected to ground.

thanks for the reply. i have included a description on the complete system.


short description: sound files are burnt into eeprom. uP sends the sound data from the eeprom to the DAC. DAC output is amplified via the LM386 and put through to the speaker

eeprom segment address starts from 4000H, DAC is on PCS2
currently trying to take any data from 4000H onwards to be sent to the DAC
 
Did you check those two things I pointed out?
 
You could give a short description of the complete system. How it is supposed to work?

1) Hard to read, but it seems like you have positive feedback instead of negative (at LM386).
2) Vs of the LM386 is connected to ground.

This LM386 config is taken from its data sheet. i am using the config for the least gain. Currently, I am not able to process anything from the rom. Having checked the output from the DAC to the LM386 using the oscilloscope, it reads a wave peak to peak > 1.2v. the output wave is not showing something close to a sine wave. Please assist.
 
This LM386 config is taken from its data sheet.

Double check it. And also look at the example circuits in the DAC0832 datasheet. I don't see any positive feedback circuits in the LM386 datasheet (well.. maybe couple of oscillators). And connecting the supply pin (Vs) to ground can't be right.. right?
 
Last edited:
Double check it. And also look at the example circuits in the DAC0832 datasheet. I don't see any positive feedback circuits in the LM386 datasheet (well.. maybe couple of oscillators). And connecting the supply pin (Vs) to ground can't be right.. right?

Thanks for the input. I jus realised that too. i will change that to 5v. Could you explain more abt the positive feedback vs negative feedback?
Thanks
 
Thanks for the input. I jus realised that too. i will change that to 5v. Could you explain more abt the positive feedback vs negative feedback?
Thanks

When you connect the output of the amplifier to one of the inputs it is called a feedback. Connecting the output to the negative input (through a resistor) is a negative feedback. Negative feedback makes the amplifier "track" the reference signal which is good for amplifying signals. Positive feedback makes the amplifier unstable and is good for comparator hysteresis and oscillators.

You have connected the output of the LM386 to the Rfb of the DAC. This creates a feedback loop through the internal DAC resistor to the Iout1.. and because you have connected the Iout1 to the positive input of the LM386, the feedback is positive.. this is not a good thing.
 
Last edited:
I have not used the LM386 chip, but it is not a general purpose amplifier. It has internal feedback network.. some sort of. Maybe you need to use a general purpose operational amplifier before the LM386.. or just try disconnecting the feedback loop (disconnect the Rfb pin from ADC). And add decoupling capacitors (~100nF from ground to 5V) near every IC as Nigel pointed out.
 
I'm not familiar with the 386. Is it ok to DC couple the input signal, or should a coupling cap be used?
 
When you connect the output of the amplifier to one of the inputs it is called a feedback. Connecting the output to the negative input (through a resistor) is a negative feedback. Negative feedback makes the amplifier "track" the reference signal which is good for amplifying signals. Positive feedback makes the amplifier unstable and is good for comparator hysteresis and oscillators.

You have connected the output of the LM386 to the Rfb of the DAC. This creates a feedback loop through the internal DAC resistor to the Iout1.. and because you have connected the Iout1 to the positive input of the LM386, the feedback is positive.. this is not a good thing.

Can check what do i do with my Rfb of DAC ? do i leave it floating or should i grd it?
 
Leave floating.

Thanks. now i get a muffled sound. But currently i do not mind this. My main concern is that i am unable to output sound from my rom to the speaker. I am also unsure how to debug it.
could you tell me some methods to
1) Check if my rom data is correct.
-- the rom is currently burnt with a ".raw" file which i converted from ".wav". My sampling rate of my file is 8khz mono.
2) I tried using a function gen to put a sine wave thru to the amp input but it doesnt work. firstly, can i do this? if i can, shld i be able to hear anything?
3) my dac output is generating some wave ( as seen on the osciloscope) at 100 mV. how do i know if this the correct output i shld be getting?

Please assist.
 
Last edited:
1 and 3) You could convert a sinewave .wav to to .raw and burn it to the rom. A simple test signal is easy to observe with oscilloscope: https://mdf1.tripod.com/test-tones.html

2) Did you disconnect the DAC output when you did this? I don't know much about LM386.. hopefully somebody else can help you with this one.

How did you convert the wav to "raw"?
 
Last edited:
I don't know much about LM386.
The LM386 will not work because the DC from the microcontroller messes up its input. If it has an input coupling capacitor feeding the volume control, does not have the feedback and has the +5V supply then its output is a maximum of 3V peak-to-peak which is 0.14W into an 8 ohm speaker (not loud).

The voltage gain of the LM386 is 20 so an output from the microcontroller of only 0.15V peak-to-peak will drive its output to maximum if the volume control is at maximum.

"Muffled" means missing high audio frequencies. The LM386 has a frequency response to 300kHz so either the input from the microcontroller is missing high frequencies or the speaker is lousy.
 
The LM386 will not work because the DC from the microcontroller messes up its input. If it has an input coupling capacitor feeding the volume control, does not have the feedback and has the +5V supply then its output is a maximum of 3V peak-to-peak which is 0.14W into an 8 ohm speaker (not loud).

The voltage gain of the LM386 is 20 so an output from the microcontroller of only 0.15V peak-to-peak will drive its output to maximum if the volume control is at maximum.

"Muffled" means missing high audio frequencies. The LM386 has a frequency response to 300kHz so either the input from the microcontroller is missing high frequencies or the speaker is lousy.

hi audioguru. thanks for the response. firstly the speaker i am using is lousy.
so what u r trying to say is that i have to:
1) make Vref of my DAC to be 0.15v.
2) Make Vs of my lm386 = 5v. ( i have already done this)
3) Insert a capacitor of abt 0.1nF in between the DAC output and the variable resistor
4) Change the feedback from the current config to the "-input" of the lm386
Am i right to say this?
 
1 and 3) You could convert a sinewave .wav to to .raw and burn it to the rom. A simple test signal is easy to observe with oscilloscope: https://mdf1.tripod.com/test-tones.html

2) Did you disconnect the DAC output when you did this? I don't know much about LM386.. hopefully somebody else can help you with this one.

How did you convert the wav to "raw"?

I did not disconnect the dac output when i did this.*bummer*.
I converted it using audacity. i simply inserted the final sound file i wanted and saved it as a raw file.

I checked the contents of my rom with the actual raw file and found that the contents of the rom were actually different. The data in the rom was at different locations when compared to the .raw file on my pc. however, i didnt see any content distortion or corruption.
currently , after debugging somore my MCS0 of uP drops to 0 first followed by MCS1 etc. My Dac is being enabled as the enable pin drops to 0V. however i am unsure of the content at the dac ouput.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top