Hi,

If an interrupt occurs while the DEBUG statement is busy outputting data it will, as the mechanism name implies, be interrupted and since it's a bitbanged software timed routine its timing will be off which in turn means garbage data.

Either use the USART ("manually" or with HSEROUT) to send the data or make sure to turn off or mask the interrupts WHILE the DEBUG statement is executing.

/Henrik.