Programming the USB module of PIC32MZ without Harmony (1)

Why not Harmony

First of all, I’ve been a royal customer of Microchip’s MCU products for over a decade. From PIC24 to dsPIC33, from PIC32MX to PIC32MZ, Microchip’s MIPS line never disappointed me except for the Harmony library, or its predecessor – the PLIB. However, it really stung me when my “ancient” PIC32MX project failed to compile after Microchip ditched the support of their legacy PLIB. Although its successor, the Harmony library, has since been actively supported throughout multiple generations, I’m very concerned to build my project heavily on top of the vendor-supplied software stack.

On the other hand, I wouldn’t feel any hesitation to use the Harmony if it included sophisticated algorithms that I didn’t want to re-invent. A closer inspection into the library, I realized the Harmony library, same as its predecessor PLIB, is just trying to provide a more user-friendly and unified interfaces to configure various registers, which can be done easily by yourself as long as you’re willing to spend some time reading its documents.

So, why not…. until I started to work on the USB module. Microchip doesn’t seem to provide enough documentation to explain the details of the USB related registers. This is indeed turning my stubborn challenge into a mission impossible. Fortunately, I was able to find nice and smart people like Aidan, who is making similar efforts to filling the gaps. With the help from Aidan’s website, and a lot of trial and error, I managed to make my USB work on the PIC32MZ2048EFH100 with DMA function, but absolutely no use of single line of code from the Harmony library. I will share what I’ve learned in my follow-up posts.

Leave a Reply

Your email address will not be published. Required fields are marked *