Audio out with just 1 resistor & 1 cap
Rayman
Posts: 14,793
If you don't have the demo board, you can easily get (high impedance) audio output with just one resistor and one capacitor...
I just wired up Pin#10 of my Proto board with a 1000-Ohm resistor and 0.1-uF capacitor and get good audio both with the line-in input on my computer and with Parallax's 2.5" LCD display.·
For robustness, one should probably add a DC blocking cap (but I like to live on the edge!)...
I put a circuit diagram here:
http://www.rayslogic.com/propeller/Programming/dac/dac.htm
Note:· I've increased the resistor value to 1k Ohm to put less stress on the chip and·better filter out the modulation while staying below the typical line-in impedance (deSilva says it's 47k).
Post Edited (Rayman) : 11/10/2007 10:45:20 PM GMT
I just wired up Pin#10 of my Proto board with a 1000-Ohm resistor and 0.1-uF capacitor and get good audio both with the line-in input on my computer and with Parallax's 2.5" LCD display.·
For robustness, one should probably add a DC blocking cap (but I like to live on the edge!)...
I put a circuit diagram here:
http://www.rayslogic.com/propeller/Programming/dac/dac.htm
Note:· I've increased the resistor value to 1k Ohm to put less stress on the chip and·better filter out the modulation while staying below the typical line-in impedance (deSilva says it's 47k).
Post Edited (Rayman) : 11/10/2007 10:45:20 PM GMT
Comments
There are good reasons why the demo board has a 10k - 10nF configuration (RC = 100µs). Whereas Rayman's 100 Ohm - 100nF = 10µs is bound to major distortions.
How does this "integrator" work?
(a) The value of each of the parts is of minor importants, but the following device should have an input impedance much larger than the R, 10xR will be o.k. 100xR will further reduce any distortion. The cap should not be an electrolyte..
(b) The WAV data consists of amplitude information, used to determine the length of a PWM signal generated by a counter within a 60µs cycle. A value of 255 will output a high all that cycle (=100%).
(c) Now, to what voltage will the cap be loaded? Well, within RC = 10µs already upto 70% of 3V... Bingo!
(d) So for reduced distortion it would be good to not load it over - say - 1/2 RC = to around 1.5 V. Which will suggest something like:
R = 470 Ohms (to reduce the current)
C = 60µs*2/470 = 220 nF
Note that you will find a low pass in many places until the signal reaches the membrane of the speaker. So you will hear something even without any additional circuitry of your own. The here discussed integrator is meant to improve signal quality, or in otherwords to reduce signal distortion.
Post Edited (deSilva) : 11/10/2007 7:32:09 PM GMT
duty cycle mode but I'm not sure)?
When using the "duty-dycle mode", you only get "spikes" of 10.5 ns each cycle, which means you have to adjust the cycle lengths accordingly. This is useful for PFM.
Post Edited (deSilva) : 11/11/2007 9:10:57 AM GMT