PIC32MZ DA Directives & read registers

PIC32MZ DA Directives & read registers

Postby djdan_23 » Sat Sep 08, 2018 1:11 pm

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.
djdan_23
 
Posts: 1
Joined: Sat Sep 08, 2018 1:46 am

Re: PIC32MZ DA Directives & read registers

Postby ric » Mon Sep 10, 2018 12:04 am

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?
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 433
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products


Return to PIC32 topics

Who is online

Users browsing this forum: No registered users and 2 guests

cron