You need to wait until the USART has finished sending all the bits before going to sleep.
The TRMT bit (TXSTA.1) reads 0 (TSR full) while the USART is still shifting out data.
Wait for it to go to 1 (TSR empty) before going back to sleep.
Code:TRMT VAR TXSTA.1 HSEROUT ["Hello World!"] WHILE NOT TRMT : WEND @ SLEEP
Bookmarks