Using an undocumented display with an FPGA

When [Mike] ran across a display on Deal Extreme with 8 seven-segment displays, 8 red/green LEDs, and 8 buttons, he knew it would find a good home in a future project. There was only one problem, though: except for an Arduino library, there was absolutely no documentation available for this display. Wanting to use this display with an FPGA board, [Mike] decided against bit-banging a protocol and ported the C++ code into a hardware implementation.

This Deal Extreme display, the TM1638, features enough seven-segment displays, LEDs and buttons to build something really cool, and surprisingly isn’t terribly hard to interface with a microcontroller. The TM1638 library communicates with the outside world via only three pins and a simple serial connection.

After figuring out what commands are sent to make the display turn LEDs on or off, [Mike] wrote a hardware implementation for his Digilent Nexys2 and Digilent Basys2. Now the display operates on an FPGA just like it does with an Arduino, and is a great tool for debugging HDL code for [Mike]‘s FPGA.


  1. ino says:

    Nice work. It could be usefull.

  2. Paul says:

    There actually is documentation; one of the folks at the DealExtreme forums translated the Chinese datasheet into english.

    The device uses a straightforward 3-wire SPI interface (strobe, clock, and a bidirectional serial pin).

    I ended up bit-banging the protocol on my MSP430, but there is a library out there on the 43oh forums that uses the hardware SPI interface (and a couple external diodes) to make it work without bit-banging.

  3. vic says:

    Actually there is documentation, but in Chinese. You can download the datasheet of the TM1638 on the manufacturer’s website ( Timing diagrams are a universal language, and in case of doubt automatic translation usually works well with Chinese.

  4. Aaron Dayton says:

    Not sure if this is helpful info but Ricardo has already done work on this with some C++ libraries.


  5. Ricardo says:

    I actually had plans to build the Arduino library using SPI too, but it was simple to try and test it and get it to work using the bit-banging than SPI.

    Just never had time to pick it up, but it’s on my TODO list to pick it up and use the SPI on arduino too… someday :)

Leave a Reply


You are commenting using your account. Log Out / Change )

Twitter picture


Facebook photo


Google+ photo


Connecting to %s