8-bit Device Limitations - PIC18F
Last modified by Microchip on 2023/11/09 09:10
Contents
PIC18F Limitations
- Debug and Programming Limitations - PIC® MCUs
- 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 the 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 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).
PIC18F Extended, PIC18FXXK Limitations
PIC18F Extended refers to a PIC18F MCU with an extended instruction set. Consult your device datasheet to see if your device has this feature. These have the following limitations:
- Debug and Programming Limitations - PIC® MCUs
- 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 cannot single step through an interrupt. Due to hardware restrictions, the debugger or emulator cannot jump to the interrupt vector memory location in Single Step mode.
- Breakpoints 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 the stack pointer will not occur.
- Compare output zero after the program halt. For all CCP/ECCP modules, any compare operation followed by a program halt results in the CCP pin going and staying low. Capture and Pulse Width Modulation (PWM) are not affected.
- Capture generates a false interrupt on Run after Halt. A false interrupt is generated when (1) Freeze Peripherals on Halt is enabled and (2) Capture is configured to trigger on the rising edge and capture input is high, or Capture is configured to trigger on the falling edge and capture input is low.
- Trace and Log macros within tight loops do not work when using IO PORT Trace. The workaround is to use NOP instructions within the loop (EM).
PIC18FXXJ Limitations
Headers are available but optional for debug when using these devices. See the “Processor Extension Pak and Debug Header Specification” for details.
- Debug and Programming Limitations - PIC® MCUs
- The SLEEP instruction cannot be used when debugging unless the device is set to Break on SLEEP Instruction (Debugger > Breakpoints, Event Breakpoints).
- The Watchdog Timer (WDT) cannot be used when debugging unless the device is set to Break on Watchdog Timer (Debugger > Breakpoints, Event Breakpoints).
- You cannot view the stack even though you can access it.
- 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. Store values elsewhere if you need to use a breakpoint in this situation.
- 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.
- Configuration bit values are incorrect for a code-protected device. For these devices, configuration bits are part of program memory. Therefore, on code-protected devices, configuration bits will read as zero even if values are entered in MPLAB X IDE.
- Do not step over an instruction that clears INTCON:GIEL and GIEH. If you do so, the GIEL and/or GIEH bits will not be updated with the cleared value and the previous value will be kept. E.g., For stepping over BCF INTCON,GIE will not stop interrupts. However, stepping over BSF INTCON,GIE will turn on interrupts. This is to prevent single stepping from always vectoring into interrupts. Setting a breakpoint past the clearing of the interrupt and running is a good workaround.
- SPI Trace is not functioning as expected. For the PIC18F46J50, PIC18F46J11, and other similar devices, SCK/SDO is on RB4/RC7 and not RC3/RC5 or RB1/RC7 as usual. Therefore, the SPI trace does not function as expected.
- Only one data capture resource is available. Although three or five breakpoint resources are available for these devices, only one data capture resource is available for use. (EM)
- Trace and Log macros within tight loops do not work when using IO PORT Trace. The workaround is to use No Operation (NOP) instructions within the loop. (EM)
Freeze on Halt Limitations
- Peripherals are frozen while halted and single stepping.