Sorry, that was misleading; the serial data is being sent to the PC just for checking the hardware; while doing the ICD compile, I rem out the debug statements and close the terminal before running ICD.

I am using the internal oscillator, so I presume the default would be 4 MHz.

Yes, I've defined the right com port.