PIC18F Limitations
- General Debug Limitations.
- General Programming Limitations.
- The SLEEP instruction cannot be used when debugging.
- The Watchdog Timer (WDT) cannot be used when debugging.
- You cannot view the stack even though you can access it.
- You must connect the AVDD and AVSS pins for the device to program.
- You cannot single step through an interrupt. Due to hardware restrictions, the debugger/emulator cannot jump to the interrupt vector memory location in Single Step mode.
- Breakpoint can corrupt Shadow registers. Shadow register values can be trashed if a breakpoint is set inside a routine where they are used. If you need to use a breakpoint in this situation, store values elsewhere.
- Data breakpoints do not halt on the STKPTR register. The data comparator in the silicon does not have access to the STKPTR register, so breaks on stack pointer will not occur.
- Corrupted value for 16-bit mode TMR1H when single stepping. If you change the value of TMR1H in 16-bit mode, the register should only change when writing to TMR1L, however, this does not happen in Single Step mode when TMR1L is listed in the Watch window.
Since TMR1L is listed in the Watch window, it is being read from the debugger/emulator on every step. Therefore, once you change TMR1H, on the next step, a read of TMR1L is being performed (because it is listed in the Watch window) which overwrites the changed value of TMR1H.
TMR1H is only updated upon a read or write of TMR1L in the silicon. - Trace and Log macros within tight loops do not work when using I/O PORT Trace. The workaround is to use NOP instructions within the loop (EM).