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.

11 thoughts on “Using An Undocumented Display With An FPGA

  1. 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.

  2. 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.

  3. 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 :)

    1. I it was your library code that I worked from, so a big public “thank you” is needed.

      Thank you!

      Now I must be able to do something grand with this display… I’m thinking of using a GPS module to get my car’s car speed, and then using a row of three of these to make a POV display that displays “I am going X km/hr” as I drive down the street. It can use the speed info to adjust the aspect ratio.

      Won’t be doing it on and FPGA though :-)

  4. Has anyone found the schematic for this particular module? It differs from other similar TM1638 based modules in directly supporting daisy chaining. Some cheaper versions also have single colour 8 Leds rather than bicolour driven by the IC’s Seg 9 pin. What pins does this bicolour version use?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.