>From: "William J. Kitchen" > The safest thing to do is to tie all unused pins to either ground or the posit ive supply voltage using resistors William is right. That's the safest thing to do. In addition to the safety against misprogrammed TRIS bits, there are are two other advantages to setting them as inputs and tieing them low. First, at reset, the pin WILL be an input until you program it otherwise. I know, setting up TRIS is the first thing you do in your program, but how long is the chip in reset from Vdd on until the program runs? Power up timer, etc, adds up. During that time, the pin condition is undefined. If something (stray capacitance, dirty PCB, "cosmic rays", etc...) tends to pull the pin into the invalid voltage range, the input buffer will draw excessive current for some time. If you reset the chip a lot in your application, and or its a battery powered system, this could add up to shorter battery life. Plus, its icky :). Second, the current consumption for an enabled output driver even with no load, may be slightly higher than an input tied low. (Due to leakage in the large driver FETs, I think.) Emphasis on *slightly*. I'm not sure the difference is significant at room temperature, but might be more so across the temperature range. The Microchip specifications for shutdown power consumption are for the case where all I/Os are set as inputs and tied to Vdd or Vss. This gives the lowest possible quiescent current. For experimental boards, I leave unused pins unconnected and program then as outputs, set low, so its easy to prototype new hair- brained circuits. But in production boards, I set them as inputs and tie them low (via resistor packs) if possible. If board space or cost are so critical you can't afford the resistors, then leave them as outputs set low, subject to the (probably slight) disadvantages. ------------ Barry King, KA1NLH Engineering Manager NRG Systems "Measuring the Wind's Energy" Hinesburg, Vermont, USA www.nrgsystems.com ------- End of forwarded message -------