you could save some pins by using a cmos shift register. power the register through a diode from vcc and add a suitably sized capacitor to keep it powered for long enough after the power goes. bear in mind that you probably don't want the output driving straight into the pic as there is some chance the pic may look like a low impedance load when not powered - I don't think it is specified in the datasheet (protection diodes to vdd usually cause this - not sure about the pic) so better safe than sorry. You could use a pnp transistor and a pulldown to give you the isolation you would want from the pic - shouldn't take any current when not powered. ascii art below: vcc _________ | | | | | |----+---|<---+ | | | | | | --- | | | --- | | | | | | | gnd | | | | | | | | | | / | | 10k |V ---| in out |--/\/\/\--| | | |\ | | | \ | | +-------------- to pic | | / | | \ | | 10k / ---|> clk | \ | | / | | | | | | |_________| gnd you can do a similar trick with more pic pins and less compenents by using a simple tristateable latch. Regards, Simon -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics