I'm working with a PIC24F04KA200 in MPLAB X IDE v6.05 and debugging using a MPLab Snap debugger. Programming in C. I can program the device perfectly fine. When I want to debug the program I need to select a debug header, so I go into the project settings and change the Supported Debug Header from "None" to "AC244028" (the only option). Then I try to debug the project, and I get the following output (Error at the end):
Calculating memory ranges for operation...
Erasing...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0xbf
program memory: start address = 0x100, end address = 0x1bf
program memory: start address = 0x200, end address = 0x7bf
configuration memory
[Debug Executive] at 0x800000, expected 0x00040100, got 0x00000000.
Could not enter debug mode because programming the debug information failed. Invalid combinations of config bits may cause this problem
Below is the configuration I'm using:
#pragma config MCLRE = ON
#pragma config FWDTEN = OFF
So I can program the device, but not debug the device. I have never been able to debug this device. I had a look through the configuration bits on the data sheet, but I didn't see any that I thought would help with debugging (Still new to this though).
Does anyone know how what settings/configurations I can use that will let me debug this PIC24?