I used this technique (transformer secondary driving full wave rectifier driving RB0 through a current limit resistor) in several thousand units based on the 16c74. It stopped working when I went to the 16F74. I ended up adding an NPN transistor between the current limit resistor and the RB0 input and reversing the edge I detected interrupts on. So, many people on the list do not like the high voltage through current limiter approach, but I found it seems to work on the 16C74, but not on the 16F74 or 18F452. While the ideal design has zero parts, I'd add the necessary parts to keep the input from going outside the Vcc to GND voltage range. Harold ==============original message============================== Hello, I'm thinking about this: input-------100K-----PICinputpin I know the PIC (I'm now using PIC18F452) input pins (except RA4) have two diodes for input voltage clamp protection. But I can't find on the datasheet more detailed informations about those diodes. The PIC18FXX2 datasheet says: Voltage on any pin with respect to VSS (except VDD, MCLR, and RA4) ....................................... -0.3 V to (VDD + 0.3 V) PICREF-4 (PICDIM Lamp Dimmer for the PIC12C508) says : "R9 is connected to the "hot" lead of the AC power line and to pin GP4. The ESD protection diodes of the input structure of the GPIO allows this connection without damage (see Figure 1). When the voltage on the AC power line is positive, the protection diode from the input to VDD is forward biased, and the input buffer will see approximately VDD+0.7 volts and the software will read the pin as high. When the voltage on the line is negative, the protection diode from VSSto the input pin is forward biased, and the input buffer sees approximately VSS-0.7 volts and the software will read the pin as low. By polling GP4 for a change in state, the software can detect a zero crossing." So I would assume the diodes have a 0.7V voltage drop, but is this enough to protect the PIC input pins if the maximum pin voltage is "-0.3 V to (VDD + 0.3 V)"? Also, I can't find anywhere how much current those pins would support. I plan to connect a PIC pin to a transformer (aprox 30VAC) output with a 100K resistor to detect frequency. I have done it before using external protection diodes, but I'm thinking about doing it the simplest and cheapest way. Best regards, Brusque -- ----------------------------------------------------------------- Edson Brusque C.I.Tronics Lighting Designers Ltda Research and Development Blumenau - SC - Brazil Say NO to HTML mail www.citronics.com.br ----------------------------------------------------------------- -- 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 ________________________________________________________________ The best thing to hit the internet in years - Juno SpeedBand! Surf the web up to FIVE TIMES FASTER! Only $14.95/ month - visit www.juno.com to sign up today! -- 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