Hi Charlie,

Yes I have other parts of the code to develop, and whilst it would be a nice function to have, I can live without it if I must.

To prove it wasn't a duff chip or hardware issue with the USB port on the EasyPic5 board I downloaded the USB Demo example (Mr E's) and stuck a 4mhz resonator in the board - it ran fine and I could toggle the LEDS on portB from the PC application. I then swapped the resonator for a 20 mhz xtal and set the fuses in the programmer accordingly and tested again - it ran sweetly. So the issue is with the code, and I have no reason to doubt DT's explanation.

Thanks for the comments

Malcolm