The important part is to set the PORT (or LAT) registers BEFORE setting the TRIS registers to outputs.
Otherwise the pins will be in output mode for a period of time but the outputs aren't specified.
Here is an example of a neat little solar panel tracker that I built for a NiMh battery charger. I decided to build it for a variety of reasons - - -
...
Re: I/O Pin status during startup
Greetings all,
PaulMaker Today, 09:21first of all, thank you so much for all your help.
I tried moving the port settings before the Tris statement like you recommended and it worked!
...