PIC Input Pin voltage question - Page 1
Forum section: electronics / projects

author: hobbyelectronics
author_rank: Regular Contributor
timestamp: February 15, 2021, 03:11:15 pm
content: Hi,Just a simple question really.If on a PIC MCU (PIC12F1572) one of the pins (RA1) is set to an input, with the pullups disabled but pulled up externally to 5V (VDD) via a 10K resistor, what voltage would you expect when measured at the pin and why?Thank youJohn

author: Ian.M
author_rank: Super Contributor
timestamp: February 15, 2021, 03:19:06 pm
content: 5V. Input leakage current should be 1uA or less, so there shouldn't be more than 10mV across the resistor due to it. However if you use a DMM with 10Meg input impedance it will drag the input down by approx another 5mV. Both sources of error are negligible compared to the likely tolerance of the 5V supply.

author: hobbyelectronics
author_rank: Regular Contributor
timestamp: February 15, 2021, 04:25:12 pm
content: Ah, that's what I was expecting to see, 5V, but I always measure 0.7V not matter what. All though when I read the value with code I get a high and if I pull the input to low I read a low as expected. but with a fluke meter I read 0.7VIts as if another function or something on that pin is turned on or something, but can't seem to figure it out. If I apply the same thing to another input I measure the 5V as expected but on RA1 I measure 0.7V, with only that one 10K resistor tied up to 5V.Uhmmm, back to the data sheet to double check every thing is configured as it should be.Thanks

author: Ian.M
author_rank: Super Contributor
timestamp: February 15, 2021, 05:00:55 pm
content: Try erasing the chip, which should leave it with external /MCLR enabled. If at all possible, put the chip in a breadboard (so you know for sure nothing else is connected), connect Gnd and Vdd and tie /MCLR to Gnd to hold it in Reset. If its a SMD part, check for anything on the board that may be pulling RA1 down, and once you are sure that nothing external is connected to except for the pullup, tie /MCLR low.All I/Os should then be tri-state and a 10K pullup on RA1 should get you 5V on that pin. If it doesn't the chip is damaged.N.B. most Microchip programmers have pulldowns on some of their ICSP pins and also may heavily load ICSP pins when not powered by USB so make sure the programmer is physically disconnected!

author: hobbyelectronics
author_rank: Regular Contributor
timestamp: February 15, 2021, 06:14:06 pm
content: OK, all fixed. Thanks for your help.I tried everything, but ended up changing the chip, which was an SMT device so had to pick up my hot air iron from work.Replaced the chip and reprogrammed, everything now working as expected.Must have had something very strange going on with just that pin, because it still read correctly with a high or low, but just always measured 0.7VI reprogrammed the old one first but it made no difference.Anyway, all good nowThanks

author: Ian.M
author_rank: Super Contributor
timestamp: February 15, 2021, 08:11:43 pm
content: I'd bet on an ESD zap causing it to leak to ground. If you are in northern hemisphere winter at the moment, cold dry weather can result in very low humidity inside properly ventilated heated buildings so ESD damage becomes far more common.