During the Holiday Special 19 and my Happy New Year Element14: my last project for 2019 project I ran into issues with the WS2812 LED's flickering and that issue was compounded for me by my use of the Arduino IDE and the lack of debug support. I also suspected that the Neopixel driver library may have been causing issues and so I carried on to port my code from the Arduino to the Microchip PIC range. I had previously managed with great success to use the Configurable Logic Cells (CLC) of a PIC16F1509 to generate the WS2812 protocol, as detailed in the Microchip application note AN1606. Using the CLC effectively takes load off the processor enabling the code to run and generate the next colour sequences rather than producing the strict timing signals.

The downside of this port was me....I had left my previous code in a bit of a mess regarding understanding it, it was still built for the PIC16F1509 where I now wanted to use the PIC16F18857 and my versions of MPLAB X IDE/IPE/MCC and XC8 had all updated by quite a few versions. All that compounded to code which failed to compile until last night.


My task tonight was to tweak the final sections of the Microchip C code and see if I could replicate my Arduino based Catherine Wheel. The effect in the video is approx 60 seconds of Catherine Wheel effect followed by some other effects I programmed up (generally intended for a linear string of WS2812 pixels). However I still think one of these is misbehaving completely and that is now making me think that on full load perhaps several of the WS2812 produce glitches or fail to pass through the protocol. This needs further investigation and I'll have to code up a test mode that runs through various intensities to see what does and doesn't behave. That might give a good indication of where the issue lies and then I can debug with a breakpoint at that instant.


Having the code in MPLAB X IDE is a real bonus for me though as I find the Netbeans environment useful and powerful for splitting out functions, headers and debugging the code. Hopefully over the coming weeks I can modify and polish this code up some more.



If I managed to get some nice effects running on the PIC I'll post them on E14. My other plan is to add in some switches so I can either select random pattern or specifically switch to one effect only without changing the code.