At 22.49 2005.02.23 +1300, you wrote: >> I fully agree that the proper way to deal with unused pins is to set >> them as output and leave them unconnected. If something else than >> the program changes the TRISx registers, then I think that we've got >> a much more serious problem anyway.. > >The trouble is that the level of sophistication built into a product is >probably going to be optimal, perhaps for economic or practical >reasons > >If someone happens to place one of your control boxes right next to >a radio transmitter or a noisy relay bank, which you might not have >foreseen them doing, and it goes ape, do you then have to think about >putting "Do not put next to transmitters or relay banks" stickers on ? >Or blow the budget by changing from a plastic to a metal box ? Or >add things like tying resistors so unwanted external noise can't make >it go ape ? > >Obviously every product is different in its design, cost restrictions and >how important it is for it not to go wrong and the consequences if it >does, but it pays to at least consider risk management. Both of the above >instances happened to my products. Recalling units and adding literally >a couple of cents worth of resistors and a bit of aluminium foil made >them so much less susceptible to future problems and, touch wood, >they've all behaved themselves for some time now > >To quote a list member's signature, which I keep in the back of my mind >with everything I do, > >"There's never enough time to do it right - there's always enough time >to do it again" Ok, but specifically, why should this RFI only change TRISx and not a GPR with even more catastrophic consequences? That's why I say that unused pins can be left unconnected and set as outputs.. because if TRISx changes, chances are that a lot of even more "delicate" GPR's have changed already. Metaphorically, what's the real usefulness of a parachute in a submarine whose only serious risk is to sink? Sure, the parachute will help in case an UFO picks up the submarine and then drops it from 10000 ft altitude.. but I think that adding a resistor to every unused pin is almost as useless as above.. On a 18F8720 we have almost 4K of GPR's that may be changed by EMI/RFI, and only a few of TRISx registers. I would concentrate my efforts for reliability elsewhere than on the lone TRISx.. And about the firmware/software, well.. while I don't think to produce bugless code all the time, I'm extremely confident that I won't write a routine that changes TRISx improperly for no reason.. One thing I've always believe in, regardless of TRISx issues, is to debug code also *before* you notice any bug. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist