8-bit Device Limitations - PIC18F

Last modified by Microchip on 2023/11/09 09:10

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).

Back to Top

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).

For PIC18F4553 Only

  • Serial Peripheral Interface (SPI) Trace does not work. There is a silicon errata (DS83023) that reports a problem with SPI (EM).

For PIC18F87K90 Only

  • You cannot enter Debug mode when the power-up timer is enabled. If you are not able to enter Debug mode when the power-up timer is enabled for the following devices, please disable the power-up timer during the debugging session. (If the final application firmware requires the power-up timer to be enabled; please enable it after the debugging session is complete and program the part with the final application firmware.)
    • PIC18F4620/4610/2620/2610
    • PIC18F4680/2680/4681/2681
    • PIC18F4520/4420/2520/2420
    • PIC18F4550/2550/4455/2455
    • PIC18F8490/8410/6490/6410/8390/8310/6390/6310
    • PIC18F8722/8627/8622/8527/6722/6627/6622/6527
    • PIC18F2525/4525
    • PIC18F87K90/PIC18F86K90/PIC18F85K90/PIC18F67K90/PIC18F66K90/PIC18F65K90
    • PIC18F87K22/PIC18F86K22/PIC18F85K22/PIC18F67K22/PIC18F66K22/PIC18F65K22

Back to Top

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 > BreakpointsEvent Breakpoints).
  • The Watchdog Timer (WDT) cannot be used when debugging unless the device is set to Break on Watchdog Timer (Debugger > BreakpointsEvent 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.

Back to Top