Just for the record, the problem is now "solved". For some reason, RA0-RA2 did not work as inputs. They interfaced bad with any output-port on the 16F887. I found this out by manually "hijacking" the datalines and cross coupled the (not) intended ports, and found that test #1-3 did not work under any circumstance when connected to RA0-2, but flawlessly when connected elsewhere. Tried to change the IC in case it was damaged, but I got the same weird behaviour on other chips as well. So, I moved RA0-3 to RC1-3. Works as a charm, but I have no clue as to why RA0-2 didn't work as inputs, despite comparators/vrefs/analogs etc turned off. -- - Rikard - http://bos.hack.org/cv/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist