The value depends on the circuit, especially if there also is capacitance a= nd=20 frequency involved. Since you need a pull-up, the driver is only driving the input low, for exa= mple=20 an open colector/drain transistor output in some sort of digital sensor. Th= e=20 resistor is then responsible of pulling the input high after the transistor= is=20 switched off. If there is some capacitance in the circuit, it will take som= e=20 time for the voltage to raise to a high input level. The higher the resisto= r,=20 the longer the time. If the output varies with a high frequency then the=20 resistor needs to be low enough to pull up the input fast enough. I2C is a good example. Since this can operate at 100kHz or higher, a relati= vely=20 low value resistor is needed. Another example is a 1-wire interface which=20 operates with pulsewidth in the us region. If you, on the other hand, are going to monitor a button relatively close t= o=20 the PIC, a 27k resistor or even higher for a battery operated circuit, woul= d be=20 fine.=20 Another factor to take into account is noise. If you have relative long wir= es=20 connected to an input and too high value for the resistor, the input might= =20 become sensetive to radiated electromagnetic noise. I always try to use as high value as possible for the given circuit in orde= r to=20 draw as little current as possible when the input is driven low.=20 /Ruben >=20 > -----Original Message----- > >From: Allen Mulvey > >Sent: Apr 3, 2013 12:46 PM > >To: PIC List > >Subject: [PIC] Pull Up Resistors > > > >Sorry, this is my first post. I forgot to tag the subject > >line. > > > >=20 > > > >Is there a way to compute the optimum value of pull up (or > > > >pull down) resistors on PIC digital inputs? > > > >=20 > > > >Most example circuits I have seen seem to use 10k. My > > > >EasyPIC7 board uses 4k7. I have been experimenting and 20k > > > >resistors produce unreliable results. I don't see anything > > > >in the data sheet to help with this.=20 > > > >=20 > > > >I am using a pic16f877a. The leakage current is one > > > >micro-amp. Sampling the port must draw considerably more. My > > > >current project is not battery operated but, if it were, I > > > >would like to use the largest resistors possible. > > > >=20 > > > >Thanks, > > > >=20 > > > >Allen > > > >=20 > > > >--=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 >=20 >=20 > --=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 >=20 >=20 > ----- > No virus found in this message. > Checked by AVG - www.avg.com > Version: 2013.0.2904 / Virus Database: 2641/6215 - Release Date: 03/30/13 >=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D Ruben J=F6nsson AB Liros Electronic Box 9124, 200 39 Malm=F6, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D --=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 .