29.4.10.1 Entering Single-Step Mode

Single-Step mode is entered by setting the PTGSSEN bit (PTGCON[9]) = 1. This bit may only be accessed from a debugging session and will read as ‘0’ at all other times. For example, the following steps can be used to set PTGSSEN:
  1. In MPLAB® X IDE, program the device to run in Debug mode.
  2. Pause code execution at any point where PTGSTRT has not been set to ‘1’.
  3. Add a variable watch for the PTGCON register.
  4. Using the watch, set the PTGSSEN bit to ‘1’.
Note: The value of PTGSTRT must be ‘0’ when setting the PTGSSEN bit or Single-Step mode will not be entered.
Note: Due to the Debug mode restriction, it is not possible to read PTGSSEN from application code to determine whether Single-Step mode has been entered as it will always read as ‘0’.