0
\$\begingroup\$

I'm trying to send digital signals from an ST-Link V2 programmer connected to my computer to a blue pill STM32 microcontroller, but I want it to go through a DG412 Quad SPST CMOS Analog Switch.
As far as I can tell I have it all set up and it doesn't seem to correctly program my board. Is what I'm doing even hypothetically possible? Is there any reason I couldn't send a digital signal from source to drain on an analog switch?
Are these switches bi directional? As in, does the data have to be coming from the source pin to the drain pin, or could data be sent back from drain to source? The SWDIO pin is bi directional, although I don't know whether the blue pill sends any data back during programming.
I'm thinking the other reasons it might not work is due to latency, or missing additional components. I'm pulling the IN lines to GND and the Drain to GND with resistors.

SOLVED: It turns out when the 3.3V went through the IC, the voltage dropped to 2.9. When the voltage was that low the other factors of the IC became an issue. The clock was interrupted by the capacitance of the MOSFET. Also the fact that I used 5V on the V+, V- rails meant the source-drain on-resistance was much higher. By putting 12V into the rails and having 3.3V bypass the IC I was able to make it work.

\$\endgroup\$
0
1
\$\begingroup\$

On the face of it a DG412 should be OK providing that your interface is unaffected by these things in red: -

enter image description here

In other words, if you are switching the device on and off at a sufficiently high rate the signal being propagated through the switch will be seriously affected by the limited switching speed.

Your circuit should also be able to cope with the extra 25 Ω the the device inserts in series with any signal when it activates.

Clearly also, you need to observe the correct power supply requirements for your application / target design. You should also note that when the device is activated it imposes 35 pF to ground 0 volts and that may disturb your signals too much (Channel On Capacitance).

\$\endgroup\$
18
  • \$\begingroup\$ I hadn't noticed the resistance but the switching speed was definitely something I was afraid of. I'll see if I can find the spec for the programmer and see what it actually expects. \$\endgroup\$
    – jfenwick
    Apr 4 at 18:25
  • 1
    \$\begingroup\$ @jfenwick the power rails for the DG412 should not normally be less than the upper and lower limits of the voltages you are trying to route through the chip. I don't know what those limits are. \$\endgroup\$
    – Andy aka
    Apr 5 at 17:05
  • 1
    \$\begingroup\$ I was pointing out the on resistance graph. \$\endgroup\$
    – Andy aka
    Apr 5 at 20:35
  • 1
    \$\begingroup\$ Your best bet to prove this is to try it without the analogue switch and add some capacitance to see if it screws the data. \$\endgroup\$
    – Andy aka
    Apr 5 at 21:12
  • 1
    \$\begingroup\$ So, that sounds like the issue. If, without the chip the basic data transmission system cannot tolerate excessive capacitance, then your main hope is to look for an analogue switch that has much smaller capacitance imposed on the clock signal line. \$\endgroup\$
    – Andy aka
    Apr 5 at 23:52
2
\$\begingroup\$

Yes, an analog switch is bidirectional. Being analog, it doesn't care what is being sent through it, analog or digital as long as it is within the specification of the switch. By the way, analog switches don't have sources or drains. They are CMOS transmission gates which is a PMOS and NMOS in parallel so each end of the switch has both the source and drain of a MOSFET.

Yes, what you are trying to do is theoretically possible.

\$\endgroup\$
2
  • \$\begingroup\$ If you look in the datasheet each switch has IN, S, and D, so I assumed that meant source and drain. I'm not sure what else I'd call those. What you're saying about nmos and pmos in parallel does help explain what I'm seeing in the schematic of the internals of the IC though. \$\endgroup\$
    – jfenwick
    Apr 4 at 18:28
  • \$\begingroup\$ @jfenwick Huh, yeah I don't know why they would call that S and D either. \$\endgroup\$
    – DKNguyen
    Apr 4 at 18:30
1
\$\begingroup\$

Yes, it will work. Be sure to check the analog switches resistance change over temperature. They can be pretty dramatic.

\$\endgroup\$
1
\$\begingroup\$

It should work since analog switches are implemented with on-chip FETs which, when on, behave as resistors.

However, voltage on both ends of the switch should not exceed the power supply voltage of the switch, and they also have a wide range of resistance and capacitance depending on what chip you used.

So you should check the datasheet to make sure the resistance and capacitance are low enough to not round off or delay your digital signal too much. These increase at low power supply voltage. Note 74HCT4066 is not specified for use at 3V3.

\$\endgroup\$
2
  • \$\begingroup\$ Do you know of a similar chip that is specific for 3V3? Do you think something like 74VHC4066 would work better? \$\endgroup\$
    – jfenwick
    Apr 5 at 19:07
  • \$\begingroup\$ Looks like the datasheet says it'll work down to 2V so probably yeah \$\endgroup\$
    – bobflux
    Apr 5 at 21:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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