I have done something similar for the monitoring of push buttons then controlling the output relays/leds to indicate the state of the input circuits. I used a combination of 74HC595 serial latches controlled by the 16F84. As each of these requires a data and clock line these can all be paralled and a separate enable line is required for each latch, therefore for 32 outputs there would be a requirement for 6 control lines from the 16F84. This would leave 6 for input control/sensing. As an alternative I have also used the I2C bus to control output devices (8 outputs) PCF8574 if I remember correctly. Each of the devices has 4 addresses allowing 32 outputs from 2 control wires, in addition there is an "A" part that allows an addition 4 addresses giving the possibility of 64 outputs from the 2 wire bus. Hope this helps Rex Pearson NT Police, Fire & Emergency Services ----- Original Message ----- From: "Greg Peyton" To: Sent: 26 June 2000 05:09 Subject: Relay question... > I've been charged with building an improved test fixture (T/F) at work and > would appreciate some help from the group. Before I begin I'd like you to > know that I'm not an engineer, only a technician who has been studying the > pics that have been used in our products for the last few years. > > In the past, we've used manual rotary switches as a signal path through our > T/Fs. This is an inherited design, one which I've never been happy with. If > it were up to me we would have scrapped this concept many, many years ago. > When new the T/Fs work fine. With time these contacts wear and tarnish, > eventually cause false readings, resulting in final test product rejects. > Eventually the outer coating on the contacts would wear off, revealing only > brass. The contacts became erratic and drove up labor costs for testing. The > product is a sensitive instrument used for testing of telephone lines and > therefore requires very low, or at least resonably matched low resistances in > all contact points. Changing over to solid silver alloy wafers contacts and > a lubricant greatly improved T/F lifespan but at a large $ cost. The T/Fs > themselves are entirely manual, time consuming to use, build and maintain. > > I've come to the conclusion, and I invite different optinions, that we'd be > better off with an array of relays under direction of a ucontroller. > The T/F presents to the product a variety of resistances, capacitances, ac > and dc voltages (up to 300V) to be measured in the different settings. Simple > stuff but nonetheless we require a degree of accuracy that is repeatable. > > My question (and I do have one) is this: What is the best way of designing > and controlling an array of latching relays? > > We use NEC EB2-5S 5VDC latching relays in our product so I have an huge > supply to work with. The coil of these relays is stated at 250 ohms. I would > like to have available about 32 of these relays but a design that would allow > expandability for future unimagined tests. One of the engineers has proposed > that I use a 74HC373 off of the pic ports to activate the relays. His > thinking is that using two of the '373 output pins for each relay, in a daisy > chain, I could energize the desired relay for a few miliseconds. I understand > this, having seen it used in one of our products, and believe that it is a > possible solution for this T/F business. I have huge respect for our > engineers but something in the back of my head tells me that there is a > better, more efficient or possibly better organized way of doing this. > At this point I can see that there are several competing factors involved; > programming efficiency, component count, simplicity for troubleshooting, > allowance for future expansion, etc. > Obviously this isn't the ultimate solution to the problem but I know that > we're not going to be able to convince the guy who controls the purse strings > to buy new computers, interface cards, dataloggers, calibrators, etc. To > improve the existing setup is what I'm trying to accomplish. Besides, > anything I learn from this helps me out. > > Does anyone have experience with this kind of thing? I'd be willing to > entertain other ideas since I haven't bought any parts yet. > Any web sites or application notes that deal with this type of thing? I don't > believe in reinventing the wheel. Every time I do that I get admonished by > the boss for wasting time (three times before getting it right is normal for > me). > I'm looking for a dialog on this so feel free to respond with questions and > advice before flames. > > > -Greg Peyton >