Wednesday, 13 August 2025

Republishing a WS2812 PSoC Creator Project

Introduction 
This short blog republishes a PSoC Creator project that uses a WS2812 component. The WS2812 is an addressable RGB LED, as seen in common devices such as LED strips. The original post with the PSoC Creator Project, ‘WS2812 and 5LP @ 48 MHz’ was posted in the Infineon Developer Community with the project named ws2812_test.cywrk_.Archive01.zip.

Reason to Republish
Four development boards, the micro:bit, Arduino, PSoC, and STM, were chosen for comparison. Most of those boards have been or are currently used in education, and they have a broad sample of projects with code spread across community forums and sites.

Project Example to Compare Development Boards
The addressable RGB LED (WS2812B) was chosen as the example project since LED strips are engaging with students. Example projects were found for all but the PSoC4 part 
CY8C4245AXI-473. The Modus Toolbox PSoC development environment from Infineon supports NeoPixels, but an example did not seem to be available for the PSoC4. The target audience for this project was at the education level, so off-the-shelf and ‘working’ examples were preferred.

Using Modus Toolbox, the CY8C4245AXI-473 PSoC microcontroller was not listed under the ‘Select device part numbers'.

Modus Toolbox BSP Assistant - Device Part Numbers
Modus Toolbox BSP Assistant - Device Part Numbers

A related development kit, CY8CKIT-042, associated with the same PSoC4, was not listed under the Modus Toolbox ‘Select BSP template’.

Modus Toolbox BSP Assistant - Template
Modus Toolbox BSP Assistant - Template

Understandably, the target PSoC is an older device, so some limitations were anticipated. Of course, a PSoC6 development kit could be used with the NeoPixel LEDs, but that was hardly a fair comparison against the slightly slower micro:bit or Arduino.

Finding a WS2812 PSoC4 Example Project
A WS2812 library was available for PSoC5, 
CY8C5888-LP097, by the author, Mark Hastings (Cypress Semiconductor). The example project for the WS2812 was taken from the Infineon community forum, but the project is several years old and contains broken component dependencies.

Later, I was to find another PSoC WS2812 project from the same author called FunWithLEDs. This project contains comprehensive examples of the WS2812.

Rebuilding the WS2812 Example Project
Opening the Top Design in the WS2812 PSoC5 project, some missing components were shown.

Missing Components in PSoC Top Design
Missing Components in PSoC Top Design

The missing library was not included with the WS2812 project, so this was found on another site and copied into the project's root folder.

Added WS281xlib to Project Folder
Added WS281xlib to Project Folder

To correct the missing library component in the PSoC project Top Design, the Dependencies menu in PSoC Creator was used to perform an update.

PSoC Creator Dependencies - StripLightLib Error
PSoC Creator Dependencies - StripLightLib Error

The existing dependency for the WS2812, called StripLightLib, was removed.

Lastly, the dependency for WS281xLib was added to the project dependencies, now pointing to the copy in the project’s root folder. 

PSoC Creator Dependencies - WS281xLib
PSoC Creator Dependencies - WS281xLib

The downloaded WS281xLib contains the StripLightLib library and several others worth exploring.

Contents of WS281xLib Folder
Contents of WS281xLib Folder

The missing component issue was resolved in the projects Top Design, as pictured below.

Updated Components in PSoC Top Design
Updated Components in PSoC Top Design

Compiling the project resulted in no further issues.

Complied QS2812 PSoC Creator Project
Complied WS2812 PSoC Creator Project

The PSoC target was changed to the CY8C4245AXI-473. Finally, the development board was programmed and subsequently used for the development kit evaluation.


Downloads
The dependency WS281xLib and the updated project for PSoC5, built for PSoC Creator 4.4, are available below for download. All intellectual property rights and licenses for the libraries and PSoC Projects, including those belonging to Mark Hastings, Cypress Semiconductor, and related parties, are retained and owned by those entities.

WS281xLib
WS281xLib

ws2812_test
ws2812_test