SPI Programmable 7 Segment Display

A simple 8x2 7 segment display driver module that supports arbitrary led patterns and is programmable using SPI.

Similar projects worth following
I had a desire to be able to have a large number of 7 segment displays as eye candy for my embedded CPU project. I didn't want to burn a lot of IO just to display the state of the 32-bit bus values, and so decided that the best answer was to implement a microcontroller-based display driver that would do all of the work. It's simple and modular, and even with the cost of the LED driver it's pretty inexpensive. Works with 5v and 3.3v logic, and there is plenty of program room to extend the capability of the board to do more complex display animations.

Easy to program - the read or write operation is 4 bytes. The first byte is the read (0x00) or write (0x01) indicator, followed by the character number (0x00-0x0f), and then two bytes either read or written. High bits light up the relevant segment. Source code and kicad schematic and layout are up on github.

The meat of this project is an ATTiny88, which has just enough GPIO to talk to the relevant transistors and LED driver. I had originally envisioned using I2C to be able to daisy-chain multiple modules together, but given the need to use most of the SPI connections for programming anyway, decided that I'd be better off using SPI instead. I can always create a small bus board to connect several of these together, and then feed all the select signals and the SPI controls to the FPGA board.

  • 1 × ATTINY88-15AZ ATTINY88 MCU
  • 1 × TLC6C5912 LED shift register/driver
  • 3 × CAY16-331J4LF 4x330 Ohm resistor array (adjust as needed for LEDs)
  • 10 × MBT3904DW1 dual NPN transistor
  • 2 × CL21B105KAFNNNE 1uF ceramic capacitor

View all 8 components

  • 1
    Step 1

    Probably the hardest part of the whole process is to install the SMD components. Be careful to get the orientation correct. For the next round, I should do a better job on the silkscreen, but the good news is that all of the transistors are oriented the same way. Check the board layout if you need to confirm. I used a film stencil and my toaster oven (with thermal controls) to do the reflow. All the SMD is on the back, so it's pretty easy. Even by hand, it shouldn't be terrible, just slower. The segments are installed on the front.

  • 2
    Step 2

    When complete mechanically, wire up the SPI and power to an AVR programmer. The Makefile and code is intended for use with avrdude and avr-gcc, but it should be easily adapted for other platforms if desired. I have the JTAG3ICE, but any programmer that can work in PDI/SPI mode should work. The first step is to reprogram the fuses to increase the internal clock speed. If you run:

    make fuse
    it will set the fuses appropriately.
  • 3
    Step 3

    Finally, you should be able to run:

    make install
    and the code will be compiled and uploaded.

View all 5 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates