Page 1 of 1
UART Communication (TX/RX pins)
Posted: Mon Sep 29, 2014 9:01 am
by ahmedkhalid
Hello Everyone!!
I am currently working on a module which has two sub-modules which uses TX/RX pins for UART communication.The Controller I am using is Atmega 32 which has only
one pair of pins meant for UART communication (one TX and One RX). These sub- modules works on different baud rate. So my question is that can I use the same
TX/RX pins of controller for both the sub-modules?? If yes then how?
Re: UART Communication (TX/RX pins)
Posted: Sun Oct 05, 2014 7:53 pm
by ionize
You can use a 74HC4052N multiplexer. Since you only need to switch between 2 devices, it will only take 1 pin to do it. Here is an easy to use one:
https://www.atlas-scientific.com/produc ... ctor.html?. Of course, you'll have to adjust the baud rates in your code after the switch selections.
Good Luck with your project,
Scott
Re: UART Communication (TX/RX pins)
Posted: Mon Oct 27, 2014 9:06 pm
by ahmedkhalid
Hello
I am using ESP8266 WiFi module and RS232 at the same time for my project.
There are many AVR atmega micro-controllers which have two UART interfaces, each having a pair of TX/RX pins. Like atmega 324V, atmega 644p, atmega 164P,
atmega 161, atmega 162, atmega 164A etc etc. But the thing is flowcode doesn't give me option to change the default pin connections of these modules. If I
continue with the default pin connections, will this work on hardware? Plus one more thing these modules work on different baud rates. So can I have different
baud rates on same micro-controller?
Waiting for your response!
Thanks in advance!!
Re: UART Communication (TX/RX pins)
Posted: Wed Oct 29, 2014 2:01 pm
by Benj
Hello,
continue with the default pin connections, will this work on hardware?
I believe the hardware UART pins are fixed, changing the hardware channel should assign the correct pins for the device. If not then let me know as some PICs have adjustable UART pins which is now fully supported.
Plus one more thing these modules work on different baud rates. So can I have different baud rates on same micro-controller?
Each hardware UART has it's own BAUD register so yes you can have different bauds on different hardware UART channels.
The new ECIO40P16 has 4 hardware UART channels with re-mappable pins.