TM1640 LED controller (128 LEDs max).

Titan Microelectronics TM1640 LED controller supports 16 Digits @ 8 Segments. Serial bus interface.

Hello World

Import programmbed_TM1640

Test program for TM1640 LED controller library. Initial version

Library

Import libraryTM1640

Library for TM1640 LED controller Initial version

Pinout

Datasheet

http://www.titanmic.com/pic/other/2014-11-20-15-36-028.pdf

Notes

This LED driver is found in frontpanel controllers of consumer electronics.

The TM1640 has a serial interface consisting of a pin for Data input (commands, LED segments) and a pin for the serial clock. The protocol use a Start and Stop condition similar to what is found in the I2C bus. However, the data exchange as such is similar to what is found in the SPI bus, but without a CS. With some additional external components the hardware SPI engine of an mbed could be used to control the TM1640 device. However, the current library uses a software serial port implementation instead. The protocol is shown below.

/media/uploads/wim/tm1640_format.png

The example code was tested on the LM1640 module (less than $7 on Aliexpress). This modules has 16 seven segment displays with decimal point.

The library supports printf style methods to display int, hex and float. Icons (ie decimal points) may be set and cleared, cursor locate, display clear and brightness setting are available. The library also supports ASCII characters and symbols. These are obviously not always perfect with only 7 segments. However, with some compromising even a 7 segment display can represent most characters reasonably well.

/media/uploads/wim/img_4012.jpg

/media/uploads/wim/img_4017.jpg

The device is also available on several modules that drive an 8x8 LED matrix instead of several 7 segment displays.

/media/uploads/wim/767378774_623.jpg

Note that the TM1640 is very similar to LED (eg TM1638, PT6964) and VFD controllers (eg PT6312) by the same and other vendors. See here and here.


You need to log in to post a discussion

Questions

1 answer
code atiq shaikh
7 years, 7 months ago

TM1640