grounding unused inputs
David VanHorn email (remove spam text)
>I would agree with your reasoning above *if* I set the TRIS registers only
>at the start of code and never touched them again. But I consider that to
>be bad practice. I refresh all important registers regularly, usually in
>the routine that looks after the watchdog timer. In fact, I will often
>*read* the registers to make sure that it is what I expect them to be,
>rather than just refreshing them. If I get a nasty transient that is
>enough to disturb the TRIS or INTCON registers, I figure that I had better
>re-init everything anyways. So: I configure un-used pins as output and set
I see what you mean here.
On the AVR or Z8, this isn't a problem because the tris-equivalent
registers can't be modified by inputs like this. I can easily output a 1
into a short to ground (pointless but harmless) and the chip won't decide
to change it on me.
I think the PIC architecture puts a larger burden on you to protect the
processor from output forcing in your designs.
It's an interesting design wrinkle though, that your output bits could be
changed on you at any time. That, plus the weaknesses in the BSF/BCF
instructions wrt pin loading, argue twoard the shadow register approach for
the port registers.
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email mitvma.mit.edu with SET PICList DIGEST in the body listserv
In reply to: <email@example.com>
See also: www.piclist.com/techref/microchip/ios.htm?key=input
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the