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 you will find snippets of working code that will help save you time. Please help add to our collection of examples by contributing code that you have written.
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!
...