Current on I/O pins

Current on I/O pins


Let us consider a scenario where the external voltage of example 12V to be read by the micro controller and the micro controller has 5V tolerant pins. So, the 12V has to be dropped to 5V or less before applying to the digital input of the micro controller. To achieve voltage drop, a simple resistive divider network has been used as shown above. While, the divider network is simple to use, there arises a question whether 12K resistors or lower to be used for resistive divider or resistors in the 100M to be used? This brings us to a discussion on how the Digital input pin behaves.

The Digital input pin is actually a voltage driven pin and has very input impedance which meant the current input to this pin shall be in uA or nA. The designer has to more focus on his voltage and worry little about the current. While current input is very less there shall be some current flowing into the pin which is called a leakage current. This leakage current is due to the capacitance associated with the pins and this current helps charge this capacitance.

For example, if we take the MSP432P401R, the leakage current indicated in the datasheet is as below:


MSP432P401R being a low power micro controller has a ultra low leakage of 20nA and some of the micro controllers shall have around 1uA also. Another commonly used micro controller by hobbyists has leakage current of 4uA.


Another example below from SAM C20 datasheet which has leakage current of 1uA .


So, which configuration is best? 12K or 100M?

While both the scenarios are ok to use for a digital input configuration, the 12K case is the most preferred as it causes input capacitance to charge quickly and achieve the required voltage at input quickly and hence saving few sampling cycles while reading the input. This is very important in time critical applications. Now, by using 100M there shall be very less current flowing from source and capacitor charges very slowly. During this time any external noise causing variation on the input pin can cause erroneous read. So, from EMI perspective also 100M is not the choice. The only criteria which helps to use 100M is the battery powered application where the desired power drain is very less. So, for battery applications it is desired that 100M shall be used and to aim little higher current a value less than and around 100M is a suitable option for battery powered application. For normal application 12K is the best choice.

Pull-up and Pull-down current specification:

In the datasheets, we also see another specification pull-up and pull-down resistor specification as shown below (this is from SAM C20 datasheet):


If the pull-up voltage is 3.3V, then the minimum pull-up current is 3.3/60k = 55uA. This is the current required to drive the pin LOW as the pin is already HIGH due to pull-up. While this specification is also input pin current but internal to the micro controller, this must not be treated as the input pin current. Designers need to understand this point while working on their designs.

Post a Comment

0 Comments