Multiplexing UART


hi guys!
i'm working on board needs use usb , rs485 interface.
i'm using atmega644 mcu.
ch340g usb uart, , max485 rs485 interface.
75hc4052 multiplexing via 2 interfaces.

so questing is, how make best way can use 2 interfaces @ once.

note: can't use different mcu, drivers, multiplexers , etc.

my best idea use hand shaking (flow control) procedure on ch340g cts , rts pin,
and when switch mux read usb, confirm i'm ready read usb via cts pin.
when rts low can see serial port open data exchange. problem is, when communication opened on pc, work usb, can put rx rs485 on interrupt, don't have many pins left :d

something telling me not best way, can better, i'm asking guys help.
i'm sure here professions , can give me hint easy.

thank in advance.



Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > Multiplexing UART


arduino

Comments