2
\$\begingroup\$

I have an application below that requires 2 MCUs to be on a PCB, along with a single FTDI header. Both are programmed thru their RX/TX UART pins.

In normal operation, the RX pin on MCU_1 is connected to TX pin on MCU_2, and vice versa, for inter-MCU communication.

To flash MCU_1, a DP3T switch is toggled to the left to route the MCU_1 TX/RX pins to the FTDI header.

To flash MCU_2, the switch is toggled to the right to route the MCU_2 TX/RX pins to the FTDI header.

schematic

simulate this circuit – Schematic created using CircuitLab


So far, I have found DP3T switches with the following configurations: DP3T configurations

I'm looking for such a configuration instead:

ON-X-ON

I'm guessing such a switch probably doesn't exist? How is it best then, using the least wiring/components as possible, to implement such a setup?

\$\endgroup\$
  • \$\begingroup\$ Can you guarantee that all the TX outputs will be tristated when the switch is thrown? \$\endgroup\$ – ThreePhaseEel Dec 7 '16 at 23:37
  • \$\begingroup\$ @ThreePhaseEel Hmm the switch should not be thrown during normal operation (i.e. MCU1 <--> MCU2 inter-communication). It serves as some kinda debug switch to allow the user to connect up a FTDI programmer to flash each MCU without having to remove either MCU from the board. \$\endgroup\$ – loongyh Jan 17 '17 at 20:50
0
\$\begingroup\$

If you can guarantee that all the TX outputs will be tristated (floating) when the switch is thrown, then you can use a 4P3T slide switch wired as follows, for the given switch:

  • 1 and 3 to MCU 1's TX
  • 4 and 7 to MCU 2's TX
  • 5 and 8 to the FTDI's TX
  • 2 to 10
  • 6 to 14
  • 9 and 12 to the FTDI's RX
  • 11 and 16 to MCU 2's RX
  • and 13 and 15 to MCU 1's RX

P.S. the lack of a schematic is due to CircuitLab not having appropriate symbols for a 4P3T switch.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Nice, thanks a bunch! I have made a schematic from the datasheet to visualize this. Straightforward and perfect! \$\endgroup\$ – loongyh Jan 17 '17 at 20:43

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.