Whenever I see several HIGH/LOW etc in a row I suspect Read-Modify-Write issue.
Try inserting a Pause 10 between each row and see what happends. Also make sure you have analog functions (ADC and comparator) disabled on all pins since they will otherwise interfere.
If it doesn't seem to help please also let us know which chip you're using.
/Henrik.
Bookmarks