I was wondering if its possible to hook up two devices to the arduinos tx/rx lines.
I have a touchscreen lcd monitor from sparkfun that receives and sends info via serial pins 0/1
I also plan to use an xbee module to connect this device to a transmitting unit... also serial data.
Is it necessary to use a larger arduino with multiple serial ports or can I hook them up to the same serial line...
The xbee transmits header lines and the screen is also looking for specific headers....
The reason I thought it could possibly work is that the xbee is only receiving data not transmitting so no data to get scrambled on the tx. but when data comes in there will be packets from the xbee as well as serial commands coming from the lcd control library to the screen.
Will the packets stay intact or will they get scrambled if the arduino tries to talk to the monitor at the same time xbee data is coming in???
Maybe you could try to use the hardware UART for one device and SoftwareSerial for another one. Or take advantage of the XBee can communicate not only via UART.
The serial pins (DIN and DOUT) of the XBee are connected through an SPDT switch, which allows you to select a connection to either the UART pins (D0, D1) or any digital pins on the Arduino (D2 and D3 default).
Note: hw TX and RX is problematic to use because the hardware UART is shared with the USB programmer. Programming Arduino does not work with any serial devices connected to D0 and D1 (it must be disconnected first - it extends time of the debugging)
You can connect several devices to a single Rx provided you isolate them properly and provided only one device talks at any one time.
You need an external pullup resistor (4700 ohms should be ok) between the Rx pin and 5v. And on each incoming line you need a diode that prevents the HIGH on the incoming line from reaching the Rx pin. That allows any device to pull the Rx pin LOW