Sat, 01 Apr 2017, Brent Brown > What was wrong with the idea of turning internal=20 > pull-ups on only while reading switches and=20 > setting port lines to output low the rest of the time? > If reading switches occupied say 0.1% of CPU time > (seems reasonable) power consumption of pull-ups is=20 > reduced by a factor of 1000. I don't believe anything is wrong with keeping one's "input pins" set to "O= utputs" most of the time (switching them to "Inputs" only as needed). Sinc= e I am using DIP Switches to switch the PIC's inputs to GROUND, I would jus= t set the PIC's pins to be GROUND Outputs. There is one caveat to the "let= 's use internal pull-ups" approach: quantity of pins with internal pull-ups= ! In my application, I am using the PIC16F1508, which is a 20-pin PIC. It ha= s PORTS A, B, and C (18 pins), but only PORTS A & B have internal pullups (= 10 pins). For some designs, 10 pins is sufficient, but there are times one= may need more than 10 inputs on the same PIC. =20 I suppose that one could use internal pull-ups on 10 pins and then use 100k= -ohm external pull-ups on the PORT-C I/O as needed. But then we get back t= o the original question, "is 100K too large or just right in a noisy automo= tive environment?" Sure, 1K will solve your noise problems, but the averag= e current draw when the DIP Switches are set to GND is a problem. =20 Sun, 2 Apr 2017, RussellMc apptechnz@gmail.com > I suggest that it would be a very good idea to=20 > write out the requirement again and summarise=20 > the reasons that various key options do not > meet your needs... The concept behind our dialog on this topic is rather simple. There are ba= sically 2 main points to consider: (1) In the application being discussed, there are numerous DIP switches to = be connected to a PIC16F1508 (20-pins total, PORTS A/B/C comprising 18 of t= hose pins). One side of the DIP SW block is tied to individual PIC I/O pin= s, and the opposite side of those DIP Switches leads to ground. Therefore,= we need pull-up resistors, either internal or external, for handle the cas= e of when the DIP Switches are OFF (severed connection to Ground, floating)= .. The use of pull-ups resistors prevents a "floating" state, and they pull= the PIC's input to HI when the DIP is OFF (not GND). (2) We want very low average current consumption ("how low can you go?") wi= th acceptably good noise immunity for 12-volt automotive use. Since the pu= ll-ups draw most of the current in the said application when the DIP Switch= es are closed (connected to GND, pulling current through the pull-ups), the= entire discussion we've been having to date has been about how to reduce t= hat current consumption in a reliable way in light of automotive noise. =20 In my own design, I have been using 100k-ohm pull-ups without problem (= bench testing and testing in one car) in part because the internal impedanc= e (equivalent resistance) of the PIC16F1508 is very large due to it being t= he leg of a FET. On a bench test I was able to confirm proper operation wh= en even 1M-ohm pull-ups are used, with almost no voltage drop measured at t= he PIC input pin side when the DIP Switch is open/floating. The lack of a = significant voltage drop across the large pull-up resistor indicates that t= he equivalent internal resistance of this PIC's Inputs is much greater than= that 1M-ohm pull-up resistor. But while the huge internal resistance of t= his PIC's inputs theoretically allow for the use of very large external pul= lups, we also must consider the noise inherent to automobiles and how that = will affect use of very large external pull-ups. Please review TABLE-1 on = page-2 of the following PDF for the types of noise that can be expected: http://bit.ly/2n8X5JV Will automotive noise accidentally cause one or more PIC inputs to be pulle= d to GND due because the external pull-up is too large? That's really been= the question all along, and thus far we've only had speculation that says:= "Probably, and so it's PROBABLY best to use smaller external pull-ups if i= ndeed external pull-ups need to be used at all."=20 I agree that using 100k-ohm external pull-ups is PROBABLY safer than using = 1M-ohm pull-ups, that too is more speculation than anything in that my own = tests have not been mass-produces and used in thousands of different cars. = Because no one has presented such hard evidence on why a given value of a = pull-up resistor is bad in a car's noisy environment, the discussion then t= urned to "well, why even use external pull-ups at all?" I think that new q= uestion is important, but I still am curious about the original question: = "HOW BIG IS TOO BIG when it comes to external pull-ups on modern PICs like = the 16F1508 when used in 12-volt automobiles?" That's it in a nutshell, Russell. Thanks, James W. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .