Thanks for the suggestions? Just one query. Why have you mapped Off to +5v and -50v to 0v? I was thinking 5v for -50v and 0v for off? Im still a little confused what is meant by positive earth and -50v?. The circuit board on which this is going to be mounted has a -50v continuous supply which Im going to use for general power. Will this cause a problem being negative? Andrew On 31/05/10 21:21, Michael Watterson wrote: > Andrew Wood wrote: > >> 50v Positive Earth when operated, open when not operated. Needs to be >> checked at a frequency of 13Hz (every 80millisec) >> >> >> > Ok, so you can level translate to +5V for off and 0V for -50V in by two > resistors and 2 x cheap 1N4148 diodes for each of 90 signals. > One resistor is 10K pullup to +5v with clamp diode from ground to > pin.on Shift register parallel in, 2nd diode anode to input pin also > and cathode via 100k resistor to the -50v or off signal. > > OFF will = +5V > -50V in will = 0V > > use 12 x 8 bit shift registers with clock pins all parallel driven by a > PIC pin > parallel all "load" pins. drive by a PIC pin > daisy chain SO and SI (11 connections between 12 chips) and final SO to > PIC input pin. > > Software: > do forever > toggle load pin to read all 90 inputs to Shift registers (< 2uS) > for 90 times: (takes > toggle clock pin and then read last SO pin. (takes< 2uS per > bit!) > end for > send data to host via serial or USB* (even at 4,800 baud is< 50ms > for 96 bits) (or do this every 8 inputs) > wait till 80ms is up (do nothing for 30ms if 4800baud, or 55ms if 9600 > baud!) > loop > (*Doing this on 18F2550 using JAL USB serial library is simpler than > serial in Assembler) > > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist