I like to set the IOs right after the configuration registers (fuses).
That way you are sure what the chip is doing while everything else is settling in.
Give it a try...
I like to set the IOs right after the configuration registers (fuses).
That way you are sure what the chip is doing while everything else is settling in.
Give it a try...
Dave
Always wear safety glasses while programming.
Hi,
Looking at table 3-2 in the datasheet you can see that the default state of PortC (and the other Port regsiters) is unknown at power up, so one pin being high and another low is to be expected. If you need them to be in specific states when powering up you need to make sure to set them. However, you might considder setting PORT before TRIS - otherwise there might be a short pulse on the output between the output driver being turned on and actually being set.
/Henrik.
As it turns out, the issue was actually coming from a combination of code and the unpredictability of an external IC the PIC is interfaced to. It appeared as if it was occurring at power-up, but a carefully placed pause statement illustrated otherwise. I've modified the code as per your suggestions anyway as they seem like good practice. Thanks Dave and Henrik for the tips.
Regards,
Troy.
Bookmarks