1
\$\begingroup\$

So basically I'd like to put two external interfaces into one device. One of them will be RS-485 (I'd use SN75176 for that) and the second one is USB (with FT232BM).

I will use ATmega48PA-AU CPU as the core. So I will have only one USART port at the CPU end.

One of important assumption is that only one interface will be used at one time.

What I intend to do is to use diode-diode decoupling for RxD line:

enter image description here

I expect that this schematic should work for low frequencies (9600 in my case). But I've never used FT232BM chip in particular, moreover I've never designed any device with USB interface. So some troubles I'm not aware of can surprise me. Is there any?

And is there any better cheap and simple solutions for decoupling interfaces for such case?

\$\endgroup\$
  • \$\begingroup\$ This won't work if the two interfaces are connected at the same time, no matter if they are used or not, as they can pull your RX line down. \$\endgroup\$ – Adam Calvet Bohl Dec 7 '16 at 11:30
  • \$\begingroup\$ Maybe a simpler solution would be to use a MCU with two UART. Or, even more efficient: a MCU with a UART and a USB interface (cheaper, smaller). Any reason you seem to have excluded these options? \$\endgroup\$ – dim Dec 7 '16 at 11:30
  • 1
    \$\begingroup\$ @AdamCalvetBohl, idle receiver should keep its RXD line high. Taken from this article: en.wikipedia.org/wiki/Universal_asynchronous_receiver/… \$\endgroup\$ – Roman Matveev Dec 7 '16 at 11:47
  • \$\begingroup\$ @dim I have the device already designed, tested and even put into small production. What I need is to add one single option in it. So replacing the MCU will be a pain for me: rerouting the board, replace stock components, rewrite software. So in my case it will be not a simple solution anyway :( \$\endgroup\$ – Roman Matveev Dec 7 '16 at 11:49
  • \$\begingroup\$ Ok, then I don't find any other reason for this to fail, but I'm not sure. I've used FT232 family at different speeds but I've never worked with RS-485 in MCUs... \$\endgroup\$ – Adam Calvet Bohl Dec 7 '16 at 12:08
2
\$\begingroup\$

An alternative solution: The FT232BM has a pin named #PWREN: Goes Low after the device is configured via USB, then high during USB suspend. Can be used to control power to external logic (ex. using a P-Channel Logic Level MOSFET switch). Maybe turn-off the RS485 device.

The PWREN# signal will be high (power = off) under the following conditions:

· The FT232BM / FT245BM device is in reset

OR

·The FT232BM / FT245BM device is not yet configured by USB enumeration, or the USB enumeration sequence has failed

OR

·The host PC system is in the USB suspend state

\$\endgroup\$

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.