Allen Mulvey wrote 2013-04-03 19:46: > Sorry, this is my first post. I forgot to tag the subject > line. > > > > Is there a way to compute the optimum value of pull up (or > pull down) resistors on PIC digital inputs? > No, there is not, for the general case. For specific cases (such as pullups for I2C lines) there is. But we don't know anything about your specific case. It could be a unusual noicy environment. :-) > Most example circuits I have seen seem to use 10k. My > EasyPIC7 board uses 4k7. Both are popular "junk-box" and "lab-set" values. :-) > I have been experimenting and 20k > resistors produce unreliable results. It should work perfectly well, in the *general* case. We don't know what was special in your specific case. > I don't see anything > in the data sheet to help with this. No, there can't be since "it depends" on things that Microchip has no way to know in advance. > > > I am using a pic16f877a. The leakage current is one > micro-amp. Note that for a modern PIC (16F1938) it's 5 nA (typ) and 125 nA max @ 85 degC. It's time, not only for this reason, to take a 15 year leap forward. :-) Anyway, 100 kohm at 1 uA only give an voltage drop of 0.1 V, so that isn't an issue. > Sampling the port must draw considerably more. What is "sampling the port" ? Reading from the port? Reading the PORTx register doesn't "draw" anything. > My current project is not battery operated but, if it were, > I would like to use the largest resistors possible. > Without knowing anything else about the curcuit, I'd say that 100 kohm would not be any problem. Probably several 100's kohm also. On a modern PIC one could probably use a few Mohm's. Not in a noicy environment, but in the general case. Then you have to add any specifics about your application that we can't know anything about into the equation. Best Regards, Jan-Erik. > > > Thanks, > > > > Allen > > > --=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 .