Hi,

As usual after trawling the net, and data sheets for many hours, I have found the answer only 10 mins after posting.
When programming disable low voltage programming mode, and something called CPD also off.

I have never understood why things default to a state which makes pins unusable as GPIO, AD converter, CMCON.7. Surely it would make sense to turn features on if you want to use them, rather than having to turn off anything you don't want.

Regards
Bob.