Hi,
You don't say which PIC you're using so it's hard to check but it's probably a peripheral, like ADC, comparator or something else that is interfering with the port operation when used in digital mode. Check the datasheet regarding what functions are multiplexed onto the pins being used and if anything needs to be turned off.
/Henrik.
Bookmarks