Datasheet!
If you Power-On your PIC yet hold MCLR Low, your PIC will be in the Power-On start-up state until MCLR goes high. Port I/O's will be INDETERMINATE. They can be pulled High, or Low or be High-Impedance Input.
Only once you've set TRIS and assigned an initial I/O state, subsequently then when MCLR goes low, the I/O's will REMAIN in the state prior to MCLR stopping the show.
Let me reitterate in case you missed it, if you've never run your PIC following power-on (because MCLR is being held low), you CANNOT guarantee the state of the I/O's.
Read the Datasheet for your PIC.
Bookmarks