Arduino ESP32 SPI output to WS2801 chip inconsistent
Posted: Sun Jan 07, 2024 4:16 pm
I've built my own led controller with a ESP32 D1 Mini / D1 Mini ESP32 from AZ-Delivery.
It has done it's job exclusively well until i tried building my own classes in the Arduino.
Mainly these handle what colours the lights have and do not influence any hardware directly.
I have checked all the wiring because i could not imagine this could be a software issue ever.
Nothing helped.
I replaced the "Adafruit ws2801" library with the "Fastled" library, did not change anything either.
But if i roll back a few versions (of my project), the problems disappear.
What i changed was only that i started using heap memory explicitly to be able to create my handlers dynamically and maintain buffers (with lighting colours, brightness and so on) after loop() returns.
The SPI output is somehow unstable. I see this because from time to time there is a color mismatch in the leds and sometimes even the whole strip flashes in a greenish color. This is only for a few milliseconds but it's visible.
Since the problem disappears when i roll back my arduino project to an older version i know it's not a hardware issue.
And there are no crashed when it happens. The overall program just continues to run and the light patterns are consistent.
My question is now: What am i looking at? How do i debug this? Has anyone seen something like this before?
It has done it's job exclusively well until i tried building my own classes in the Arduino.
Mainly these handle what colours the lights have and do not influence any hardware directly.
I have checked all the wiring because i could not imagine this could be a software issue ever.
Nothing helped.
I replaced the "Adafruit ws2801" library with the "Fastled" library, did not change anything either.
But if i roll back a few versions (of my project), the problems disappear.
What i changed was only that i started using heap memory explicitly to be able to create my handlers dynamically and maintain buffers (with lighting colours, brightness and so on) after loop() returns.
The SPI output is somehow unstable. I see this because from time to time there is a color mismatch in the leds and sometimes even the whole strip flashes in a greenish color. This is only for a few milliseconds but it's visible.
Since the problem disappears when i roll back my arduino project to an older version i know it's not a hardware issue.
And there are no crashed when it happens. The overall program just continues to run and the light patterns are consistent.
My question is now: What am i looking at? How do i debug this? Has anyone seen something like this before?