PDA

View Full Version : Audio board mic in as line in



Techy
08-16-2016, 04:32 PM
Hello, I'm currently setting up my audio adapter board, and realized I could potentially connect the Teensy's DAC to the mic input somehow, so that I do not have to use one of the line in channels or make any funky mixing circuitry if I want to utilize the DAC with the handy output jack.
I have looked over the SGTL5000 datasheet and it appears that internally the mic input functions the same as the line inputs aside from the programmable gain.
What would I need to do, hardware-wise, in order to connect the pins? Here is what I've come up with so far, please guide me and feel free to correct me.


Make a voltage divider to keep the voltage below the ~2.8v maximum.
Remove the 2.2k resistor between mic bias and the mic pin. (I am perfectly fine with permanently modifying the board in this way, if it is necessary)

Is this correct? Is my idea even achievable?

Ben
08-16-2016, 09:47 PM
This *might* work, your source would have to mimic a microphone in terms of internal resistance and signal amplitude, and I don't know the typical values for either. I guess the amplitude will be somewhere in the lower mV range. You should be able to disable the bias in software:
From the Datasheet:
MIC Bias Output Impedance Adjustment
Controls an adjustable output impedance for the microphone bias. If this is set to zero
the micbias block is powered off and the output is highZ.


Again, I don't see anything obvious that would prevent you from doing this "hack", but you need to research how a typical microphone behaves towards the amp and try to recreate this behavior with your signal source.

Ben

Techy
08-16-2016, 10:32 PM
I know I wasn't particularly clear in the original post, but I intend to connect the 'A14/DAC' pin on the Teensy to the 'mic' pin on the audio board, for easily mixing it into the same audio system. Would a simple voltage divider work in this situation? I am aware that input impedance will cause issues, but if anything it will just make the sound quieter, which is probably a good thing considering I've calculated the divider for ~2.6v maximum...

tni
08-16-2016, 11:47 PM
Is there some reason you don't want to use the internal 1.2V reference for the Teensy DAC?
https://forum.pjrc.com/threads/24739-What-is-the-default-voltage-range-on-the-DAC-for-the-Teensy-3-1

Even if you disable the mic bias in software, there is a 2.2uF cap towards ground on the audio board and the Teensy DAC has a pretty high output impedance. I would remove the 2.2k resistor.

Techy
08-17-2016, 10:29 AM
As I said, I simply don't trust myself to not do something dumb, so I won't rely on setting a lower-than-default voltage range. I have already removed the bias resistor from the board now. I will solder the setup together and test it. My resistor divider will sit between the two boards nicely, so if it doesn't work particularly well then I can just clip it off and pull it out from one end.

Later edit:
I've just tested it and everything works exactly as expected! (At least, once I realized I shouldn't be setting the mic gain to 36...)
However, I've noticed with this audio setup that there's some noise along with strange clicking going through the system even when I don't enable the mic input... Is there any way I can resolve this?

As for the working voltage divider arrangement, I used 2k7 resistor from DAC to mic, then 10k from mic to ground.

tni
08-17-2016, 01:51 PM
As I said, I simply don't trust myself to not do something dumb, so I won't rely on setting a lower-than-default voltage range.
The SGTL5000 Vdda is powered from 3.3V, so it can survive 3.6V on the analog inputs (datasheet table 2, maximum ratings). The 2.8V you are referring to is when it's going to start clipping.

The Teensy DAC has an output impedance of around 3kOhm, the mic input has an input impedance of 2.9kOhm; that's already far from ideal. Adding the voltage divider...

Actually you may be able to cheat. E.g. if you were to use a 3000Ohm / 300Ohm voltage divider, you would get an effective output impedance of around 300Ohm. You will loose 26DB signal level, but the SGTL5000 has amplifiers. This could be a better option, if you can get distortions.

Techy
08-19-2016, 07:24 PM
The SGTL5000 Vdda is powered from 3.3V, so it can survive 3.6V on the analog inputs (datasheet table 2, maximum ratings). The 2.8V you are referring to is when it's going to start clipping.

The Teensy DAC has an output impedance of around 3kOhm, the mic input has an input impedance of 2.9kOhm; that's already far from ideal. Adding the voltage divider...

Actually you may be able to cheat. E.g. if you were to use a 3000Ohm / 300Ohm voltage divider, you would get an effective output impedance of around 300Ohm. You will loose 26DB signal level, but the SGTL5000 has amplifiers. This could be a better option, if you can get distortions.

Thanks for this info, but my arrangement does seem to perform exactly as expected even without using amplifiers. The level is not too low but doesn't clip, so I must've cheated it into some sub-optimal sweet spot if that makes sense. PS: I was aiming to avoid clipping as well as being within the limits, so <2.8V is still a correct target.