PSOC 4 WS2812- Multi channel configuration- led data getting corrupted

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
srsi_3347331
Level 2
Level 2

I am using the PSOC 4 WS2812 configured with 6 channels- 32 LEDs per channel. I am doing a slow flash by computing the color value for each to be programmed in a loop(involving integer multiplication and division).

The data on channel 6 is getting corrupted( I see green on all but first LED when I am acually sending command for red).

Also the LEDs on channel 5 are not synchronized with the other channels. For each of the channels, on my output port I have variable number of LED's on the LED strip.

Ch1 24 LED. Ch2 18 LED, Ch3 19 LED, Ch 4 19 LED, Ch5 24 LED.

I have I2c bus on the board (disabling this did not help)

Also my board is on a CAN network.

On the generated code , I found this

    #define WS_LED_TIME_T0H  300U     // Logic 0 high, 300 us

    #define WS_LED_TIME_T1H  700U     // Logic 1 low, 700 us

What is the reason behind these numbers?

Thanks,
Sravanthi

0 Likes
1 Solution
srsi_3347331
Level 2
Level 2

I was able to solve this by modifying the striplights component code. The problem was arising because the component updates all the leds at once, which in my case takes a couple of milliseconds, and I have a systick interrupt interrupting every millisecond. The modification was to do only one channel at a time (less than 1 millisecond) and disable systick during this.

View solution in original post

0 Likes
5 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

This forum thread can be useful:

http://www.cypress.com/comment/313256

0 Likes
srsi_3347331
Level 2
Level 2

@anks - Not sure what you are pointing at here- I added a clock to the component - I can add only 12MHz. The lights are always white- they are not updating to the color I am commanding.

0 Likes

Please upload your project

0 Likes

As Of now I cannot upload the project. Is it possible to upload a video without hosting on youtube?

I continued to do some basic test on my project- I stripped out everything - periodically updating the LED pixels and triggering it. It works when I use a delay to implement this :

         while(1)

        {

            USR_LED();

            CyDelay(100);

        }

In USR_LED I have the StripLights_Pixel() and StripLights_Trigger() functions.

When I make my USR_LED as callback to systick 1ms timer, and I only call the StripLights_Pixel() and StripLights_Trigger() after a local counter increments to 100 (giving me 100ms), my leds get corrupted.

What is the approach to handle the StripLights_Pixel() and StripLights_Trigger() calls inside a systick callback?

Thanks,

Sravanthi

0 Likes
srsi_3347331
Level 2
Level 2

I was able to solve this by modifying the striplights component code. The problem was arising because the component updates all the leds at once, which in my case takes a couple of milliseconds, and I have a systick interrupt interrupting every millisecond. The modification was to do only one channel at a time (less than 1 millisecond) and disable systick during this.

0 Likes