Posted: Thu Oct 23, 2008 4:54 pm Post subject: multiple TX AVRs same line
I have trying to have multiple avr's TX rs232 data into 1 AVR. Like a master/slave protocol.
So, lets say we have 2 slaves and 1 master. Both slaves transmit 1 byte over the TX UART line at different times. Sounds fine so far. However, when I connect the 2 TX lines from the slaves into the 1 RX line,...nothing works.
but when I disconnect eather of the TX lines,..all is fine.
So, is there a way to do this. That is, have multiple TX's into 1 RX?
If so,....any advice on how to do it?
The problem is that the TX line is high when the AVR is not transmitting, if the other AVR is going to transmit it will pull the line down, but his is not possible because the first one is pulling it high.
The best way to do this correct is using some RS485 drivers to connect multiply AVR's together. Or maybe an NOR port will work, but never tested the last option. _________________ www.evertdekker.comBascom code vault
Joined: 24 May 2005 Posts: 435 Location: Hilversum - The Netherlands
Posted: Thu Oct 23, 2008 8:36 pm Post subject:
Here is a simple but effective way of doing it: a wired-OR with just a pull-up resistor and one small signal diode per slave.
In software you need to take care that only one Slave answers at a point in time: the prooven way to accomplish that is the famous:
Slaves don't speak unless spoken to
In other words: the Master asks a Slave for data, the slave answers and goes silent after his answer. _________________ Bascom AVR ver 2.0.8.6
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum