Patrick wrote: > Date: Tue, 24 Sep 1996 08:43:08 +1000 > From: Patrick Hanson > Subject: Connecting multiple rs232 lines together > > I am hoping somebody out there in PIC land may be able to help me. > I am currently working on a simple home automation system using multiple > 16C84's (max of 10) fitted with rs232 trancievers as slaves and a PC as > the master controller. I am not sure how to go about connecting all the TXD > lines on the slaves to the PC without causing possible conflicts. It is > intend Gerard Chew wrote: > > What I'm looking for is like, ok, you connect one pin of the > Stamp to the Tx, one to the Rx and then ...etc? What about some sample code > to tie the whole thing together? I sent the following message a few days ago to Mr. Gerard My 75156 parts just arrived to me but I did not stick them to my prototipe because I have been busy with overdue projects for my work. However I'll try a sketch to you (in a robot style!!!?). Pin 8: to +5 Vdc Pin 5: to GND Pins 6/7: to RS-485 link (twisted pair) (field wiring) Pin 1: Rx Data, to a input port pin of STAMP Pin 4: Tx Data, to a output port pin of STAMP Pin 3: TX Enable, to another output port pin of STAMP Pin 2: Rx Enable, to another output port pin of STAMP This requires four pins of STAMPs (too much) A more economical approach should be tie pin 3 and 2 toghether to a output of STAMP. This signal means: 0 -> STAMP receiving or 1 -> STAMP transminting. If you want to reduce again the pin counts (in STAMP), tie pins 1 and 4 toghether to a STAMP pin. This STAMP port shall be bi-directional, in another words, this pin will be output when STAMP is transmiting and will be input when STAMP is receiving. It's easely implemented with tri-state capabilities of STAMP. Two pins looks like: ------ --------------- |output pin (flow ctrl) 2,3 | |6 RS-485 Link |---------------------------| |------------ DATA STAMP | | 75156 | |in/out pin (data) 1,4 | |7 |---------------------------| |------------ /DATA | | | ------ --------------- Sorry I don't write one line of source code yet! But in slave STAMP you must be in receive mode *listening* to master queries (pins 2,3 -> 0 and pins 1,4 -> input to STAMP). I foud National Semi DS75176B at $1 in 500 qty When I hookup my prototipe I will tell you if it worked out. I suppose this arrangement work without problems but I'm not sure Also, I'm interested in a one master many slaves simple protocol. Any pointer? Luiz