You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • So it works if you lower the data rate? Is it possible to just lower the Baud rate on Serial then?

    Also, if you remove the print statements, that should help a lot.

    The Pico has a 512 byte input buffer I think - I guess it's possible that so much data is arriving while the last data is being sent to the LEDs that it gets full up...

    150 pixels * 24 bits = 3600, and each bit takes 1.25us to send, so that's 4.5ms. If you're receiving data at 1000000 baud then that's 100,000 bytes/sec, so in 4.5ms you're receiving 450 bytes.

    Add some overhead for executing JS and you're dangerously close to overflowing that buffer... So the solution would either be to:

    • Reduce the baud rate
    • Somehow ensure that the transmitter left a gap in transmission while data was being sent to the LEDs.
    • Compile your own Pico firmware with a larger input buffer (without actually making big changes, you could get up to 1024 bytes).

Avatar for Gordon @Gordon started