Jump over to our dedicated ESP32 website esp32developer.com
All posts by
Timer (interrupt driven)
Configure the timer in MCC and select interrupt driven. Once you Geneate the MCC code it will have dealt with initialising the timer ready for you to use it. In your code Other timer functions MCC will have created a few useful functions you can call – see the file it generated in: /config/default/peripheral/tmr/
Atomic access
PIC32 Special Function Registers (SFRs) can be accessed like ordinary variables in C but there can be read-modify-write problems associated with code that wants to change individual bits in these registers. To get around this problem, virtually all registers have an alternate register set, using the primary register name appended with SET, CLR, or INV. […]
PIC32M Watchdog Timer
Useful macros to use Then in your code
16bit Read and Write
Writing 16bits of a 32bit register
XC32 Docs etc
XC32 MPLAB Harmony PIC32 Family Reference Manual
XC32 files, definitions, etc
Predefined C variables that represent the peripheral registers and bits In your sepecific device header file, located in: C:\Program Files\Microchip\xc32\v#.##\pic32mx\include\proc\ Config setting names e.g.#pragma config FMIIEN = In MPLABX: Menu > Window > PIC Memory Views > Configuration Bits, then use “Generate Source Code to Output” button.
.IO Pins General
Inputs Read pin Read port Outputs Write pin Write port Direction
XC8 V1.# Compiler
Setting a new project (After following the steps here) Project Properties > XC8 global options > XC8 Compiler > Select ‘Optimizations’ Speed (or disable optimizations?) & Debug checkboxes Set as needed (off and on is good for debugging) Address qualifiers – CAN BE VERY IMPORTANT!!!! If you are using anything that requires locating in specific […]
.New XC32 Project
Use MCC Get over it, you have to with V4.# and above XC32, all the old plib.h and config etc functions are completely gone. If you don’t want it you’ll have to use V2.# of the XC32 compiler (we skipped V3.#, not sure on that one). Create MPLAB X Project Run MPLAB X IDE Menu […]