RP2040 with FastLED interferes with Multiplexers

Hello.
I have a strange problem. the Project is quite large, I'm using around ~300 Potentiometers / 200 Buttons and 50 Encoders on a controller with approximately ~200 Leds. All of them send a MIDI message. Before i was on an Arduino, but switched to an RP2040 for performance. I use arduino code on Platformio.

I'm updating the LEDs every second. And when i update them, it could happen that one of the messages that are sent even though i didn't turn an potentiometer. It helps to increase the threshold which accepts the difference to the previous value.

When using an Arduino i didn't have this problem, but with the RP2040, the 5V of the LEDs is now connected to the VBUS and the multiplexers are on 3.3 Volts. I was wondering if this is a problem. (Would it help using a level converter, rather than the VBUS pin? I think no, because I think this is not a logical circuit, right?. If I just use 5V for the 5V pin on the LED stripes)

I don't think my code is important, because everything theoretically works fine, other than the interference. let me share my update function. If i remove the call of this function which would happen otherwise every second, i don't have any problems anymore but also no LEDs anymore.

void updateLed(){
  for (int i = 0; i < numLEDs; i++) {
    int value = colorLEDs[i];
    leds[i] = CRGB(
      brightnessLED * (value & 1),
      brightnessLED * ((value >> 1) & 1),
      brightnessLED * ((value >> 2) & 1)
    );
  }
  FastLED.show();
}

I don't know what further information would help to share, since my circuit is very large. I use many GPIO pins of the RP2040.
I do have some Decoupling Capacitors between 3.3V and GND. And i also tried a decoupling capacitor between 5V and GND, but this one i removed, because it didn't help. I guess its some kind of noise.

I'm glad for any advice. Thank you very much!

1 Like

Every time you use:-

The interrupts are turned off and no further action is possible until the whole string of LEDs is written to. So during this time any knob changes will be missed.

Well I would disagree with that.

Can you explain what that is please I have never come across it.

Are you saying you are controlling 200 LEDs through the USB connector to the RP240?

It would help if you had an external power supply for those LEDs.

Have you got the resistor in line with LED strip control input?
Have you got a large capacitor at both the front and end of the strip?

Can you post a schematic of what you have please?

1 Like

Mh, i added different big capacitors and also tried to add a seperate 5V circuit with an external power source. But it didn't seem to help.
however I've been experimenting around and before i used both cores of the RP2040, one for tracking any changes to the potentiometers and one to update the LEDs. I've now simply added a delay of 30 milliseconds after the FastLED library sends out any message. So i removed the interference by simply not tracking any changes in this time.

PlatformIO can be embedded in Code (Visual Studio Code or linux alternatives) and is an alternative IDE to the arduino IDE. I switched to it because some libraries that i found online do not support the arduino IDE and only PlatformIO. It's a nice tool, makes it easier to switch between projects and library management is better.

Anyhow thanks for your response, I guess the problem here is solved.

200 LEDs takes about 200*30+50=6050us to update, and will could screw up your clock by about 5-6ms/cycle.

1 Like