0
\$\begingroup\$

Oddball design question:

I have a pin that's used for audio input (allowing up to 12Vpp AC), and for testing/utility purposes I'd also like to be able to use this pin for a reliable UART TX output as well (0-3.3V). (Not at the same time of course, but without a hardware change).

They key is that this circuit that injects the UART signal can't alter the audio signal when it's inactive. So it has to be something high impedance when "off" and seeing anything from -6 to 6V. This rules out simple transistor circuits or a MUX as far as I can tell.

[ The internal circuitry runs at 0, 3.3V, 5V, and 24V, no bipolar ]

A relay should work, of course, but I'd hope there was a smaller/cheaper/more clever way to do this.

[ The UART input/RX was easy enough, just using a comparator to sense voltage. I can't figure out a good way to do this with the output though. ]

\$\endgroup\$
5
  • \$\begingroup\$ Hi, would an analog switch work? \$\endgroup\$
    – polwel
    Commented Jul 2, 2022 at 21:09
  • \$\begingroup\$ Thanks, I don't think so, as the negative going input would be outside the valid range of the switch, so the switch would probably conduct and distort the audio. \$\endgroup\$
    – rspaudio
    Commented Jul 2, 2022 at 21:55
  • \$\begingroup\$ Pick a Tx driver chip that has an enable input, that usually tri-states the output. \$\endgroup\$
    – SteveSh
    Commented Jul 2, 2022 at 23:13
  • \$\begingroup\$ Maxim (now Analog) makes a couple of multiplexers that accept input signals waaaay beyond the power rails. E.g. the MAX14759 which can handle +/- 25V signals even when running from a single 3.3V supply. There are likely other companies that make similar products (I just happened to remember MAXIM's one off the top of my head) \$\endgroup\$
    – Sam
    Commented Jul 3, 2022 at 0:20
  • \$\begingroup\$ Thanks all! The tri-state buffer idea might be the right way. A cursory look shows many options (including parts I can actually buy!). They all have some allowed voltage rating on the output that's too shy, but also say "The input and output voltage ratings may be exceeded if the input and output current ratings are observed." With 20-50mA being allowed, that's no big deal, adding a 1k or so won't affect the UART usage, and I'll want it for short protection anyway. SN74AHC1G125 looks like the right one, plenty of stock and super cheap. As long as out of range voltage isn't shunted. \$\endgroup\$
    – rspaudio
    Commented Jul 3, 2022 at 13:23

1 Answer 1

1
\$\begingroup\$

Output needs a tristate chip.
Input needs to be NPN common emitter with Si diode + R=10k to base, > 1k collector to Vdd.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks! This seems right. I already have have some MMUN2211LT1G on my board, I think those should work. Any specific reason a Si diode would be preferred? I have a few schottky's on my board already too and am always preferring to minimize the BOM growth. \$\endgroup\$
    – rspaudio
    Commented Jul 3, 2022 at 14:05
  • \$\begingroup\$ Oh, the reverse leakage current, probably, causing distortion on the audio input? I'll have to see if that's an issue with the Schottky, maybe it's still low enough to not be a problem. \$\endgroup\$
    – rspaudio
    Commented Jul 3, 2022 at 14:23
  • \$\begingroup\$ UART Rx thresholds are always TTL or 2 Si diode drops \$\endgroup\$
    – D.A.S.
    Commented Jul 3, 2022 at 14:44
  • \$\begingroup\$ Got it, that makes sense, it increases the threshold for a detected RX signal to be similar to typical UART reception, reducing odds of noise or spurious signals from becoming received. (Not sure if I need that, but I'll consider it.) \$\endgroup\$
    – rspaudio
    Commented Jul 5, 2022 at 19:03
  • \$\begingroup\$ One issue with this: Tri-state doesn't really mean tristate for negatively imposed signals. That's kind of a problem, as the applied AC signal gets distorted when they go negative. Any advice on fixing this issue? \$\endgroup\$
    – rspaudio
    Commented Apr 7, 2023 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.