Dumitru Stama escreveu: > Hi guys, > Thank you very much for trying to help me. > The PWM frequency is about 150kHz, my sound is sampled at 22050Hz using 8= bits. > I tried using a low pass RC filter but then the sound level is even > lower. I read somewhere on the web that if i feed the pwm signal > directly to the speaker it would be ok since the speaker cannot react > at 156kHz anyway. It works, i can say i don't have any noise except > the one generated by the fact i am using 8 bits per sample. > I thought about limiting the current from the base with R1. > The impedance of my speaker is 8 ohms, max. power is 0.8W. I can take > a few pictures with my circuit if they might help. > My power source is a bench source delivering 5V / 1.5A, i am not using > any LM7805 or other regulator. Both the PIC18F and LM386 are powered > from 5V. > = I use this method in my products and it works OK, but you must low-pass filter the PWM signal before sending it to the amplifier (a passive two poles RC filter is OK). The LM386 is OK, I use it myself, but your circuit with one transistor is not going to work well. You need an amplifier that can force current in both directions into the speaker, something with high- and low-side active components, plus some means to block DC through the speaker (a capacitor or a well balanced BTL amplifier - the BTL amp. is better for low voltage applications). A very important fact I learned: The processor's digital noise in the audible range passes easily through the LP filter and gets amplified. I solved this by passing the digital PWM (before LP filter) signal through a logic gate (buffer or inverter) powered by its own well filtered and regulated power circuit. If you do things correctly, it is not needed to pump the gain up to 200x, the default 20x is enough. Best regards, Isaac __________________________________________________ Fa=E7a liga=E7=F5es para outros computadores com o novo Yahoo! Messenger = http://br.beta.messenger.yahoo.com/ = -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist