# Maximum resistance that can be put in series with an input to a (PIC) microcontroller

EDIT: What is the maximum resistance that can be put in series with an input to the PIC.

Original Question: I am designing a clamping circuit to protect my microcontroller's pins, I need to know the minimum current required by my microcontroller to register input so that I can bias my external clamping diodes properly, without risking normal operation of my microcontroller.

Edit: Microcontroller is to read digital inputs in an EMI and ESD prone environment and I want to clamp both negative and positive voltages in the range of about -0.3V to (VDD + 0.3V), this range is provided in the datasheet under Electrical Characteristics.

I am using this PIC24, I think this has something to do with leakage current but I am not sure.

• would you clarify what you need the clap to do? Are you trying to ensure the PIC24 pins when acting as inputs will not be damaged by an external voltage less than ground, and greater than its power supply? Or greater than 5V? To be clear, you are not trying to protect the pins from an external voltage when they are acting as outputs? So you are seeking to maintain the current from an 'out of range' voltage to within the margin that the pin's internal protection diodes can handle? What range of voltages are you intending to clamp? Commented Aug 9, 2014 at 14:59

I think what you want to know is the maximum resistance that can be put in series with an input to the PIC.

Let's suppose that you're happy with TTL levels of noise immunity (400mV). The minimum voltages for an input to be accepted as a logical 1 or 0 are defined here:

Excepting the PMP, the lowest difference from the supply rails is Vil which can be as low as 0.2 * 3V = 0.6V. Subtract 400mV from that and we get 200mV. That's the maximum voltage that can appear across a series resistor to the input. If you want to use the PMP pins, it's 0.15 *3V = 450mV.

Now refer to the leakage table on the next page of your datasheet:

Without worrying about all the distinctions here, if the temperature does not exceed 85°C (should be junction temperature not Ta, I think), then the current will not exceed 1uA.

So the maximum resistor you should put in series can be found from GS Ohm's law- 200K. With such a large resistor you'd probably also want a small cap like 1nF to ground on the input or an RC of 1K series with the input and any size of capacitor you like between the 200K/1K junction and ground. With the PMP pins, the value goes down to 50K.

• Thank you, this is exactly what I was looking for. I have a few questions, why do you suggest adding a capacitor to ground? And what is TTL levels of noise immunity? Commented Aug 9, 2014 at 15:55
• The capacitor is because a resistor more than a some tens of K ohms may allow noise to be picked up. The capacitor will form a low pass filter and help prevent that. By TTL level of noise immunity I mean the 400mV that TTL logic is guaranteed- which means that the input voltage will be lower than the maximum to be recognized as a logic '0' by at least 400mV, and will be higher than the minimum to recognized as a logic '1' by at least 400mV. It's just a number picked to be reasonable and achievable. Commented Aug 9, 2014 at 16:02
• Note that frequency response will be affected by high R values. Adding a cap at pin will further reduce it. Whether this matters in you application is TBD. | Note that ADc readings may be affected by any pin excursion outside Vss-Vdd range. | This data sheet is harder than many to be sure of what is intended on all pins. Abs max is 0.3V outside supplies AND elsewhere they do seem to be allowing 0.3V outside supply rails during normal operation. On many processors the operating range allowed is 0V with say 0.3V being in the will live but may walk funny section. Commented Aug 11, 2014 at 13:02