It has taken us eight weeks to wrap up this example of the Adafruit NeoPixel driver using the Zynq-based MicroZed board but we’ve pulled together a number of concepts. I think this this is a good point to recap what this example has covered:
1) The system of modules approach
2) Communication between the Zynq SoC’s PS (processor system) and PL (programmable logic) side
3) Using the IP catalog to reduce the number of custom modules we need to implement
4) Creation of a Neo Pixel driver within the PL side of the Zynq SoC
5) The verification approach to be undertaken
6) Definition of a serial protocol to communicate with the Zynq SoC
Before we move on to look at other aspects of the Zynq SoC, this final NeoPixel blog looks briefly at the development of the TCL/TK GUI, which allows you to control the individual NeoPixels in an array from a laptop or other remote device. I developed thi GUI to enable the user to select any color from the 16 million possibilities using the NeoPixel’s 24-bit color depth.
The GUI is very simple, with a button for each pixel in the string. When clicked, each button will open a window allowing you to select a color for that pixel. Once you’ve made your choice, the pixel color information will be downloaded to the Zynq SoC and the pixel will change color.
The major challenge in creating the GUI was ensuring the data being sent down to the MicroZed board was correctly formatted as binary and correlated with the colour being selected. For this reason the first version of the GUI also displayed the hex word for each colour selected and the software in the Zynq has been designed to echo back the data it receives. This echoed data is received by the GUI and saved into a text file, allowing me to correlate what was requested with what was received by the Zynq SoC. An example of the echoed response is below
<STX>pixel number = 32 green = 0 red = ff blue = 0<ETX>
With the GUI working correctly, the layout was changed to just show the LED numbers and pixel selection.
I then validated the system using the GUI driver to ensure that each pixel can be addressed from the GUI and can be set to red, green, blue and white along with a number of different randomly selected colors.
Here’s a video of the system in action:
Having reached the end of this example, we move on for a look at other aspects of the Zynq SoC. For example, we can consider how else this problem of driving the Neo Pixels could have been addressed. Remember back to the part 17 of this blog that introduced the Triple Timer Counter and its ability to generate a PWM waveform. This output could have been used to drive the Neo Pixel array. However the load on the processor would have been higher.
In my next blog we will begin to look at the operating systems we can put on the Zynq SoC. In the meantime, if you want any of the code I have used for this example then please drop me an email.
Please see the previous entries in this MicroZed series by Adam Taylor: