kerri wrote: >>>This is about the inputs, I have seen in the datasheet that after >>> >>> >power-on > > >>>all the TRIS registers are set as inputs. So what is the recommended >>>practice, I suspect unused pins should be left as inputs, isn't that why >>>they are reset to inputs in the first place? >>> >>> >>> >>> >>They are set to INPUT at reset so that the chip isn't damaged by >>something driving the >>pin at power up. >> >> > >Sorry, but what do you mean "something" ? > > Assume for the moment that your PIC design has a credit card reader attached at your PIC's pin RB0. The card reader is an output. If the PIC powered up as an output as well, either the PIC is damaged by the credit card reader, or the credit card reader is damaged by the PIC. MAYBE they won't be damaged... but we engineers don't tolerate things like that, it is not good practice to hope things aren't broken by just powering them up. > > >>>Secondly, what is the recommended procedure with unused pins, to >>>leave them alone, or to connect them to gnd or something, don't they >>>have a week pull up/down internally anyway? >>> >>> >>> >>> >>Assign unused pins as OUTPUTS usually at GND level. You can assign a >>weak pullup, >>but they are normally just floating... >> >> > >Sorrry, what do you mean "they are just floating" > > Inputs are just inputs, and they are unconnected to either rail. Sorry, no pullups at powerup. You're thinking of motorola stuff, they have small pullups everywhere. But not PICs. >Are they floating because of a pullup, or because a pullup is weak, >or something else - sorry you have completely lost me now. >which pullup? > > They are "floating" because they are not connected yet. They might float low or float high. But when they hang around the middle, they draw a LOT of current. > > >>>And why would touching an input would have any effect on the pic, >>>unless there is some firmware which is monitoring these pins, which >>>there isn't, I can't see why this could possibly be the reason, and >>>maybe it is a capacitance issue, i.e normal expected behaviour? >>> >>> >>> >>> >>Your body has about a 100K to 1M resistance to GND. But more important, >>your >>body picks up stray electric fileds, such as flourescent lighting etc. >> >>I know of a PIC design that uses the fact that the human body effects >>pins WITHOUT >>TOUCHING them (just being closeby). The RC time constant of the design >>is changed >>by the presence of the finger, and is detected by the PIC. Take a peek at >>http://www.bytecraft.com/touchsw.html . >> >> > >ok, this is interesting (perhaps), but how does it help me to understand if >touching >my pic should have an effect or not under proper design. Am I the only one >in the world who has noticed that (and became a tadd concerned)? > > > When all the inputs to the PIC are handled properly, low impedance pullups, etc there will NOT be this effect. Yes, you should be concerend. You need to fix that problem. But you'll discover it. --Bob -- Note: To protect our network, attachments must be sent to attach@engineer.cotse.net . 1-520-850-1673 USA/Canada http://beam.to/azengineer -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist