Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:27 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Digital Input Pins

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 03:32am 01 Jun 2018
Copy link to clipboard 
Print this post

Reading the 470 data sheet, I came across the following in Chapter 12 - I/O Ports:-

  Quote  Pins configured as digital inputs do not convert an analog input. Analog levels on any pin defined as a digital input (including the ANx pins) can cause the input buffer to consume current that exceeds the device specifications.


From this, do I understand correctly that it is recommended when using a pin as DIN, that it should be pulled either high or low with a pull up/down resistor?

So if the DIN pin is looking for an active low, the pin should have a pullup resistor or if the DIN pin is looking for an active high, it should have a pulldown resistor?

Would the weak pullup or pulldown internal resistors do the job?

panky

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 06:30am 01 Jun 2018
Copy link to clipboard 
Print this post

I wish someone in Microchip would settle this once and for all. Yes, they do say that in the datasheet and it sounds dire BUT on pages 19 to 25 they state that all inputs are "Schmitt Trigger input with CMOS levels" and that means that the inputs can accept indeterminate input levels.

I know that older chips with normal input buffers can suffer from the issue described and that is why people automatically warn against letting microcontroller inputs float. However the PIC32 is a modern chip and uses Schmitt Trigger buffers. Hopefully someone with knowledge of the PIC32 input buffer configuration can jump in here.

To settle this I once connected a number of digital inputs in parallel to an analogue voltage source and varied the level across the full input range while accurately monitoring the current drawn by the chip and the inputs. Regardless of the input voltage the current drawn did not vary by more than a hundred microamps and that is a sure indication that damaging currents are not occurring.

I am sure that Microchip would not say something like that without reason but I am damned if I know what it is. If you are concerned you can set unused I/O pins to digital outputs or use the internal pullup/pulldown resistors on floating inputs - it does not hurt and will help protect against static discharges.

Geoff
Edited by Geoffg 2018-06-02
Geoff Graham - http://geoffg.net
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 01:36am 02 Jun 2018
Copy link to clipboard 
Print this post

There are no hard and fast rules, a lot depends on the gate thresholds of the mosfets within the device, and the supply voltage, as well as the "on" resistance of the particular mosfets. As mentioned above, sometimes internal feedback as in a Schmidt trigger is involved.

In some cases we need to deliberately bias a digital device right into the centre of the linear region, as in many types of oscillator circuits, particularly crystal oscillators, and the chips work fine.

Always wise to read the application notes for the particular device very carefully.

Cheers,  Tony.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025