Maker Pro
Maker Pro

Using 74HC4052 for UART

Dada Krauter

Feb 22, 2015
28
Joined
Feb 22, 2015
Messages
28
Hi everyone ;)

I have question to you:
>>>
I want to use GPS(TX,RX) FT232RL(TX,RX) and XBEE(TX,RX) but my chip only has 2 UART ports(ATmega1284P). So I want to use 74HC4052 multiplexer(> http://www.newark.com/on-semiconductor/mc74hc4052adtg/analog-mux-dmux-dual-4-x-1-tssop/dp/42K0889 <). And I want to write code to control this IC. It has only two control pins(S0, S1) also 1 enable PIN(Grounded = Enabled). I want C code to control channels, can you help me with that?

e.g.
>>>
1) Switch to channel 1
2) Get data1
3) Switch to channel 2
4) Get data2
>>>

Thanks ;)

DADA
 

Attachments

  • C__Data_Users_DefApps_AppData_INTERNETEXPLORER_Temp_Saved Images_PIC.jpg
    C__Data_Users_DefApps_AppData_INTERNETEXPLORER_Temp_Saved Images_PIC.jpg
    97.2 KB · Views: 333

Anoxynym

Mar 1, 2015
9
Joined
Mar 1, 2015
Messages
9
I can not get a clear idea of your system. If you need more serial ports on a PC, there are USB devices that implement RS-232 ports. A UART is a pretty complex function. In addition, an RS-232 interface uses DTL signaling levels, not TTL. DTL is rugged and very forgiving, but limited in speed. You can not connect TTL devices to an RS-232 device. The signal levels are incompatible.
 

gorgon

Jun 6, 2011
603
Joined
Jun 6, 2011
Messages
603
The main problem is not to control the switch, but to know when to listen at what. It's a question of synchronization of both Tx and Rx, and it all comes down to the protocols used one each channel.
You can't work at more than one of the two at the time, so you need close control of what is sent from the two channels, and when it is sent.

I also suppose you want to do the switching at the logic level, not the RS232 side?

My best advice is to increase the number of UARTs in a bigger version of the controller you use, if possible.
 
Top