Connect with us

Using 74HC4052 for UART

Discussion in 'Microcontrollers, Programming and IoT' started by Dada Krauter, Feb 28, 2015.

  1. Dada Krauter

    Dada Krauter

    28
    0
    Feb 22, 2015
    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
     

    Attached Files:

  2. Dada Krauter

    Dada Krauter

    28
    0
    Feb 22, 2015
    Heyy no one know? o_O
     
  3. Anoxynym

    Anoxynym

    9
    7
    Mar 1, 2015
    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.
     
    Dada Krauter likes this.
  4. gorgon

    gorgon

    603
    23
    Jun 6, 2011
    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.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-