NEIL GANDLER wrote: > > In a an automotive powered circuit I am designing. I am concerned about > interfacing a switched positive power rail to an I/O port. For example. > When a stereo system provides a switched 12vdc rail, I want the PIC > to sense this, a very easy task. I assume I could simply use a > 2 resistor-zener diode circuit to bring the 12v to 5v. Would such a simple > circuit provide the spike protection required to protect the pic? > I would appreciate any advice on interfacing such a power rail > to an I/O port. Thanks. You don't need a Zener diode, a large resistor is sufficient. The port-pins of the PICs have protection diodes to Gnd and Vcc. You only have to ensure, that the current is lower than (I am not sure) 100 Micro-Amps. There is an application note by Microchip, that tells something about that. They even connect the PIC to 120 VAC. Wolfram -- +-----------------------------------------------+ ! Wolfram Liebchen, liebchen@ipserv.ffo.fgan.de ! ! Forschungsinstitut fuer Optik ! ! Schloss Kressbach ! ! D-72072 Tuebingen ! ! Tel: +49 (0)7071 / 709-158 ! ! Fax: +49 (0)7071 / 709-270 (G3 / G4) ! +-----------------------------------------------+