TM1650 LED controller (32 LEDs max), Keyboard scan (28 keys max).

Titan Microelectronics TM1650 LED controller supports 4 Digits @ 8 Segments. Also supports a scanned keyboard of upto 28 keys. Serial bus interface.

Hello World

Import programmbed_TM1650

Test program for TM1650 LED controller library (32 LEDs max, 28 keys max)


Import libraryTM1650

Library for TM1650 LED controller (32 LEDs max, 28 keys max)




This LED driver is found in frontpanel controllers of consumer electronics such as DVD players. The added features such as the matrix keyboard scanning are useful in these applications. The typical application schematic is shown below.


The TM1650 has a single pin for Data input (commands, LED segments) and Data output (key status). This pin can be connected to mbed DigitalnOut DIO pin and DigitalOut SCK pin. The protocol is ''I2C-like'', but not compatible to I2C (very strange, uses commands instead of address+RW bits, you could not have more than one device on the same bus since the I2C address is not used). The library implements a bit-banged serial protocol to control the TM1650. The wiring example is shown below. Note that any DigitalInOut pin will work. You don't need to use the pins dedicated to SPI or I2C.


The example code was tested on the MEIBAI module (less than $3 on Aliexpress). This modules has 4 seven segment displays with decimal point and 3 switches.

The library supports printf() style methods to display int, hex and float. Icons may be set and cleared, cursor locate, display clear and brightness setting are available, keys can be read back and tested.


Select the target module by enabling one of the #defines in TM1650_Config.h

// Select one of the testboards for TM1650 LED controller
#define TM1650_TEST   0
#define MEIBAI_TEST   1 

The proper target module needs to be selected because there are some hardware differences between the modules.

Note that the TM1650 is very similar to LED (eg TM1637) controllers by the same vendors. See here.

You need to log in to post a discussion