360-320-6221 caperren@caperren.com

LED Dot Matrix Display

This project, while one of the simpler and more “hacky” things I’ve ever done, is associated for me with the beginnings of my now love for micro-controllers and programming as a whole. On top of that, it was now years ago as I took the class in 2012! It was my final project for ECE 152 (now gone, but it was intro to programming and micro-controllers II), and had a very simple prompt. As part of the course we were given Wunderboards, intro boards made to teach the basics of working with a micro. Our final task for the class was the develop a combination of embedded firmware for the ATMega646 and a C++ program that used serial communication to join the two systems together in a way that wasn’t simply making a couple of LED’s blink or telling the user they pressed a button. At the time, I’d just recently ordered a pair of 16x32 dual color dot matrix led displays that were on sale and decided this would be a perfect time to try them out.

Now I remember that when I wrote the code for my final project I’d barely written any code ever and knew this might end up getting a bit over my head, and I ended up being completely right. For a few weeks I struggled to reverse engineer an existing arduino library, convert it to generic embedded C, and get the wiring correct on the unfamiliar micro, all with seemingly zero progress. I was fairly frustrated as debugging was an all or nothing task. I had one of the displays running on a spare arduino I had lying around, but until the third week of occasionally sitting down for a few hours and pulling out hair I hadn’t been able to get anything to happen from the Wunderboard. The fault turned out to be an issue in wiring in the end. I didn’t yet grasp the concept of hardware communication protocols having specified pins on Atmel micros, and eventually realized that the SPI interface the display ran on used different pins on the 646 than your standard 328. Luckily, by that point the blatant errors in my port of the display library were gone and it started right up with default text. A few more hours of tinkering later, and I could send the board a string over serial and it would print the text to the screen. Duplicating this setup with a second Wunderboard and a second display and I now had four lines of text available to use for my larger display.

At this point, I’d apparently decided I hadn’t had enough hair pulling yet and needed to up my game for the C++ side of the project. In class, we’d been introduced to the QT framework, an incredibly powerful C++ IDE with native extensions that made making GUI programs a lot simpler. This however didn’t mean much when I barely knew how to use C++ in the first place. It took me more hours than I can remember to figure out how to use it properly by teaching myself. I also knew nothing about how laggy a gui can be when you have a single thread handling everything. When I was done though, I had a working program that could connect to the wunderboards, send pre-made strings, send custom strings, provide a debug screen, and all without crashing. I was very happy with how it turned out considering how new I was to programming, and still think fondly of it as a starting point for my interest in embedded systems. My TA’s were less excited than I had hoped, which killed my excitement a little, but I walked out of the class with an A on my final project and learned a lot, so I wasn’t too upset.