Programming the USB module of PIC32MZ without Harmony (1)
Why not Harmony
First of all, I’m a royal promotor 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 seriously 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 some complicated 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 to turn 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. I will share what I’ve learned in my follow-up posts.