On Thu, 4 Jun 1998, Stuart Allen wrote: > Hello, > > I have a battery powered design using 16C84. I need to be able to read a > keypad, this requires 3 inputs. The design will spend a lot of time asleep. > Long battery life isn't critical, but I would like to extend it as much as > possible. > > These inputs must be pulled up to 5v. I could use the weak pull-ups, but the > other pins on port B are inputs, and I would rather not pull them up. Also, > I think that it will be more economical (in terms of power consumption) to > just pull those 3 pins. > > However, there is no reference of the input current required to pull-up a > input pin in the PICs specification. It mentions that the port B pull-up > current is typically 250uA, so if I divide by 8 pins I get 31.25uA. So > should I pull up each port with 160K (5/31.25uA)? Or is the 250uA per pin, > not for the port? Maybe is it completely wrong to use this value? PTM: It depends.. If you have very capacitive keypad and you try to read it very fast, you got to use small resistors. The same goes with long cables: they are very 'capacitive'. If you can give some time to the keyput input to stabilise, you can use large resistors. PIC has inbuildt resistors of about 50k that you can set active. I have used them to pull up a keyboard with rather good speed. Another way is to use these inbuildt resistors and cut them off and set the port as input when you don't read the keys. It is enough to read keys about 10..20 times / sec. That leaves enormously time to go and have a cup of coffee between read periods. -------------------------------------------------------------------------- PTM, pasi.mustalahti@utu.fi, ptmusta@utu.fi, http://www.utu.fi/~ptmusta Lab.ins. (mikrotuki) ATK-keskus/Mat.Luon.Tdk OH1HEK Lab.engineer (PC support) Computer Center OI7234 Mail: Turun Yliopisto / Fysla, Vesilinnantie 5, 20014 Pt 02-3336669, FAX 02-3335632 (Pk 02-2387010, NMT 0400-555577) --------------------------------------------------------------------------