I previously wrote:

Since the lines are fired in a fixed sequence one at a time, it might be easier to just put open collector buffers on the odd numbered inputs and tie all outputs together. This will give a single input that tells whether the line number is even or odd and the processor can count up or down every time the even/odd line changes. Line 1 and 2 could be tied to additional inputs in order to allow the processor to lock onto the line number and determine whether to count up or down. The processor would not be able to determine the line number and direction until the line number reaches line 1 or 2, but this may be acceptable if this is a case where the processor can be programmed to not do anything until after a lock has occurred.

This can be further simplified by making your own buffer. Just put a diode from each odd line to a common point and tie that point to the base of a transistor through a current limiting resistor. Add a pull up resistor to the collector and run the output into the I/O port of your processor.

Bob Buege

-- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads