Page 1 of 1

PIC32MZ DA Directives & read registers

PostPosted: Sat Sep 08, 2018 1:11 pm
by djdan_23
Hi all !
I'm very new to the PIC32MZ DA and XC32 (Using in the pass the PIC18 in asm) and I'd like to play with the on-board three led and switches as a start.
I have a PIC32MZ2064DAA288, MPLAB 5.05, XC32 2.10 on WIN7 (No Harmony install yet)

But so far I can't find anything for this PIC32MZ DA. So I have only two lines to start it: #include <xc.h> and main () { } (Simple enough ah! ah! ah! :lol: )
The "make and program device" work OK: "Programming/Verify complete"
and "run project too": "Programming completed Running target..."
So far so good.

But when I try to DEBUG PROJECT I always get: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.

So I copy the "configuration bits" from the output window, but I'm always still having this warning.

So I have a 2 folds questions
1: What is the most used directives to include in my setup.
2: How can I read the registers (Like the one on oscillator, i2c, rtcc etc.)

Thanks to all that reply, cause I'm kind of stuck right now.

Re: PIC32MZ DA Directives & read registers

PostPosted: Mon Sep 10, 2018 12:04 am
by ric
Most PIC32 devices have multiple pairs of program/debug pins.
You can program on any pair, but you can only debug on the pair specified in your CONFIG words.
Use the CONFIG word editor built into MPLABX, it makes setting them easy. The easy way to set CONFIG bits in your source using MPLABX

[quote]
Just the same as you would have in the PIC18 chip. Have you read through the register list in the PIC32 datasheet?