Close

Controlling the LED matrix

A project log for Twitter feed on an old LED marquee

An adventure in '80s electronics and embedded Linux

Enrico GueliEnrico Gueli 04/24/2022 at 08:030 Comments
After some messing around with Arduino, I finally managed to take full control of the LED matrix:

That's supposed to be a rectangle. But I made it 8 pixel tall instead of 7. And this small detail bricked the Arduino Micro 😅

The reason is that in my Arduino sketch I defined a framebuffer made of 7 byte arrays. Then I defined a couple graphics functions like `drawHorizontalLine` that would set the corresponding bits in the arrays. I didn't care for checking the boundaries, so when the sketch ran `drawHorizontalLine(y = 7)` it actually wrote somewhere outside the memory allocated for the framebuffer. That somewhere happened to be something related to the USB communication used by the Arduino Micro libraries, messing it up and making it incapable to talk with my PC. Repeated resets + upload lead to nothing. My only option left is reprogramming the MCU via the ICSP pins.

A couple notable things before reaching this point:

Next steps: reprogram the Arduino Micro before I put it back in the drawer, forget about it, pick it up months later, think it's broken and throw it away. Then, thinking that I'd like to try driving the LEDs straight from an embedded Linux machine:

Discussions