Henrik, I'll try that suggestion later and let you know how I get on. The chip is an 18F4520