Got my latest PCBs on Tuesday. I knew before they arrived I had a problem. I assumed (should be a four letter word) that PPS would allow any function on any PPS pin. Well PIC18 may come close to that, but PIC32 does it in blocks. So now I have 10 boards that are really not very useful. Fortunately the USB and the console port could be used. This one is very similar to the Brick Controller I cant build for lack of parts. The Motor interface is missing and the BT (RN4871) is superset of the BT (RN4020) module on that Brick Controller. The PIC32 is from the same PIC32MX family, just in QFP44 instead of a QFP64. So this one is a high end LED controller with 15 LED channels. I had previously mentioned this.
I started pushing code into it, using the previous BrickController and MPLAB X Harmony Project I started. Just in case the startup code for this PIC32 was unique. Amazingly the USB HID came up right away. I could not move data back and forth, but the PC recognized that a HID device was connected. On the next day I was moving data and my Win10 App was talking to the device. There were some USB connection issues. They may have existed before I just never noticed them, but I decided to make this rock solid. The PIC32 USB/HID implementation is more flexible than the PIC18 and this is OTG, which I am not using. There are 3 state machines at the App level, two of them are callbacks from the USB/HID driver implementation. The third is the real App level state machine. It took a few days to get this working. It was a simple matter of getting all three state machines in sync with each other and realizing that the two callbacks were actually running as the result of ISRs and those totally asynchronous to the App it self.
Once the USB/HID was working, merging in the other code for the other peripherals is easy. Will need some conditional compiles, I dont like maintaining multiple code bases if I dont have to.
More later.
No comments:
Post a Comment