MCU to FTDI / RS232

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
I have a project to design a converter with data gathered with a MCU to output through USB or RS232. I’m using a MAX232 and an FTDI chip. The chips are connected to the TX/RX of the MCU. Only one will be used at one time. USB 5V will be utilized in both situations.
Is there a best way to jumper or select between USB to RS-232? I’ve thought about removing ground or power to the respective chip but wonder if data streams may power the chips. The chips do not have enable Pins
 

MrChips

Joined Oct 2, 2009
30,706
It is not clear what is your situation.

Device #1 <--> Device #2

What is on Device #1, USB, TTL, RS-232?
What is on Device #2. USB, TTL, RS-232?
 

BobaMosfet

Joined Jul 1, 2009
2,110
I have a project to design a converter with data gathered with a MCU to output through USB or RS232. I’m using a MAX232 and an FTDI chip. The chips are connected to the TX/RX of the MCU. Only one will be used at one time. USB 5V will be utilized in both situations.
Is there a best way to jumper or select between USB to RS-232? I’ve thought about removing ground or power to the respective chip but wonder if data streams may power the chips. The chips do not have enable Pins
of course the chips have enable pins- Vcc. Just ground their Vcc pin to turn the chip _OFF_ . You can control this with a transistor.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
this is what I came up with... might be a better way but it appears to works. 3 pin header with a jumper for power in center pin

1617912636924.png
edit: the gates should get pull downs
 
Last edited:

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
It is not clear what is your situation.

Device #1 <--> Device #2

What is on Device #1, USB, TTL, RS-232?
What is on Device #2. USB, TTL, RS-232?
MCU decodes input data and transmits via TTL UART so it can be transmitter by either:

1. USB

OR

2. RS232

that’s about as far as it was explained to me at the moment
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
I've built the device, USB works perfectly, when VCC for FTDI chip is grounded out, it appears to make issues with the TX/RX to MAX232 chip. I can see the transmit signals between a 1K and MCU, but appears to be an issue with the FTDI grounding out the signal...
 

BobaMosfet

Joined Jul 1, 2009
2,110
I've built the device, USB works perfectly, when VCC for FTDI chip is grounded out, it appears to make issues with the TX/RX to MAX232 chip. I can see the transmit signals between a 1K and MCU, but appears to be an issue with the FTDI grounding out the signal...
Let's see a schematic. You didn't ground Vcc directly, did you? I mean, you don't want to short things.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
I have a few ideas:

Grounding the FTDI chip is causing TX and RX to get grounded (clamping diode would not let it change logic levels)
Bad MAX232 chip

I may have to design a data switch circuit to make it work.

The only redeeming value is that USB works great even after all the jumping I did today to try to fix the issue.
 

paoloberno

Joined May 3, 2021
13
I don't like the solution where the vcc or gnd pins are disconnected while signals are sent to other pins, in my experience some unpredictable behaviour can occur because the ICs are not designed to operate in that way.
My suggestion is to connect together the Tx lines from the micro to the RS232/FTDI and use a mux, other logic (i.e. two ANDs) or a jumper to select one of the two Rx lines from RS232/FTDI to the micro.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
That was another solution, to design a switch circuit. How about optoisolators with enable controlled by pmos power connection based on jumpers
 
Last edited:

Thread Starter

Wolframore

Joined Jan 21, 2019
2,609
I don't like the solution where the vcc or gnd pins are disconnected while signals are sent to other pins, in my experience some unpredictable behaviour can occur because the ICs are not designed to operate in that way.
My suggestion is to connect together the Tx lines from the micro to the RS232/FTDI and use a mux, other logic (i.e. two ANDs) or a jumper to select one of the two Rx lines from RS232/FTDI to the micro.
this is the best idea, I’m leaning towards two of these OnSemi NC7SZ157P6X.
https://www.onsemi.com/pdf/datasheet/nc7sz157-d.pdf. I’ve already got the control logic in place.
 

John P

Joined Oct 14, 2008
2,025
Maybe you don't need to do any of this stuff. You could connect both inputs to the processor via diodes as a "wired-AND" circuit (or use a real AND gate), and for the TX, just drive both outputs in parallel. This assumes that you only have one interface or the other active at a time, of course.
 

paoloberno

Joined May 3, 2021
13
For RS232 frequencies a wired-and is fine (as long as there is a pulldown resistor after the cathodes) but for the higher frequencies that can be used with ftdi chips (i've used them at 1Mhz but they can reach 3MHz) i'm not sure that the signal integrity is preserved because of the lowpass filter created by diode capacitance + micro input capacitance + pulldown resistor.
 
Top