I just flailed about for a couple of hours with some really simple code to find my PIC has a couple of bad ports, a new PIC all was well.