Andrew Warren wrote: > > I wrote: > > > Now tie 12 of the shift-register outputs to one side of each > > thumbwheel switch. Tie all 12 pins on the other side of the > > switches together, run them to a single I/O pin on the PIC, and put > > a pull-down resistor on that pin. Configure that pin as an INPUT. > > .... > > push [a] single "1" bit through the shift-register, applying it to > > each switch in turn. After each [clock], check the INPUT pin; its > > state indicates whether the corresponding switch is open or closed. > > Uhh... A small, but important, correction: > > The above method will only work if there's a PIC-facing diode > between each switch and the PIC's INPUT pin. > > If you want to dispense with the 12 diodes, you need to find a > shift-register with open-collector outputs and invert the 1's and > 0's (that is, fill the shift-register with "1" bits and clock a > single "0" bit through it). > > Such a shift-register DOES exist, but as I recall, it was very > hard to find. I'll go through my notes and see if I can find a > part number (or if anyone else knows of a shift-register with > open-collector outputs, please post the part number to the > list). > > -Andy Hi, Maybe I've missied something, but, is it not easier (no diodes and standard shift-register) to use the shift-register to shift IN the switch positions. In a normal setup the BCD outputs of the switch present a logic 1 or 0. Therefore, if they are connected to the 12 parallel shift register inputs, the value of each input would be serially shifted in. Peter. -- _______________________________________________________________________ Peter Homann email: peterh@adacel.com.au Work : +61 3 9596-2991 Adacel Pty Ltd Fax : +61 3 9596-2960 250 Bay St, Brighton 3186, VIC, AUSTRALIA Mobile : 014 025-925