chipKIT® Development Platform

Inspired by Arduino™

Chipkit and Harmony integration (AN1388)

Created Sun, 18 Jun 2017 14:41:27 +0000 by The_YongGrand


The_YongGrand

Sun, 18 Jun 2017 14:41:27 +0000

Hey guys!

What I did on the weekends is to modify the linker scripts and some files so that it is also compatible to the AN1388 Harmony Bootloader. The whole thing is with a lot of hits and misses, but slightly more hits. It is on a test board with the PIC32MZ microcontroller - the Wi-Fire's 64-pin version.

What works: 1.) The Arduino for Chipkit can compile and link successfully with correct reset locations. The "upload" part just loads up the "AN1388" segment of the program, and it uploads the app built by Arduino into the board with the Harmony bootloader without any issues. The app can run without crashing.

2.) The DigitalWrite are working for each and every pin.

What doesn't work: 1.) AnalogWrite doesn't function. I had to manually set the Output Compare, Timer 2 registers and the PPS for pin selection.

2.) EEPROM might not work due to the AN1388 bootloader wiping out all the memory areas every programming is done. There is no programming memory range selection for the Pic32Prog's AN1388 mode.

Suggestions:

1.) Is it all good to have some of the functions in the "wiring-analog.c" to be bypassed or redirected, something like your "OPT_BOARD_ANALOG_WRITE", so that I can insert macros and some direct changes to the registers instead of going through the long selection process every each time the "analogWrite" is invoked? In other words, I would like to rewrite some portions of the "analogWrite" so that it is faster and direct to the registers. Ditto to the "digitalWrite" ones too.

2.) I have noticed that the USB stack for the Chipkit is only for the PIC32MX, and the PIC32MZ has a different set of registers. Hopefully the team can port it (yeah, I know it's a difficult one, more time should be needed!) too.

3.) Any way to turn off the task scheduler inside? Or is it a mandatory component?