- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Labels:
-
PSoC Community Components
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please upload your project
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.