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

leakage-currentmicrocontrollerpic

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.

Best Answer

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:

enter image description 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:

enter image description here

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.