0
\$\begingroup\$

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?

\$\endgroup\$
1
  • \$\begingroup\$ Post this on the Microchip website as a support request/ticket. MPLAB is a mess and may not work or do what you want for a million different reasons (that, of course, does not exclude an option that you indeed configured something wrong). \$\endgroup\$ Commented Oct 3, 2023 at 9:51

1 Answer 1

0
\$\begingroup\$

As Andrejs suggested, I made a support ticket to Microchip and got the following reply:

Regarding your technical issue, in order to debug a project with PIC24F04KA200 as target device, an AC244028 debug header is needed. This one has to be physically connected to the PC, not just selected in the MPLAB project properties window, so you will have to get one in order to be able to debug the project. In addition, this debug header is needed regardless of the programmer used (Snap, PICkit4, ICD4, PICkit5, ICD5 etc.).

Unfortunately, the AC244028 debug header is no longer available on our website, being a deprecated product. If you are not able to buy one, a suggestion would be to try to debug the project by printing messages on the UART, with the help of the printf function.

So it seems the only way to debug a PIC24F04KA200 is with an additional physical device that has been discontinued. They mentioned sending values through UART to another device for displaying, I haven't tried that yet but it might yield decent results.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.