Hi,
I don't see any real issues with the original code which would prevent it from working.
Yes, the TRIS-setting is indeed backwards and setting it correctly is always good practice but HIGH/LOW takes care of it for you so it shouldn't be a showstopper in this particular case.
The situation with define/DEFINE/DefINe/defiNE has been covered many times by now. The actual keyword (DEFINE) is NOT case sensitive, what comes after the keyword IS and that looks alright to me although the OSCCAL shouldn't be needed AFAIK. So, not a problem with that either. Comparator (which has a Connection on GPIO.0) is turned off correctly so not an issue with that either. I can't see any real problem.
My vote is on a hardware issue, perhaps your programmer doesn't release MCLR after programming - if you keep it attached that is.
Which version of PBP are you using?
/Henrik.




Bookmarks