Hi Guys
I have a scenario in which two devices are connected with rs232 protocol. Device 1 asks for some data and device 2 provides the data to device 1.
Now what I want to do is to add a microcontroller which also send command to Device 2 to get some data. Here I attached the image which shows the scenario.
Device 1 asks for data at a defined interval so my microcontroller will ask for data from Device 2 at a pre-time interval.
My question is Can I do something like that as shown in the picture by placing Diode at Tx side of Both Device 1 and Microcontroller?
Maybe it looks so simple but actually this cannot be achieved.
Required suggestions from your side.
KlausST I will definitely use some simulator and test the results and post it here.
Another scheme coming in my mind, If I convert the logic level of Device1 to TTL and then use Diodes like in the picture and then convert again to MAX232 Level. Will this be OK?
But again I doubt that the diode direction is correct.
Code:
Truth table of what you need:
(UART is idle HIGH)
A = data coming from device1
B = data coming from microcontroller
Y = data going to device2
A B | Y ; Info
---------------
L L | L ; both are trying to transmit = data collision. Try to avoid this situation
L H | L ; A transmits, B is idle
H L | L ; A is idle, B transmits
H H | H ; A is idle, B is idle
This is an AND logic.
Instead of 2 diodes and a pull up, I´d use single gate logic, like 74HC1G08
Klaus
added:
The disadvantage (compard to post#1) is, that now the "microcontroller" is an essential part.
+ in post#1: when the microcontroller is not powered up or not connected, then device1 and device2 can communicate.
- in post#25: when the microcontroller is not powered up or not connected, then device1 and device2 can not communicate.