On Wed, Jul 04, 2001 at 07:46:37AM +0200, Patrick J wrote: > Yes, this was also suggested by Bob Ammerman and it sounds just like the way > to go for my purpose: 4 sensors connected to 4 PICs so parameters can be > adjusted aut. by the PC. Actual output from the sensors wont go through > RS232 since they must be read in sync and responstime is an issue. Well as Bob pointed out, as long as the parts are in close proximity, that wire-or TTL can do the job. > > I have also looked into RS485 as Byron refered to in his reply. I am not sure > how that works, but I found some RS485 tranciver ICs. Speed is 250kbps > to 4mbps. Don't worry about the speed. The real bottom line of RS-485 is the fact that it's true multistation. Up to 32 nodes can be connected to the same pair of lines. > > Does 485 use some special protocol, or can I just the TX/RX from the PIC > to the 485 tranciver ? > PIC1 <-> RS485 tranciver <==== 485 BUS ====> <- RS485 tranciver <-> PIC2 Exactly as you describe. The only catch is that only one transmitter can be selected at a time. This has a couple of hardware and software implications: Hardware: Each node, including the PC, must have a way to select the direction of the transceiver. For the PICs it's fairly simple: use another I/O pin for direction control. However for PC's it's a bit tougher. The easiest way to do it is to have a one-shot that selects transmit whenever the TX goes low and times out after two character times or so. So transmit is selected as long as you're transmitting characters, then it automatically reverts to receive once transmit ends. Software: Add code to select the direction. Start in receive, wait until the PC talks to you then transmit. That's the basic protocol. BAJ > > /PJ > > From: "Harold M Hallikainen > > You can also do a cheap short distance serial bus using TTL levels > right > > out of the PIC. In a dental product, I have a couple PICs in the desktop > [snip] > > > > Hi, I am investigating the possibillity to have 4 PIC 16F877 > > > connected to the same PC on a RS232 'bus'. > [snip] > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body