When I read Mike's suggestion about a simple 8-bit shift register, I thought up a way to use a simgle pin to control a '165. Not being good at drawing ascii schematics, I whipped up a quick schematic and converted to Acrobat format (about 11k): http://www.geocities.com/SiliconValley/Haven/9004/one_pin.PDF To load the shift register, drive the PIC pin low for a couple seconds, which causes the cap to discharge through the 1 meg resistor. The '165 will not shift data while the /LD pin is low, so drive the PIC pin high for a couple seconds to charge up the 1UF cap. I don't think rise time would be a problem, as the DIP switch states remain constant. To shift data from a '165, you need a low-to-high transition on the CLK pin(s). Drive the PIC pin low, wait a couple instruction cycles, then drive the PIC pin high again. After a couple NOP's, make the PIC pin an input, and read the state of the pin. Repeat eight times to shift all switch states. Note that a closed switch will be read as logic high because of the transistor invertor. The 1N4148 diode provides a discharge path for the cap when power is removed. All resistor values probably need tweaking to optimize the circuit. I have not tried this. Seems like it should work, though. Anyone care to comment? Dave Sorlien Rigby-Jones, Michael [PAI01:4837:EXCH] wrote: > I've only just joined the list so this has probably been suggested, > but if external components are ok, then why not use a simple 8-bit shift > register and an 8 way DIL switch with ascociated pull ups? On the PIC this > would need one output for clock,one input for data and most likely 1 output > to reset the shift register. Admittedly you don't actually require 256 > values, but 8 way switches and shift registers are the most common. > > Mike Rigby-Jones > > >I've got a few 12C508 around right now but I dont have any 16x84's > which is > > >why I was just trying to use the 12C508 chip. If anyone has any ideas on > > >implementing a way to assign the 12C508 chip an ID (1 ~ 80) through > > >external circuitry which the chip can pick up during its program > > >initialization stage, I would like to hear it. > > > > > >Thanks! > > > > > >Shahid > > > > > > > >