> I have found that the LED sometimes won't light even with TRIS4=0. > Fortunately, (after much frustration) I have been able to resolve this > problem by setting RA4=0. > > Why is setting RA4=0 necessary for turning on the LED? Jason, RA4 is acting as a low-side switch You have to look at what's happening inside the PIC. Simply speaking, each PIC pin has two output FETs, one from the pin to ground (low-side), the other from pin to Vcc (high-side). When you send a 0, the low-side FET turns on, connecting the pin to ground. When you send a 1, it turns the high-side FET on, connecting the pin to Vcc (not direct connections, there's current limiting) RA4 often doesn't have a high-side FET. So when you send a 1 to the pin, there's no FET to turn on. On the other hand, there is still the low- side FET so sending a 0 turns that on, connecting the pin to ground Look at the I/O section of the datasheet and you'll see diagrams of what's behind the pins. A 0 sent doesn't mean that 0 is what happens, if you get my drift wbr -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist