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”
Nice work. It could be usefull.
yeah, especially since the undocumented displays are usually the lowest priced ones on the surplus sites.
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.
Nice find! That chip actually looks pretty useful… can drive 80 LEDs and 24 switches.
If I was still into Flight Sim it would be a cockpit builder’s dream chip :-)
Actually there is documentation, but in Chinese. You can download the datasheet of the TM1638 on the manufacturer’s website (titanmec.com). Timing diagrams are a universal language, and in case of doubt automatic translation usually works well with Chinese.
Not sure if this is helpful info but Ricardo has already done work on this with some C++ libraries.
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 :)
I it was your library code that I worked from, so a big public “thank you” is needed.
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 :-)
Try this one, works very similarly https://dx.com/p/jy-mcu-16x-digital-tube-yellow-led-module-104311 It’s a bit fiddly to get the right numbers to the right segments, but it works well.
That’s a TM1640, not a TM1638. It’s similar, but not exactly the same. There’s support for that in the library too.
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?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)