These tutorials take you through the process of setting up a project for the PIC32MZ2048EFM144 from Microchip. We look at how to configure the chip for debugging and get a simple blinking LED example running. Then we continue on to set up a 1ms Tick Timer, Interrupt Driven UART for debug output as well as general purpose communication, and the SPI peripheral for communication with external Flash Memory. While there are many great frameworks out for the PIC32 processors, this tutorial aims to build the framework from scratch. Working directly with the peripherals through register reads and writes we can show the core mechanics of the Microcontroller peripherals and provide insight to how they work.
While the tutorials are written for a specific processor the code can be easily adapted and used on other PIC32 processors. All of the examples in this tutorial are derived from personal experience working with the PIC32MZ for commercial products. I am not an engineer for Microchip and therefore some of my explanations may be partial or incorrect. However, at the very least I can explain how I have gotten things to work and hopefully help kick start other commercial ventures or hobbyist that are interested in using the PIC32 Microcontrollers. If you find the tutorials useful please let me know in the comments or by emailing me at firstname.lastname@example.org.
Part 0: Setup
In this part we set up the environment and get a pre-built example running on the microcontroller.
Part 1: Clocks and Configuration
In this part we dive deeper into the example project and explain how all of the pieces that were added in Part 0 work.
Part 2: Interrupts
In this part we look at how to set up and use interrupts by taking you through the process of setting up an external interrupt for one of the buttons on the starter kit.
Part 2: UART
In this part we set up the UART peripheral and provide a means by which we can do debug output and input using the on-board UART to USB FTDI chip.
Part 3: Timer
In this part we set up a "Tick TImer" which fires an interrupt at 1ms intervals and provides us with a backbone for keeping track of time.
Part 4: SPI
In this part we set up the SPI peripheral to communicate with the external flash memory found on the starter kit.