Standalone SPI 7-Segment Display

By: spacewrench

2014-07-26 10:03:47

I had some spare 4-digit 7-segment LED displays and some AT90USB82s, and I'd always intended to do something with them.  This was probably the easiest thing!  It's just the AT90 driving the display, with a(t least) 4 wires controlling it: Vcc, GND, MOSI and SCK.  (I haven't written the code yet, but my plan is to make the display accepts characters via SPI and then spends the rest of the time displaying them).

The board has footprints for a 16MHz crystal and USB connector, so you could make it a USB-enabled 7-segment display as well.  I stuffed those parts on my test board, but I'm not sure whether the USB actually works.  You can power the display from USB, at least, although the video shows it being powered over SPI (which is the same connection I use to flash code).

(Some time passes...)

Ha!  It turns out Paul's code for Teensy USB Serial (AT90USB1286) runs on the AT90USB82 also.  So I just plugged it in, and now the 7-Seg display shows up as a serial port.  When you type digits, it scrolls them in from the right.  Next up: escape codes to control brightness, dots, colon and apostrophe.  Plus I have to add characters (I only have hex digits now).  Hee hee, this was almost too easy!

(More time passes...)

The SPI code was really easy too.  I spent more time writing a test driver for an ATtiny13A than I did configuring & enabling the AT90USB82 SPI.  There's just a few things you have to set up for slave mode, then you just look in the data register to see if anything arrived.  Easy peasy.

Back to archive index