7 Segment Displays - TM1637 6 Digits

Introduction

The TM1637 display module is used for displaying numbers on a keyboard matrix.   The matrix of LEDs consists of six 7- segment displays working together.  

The TM1637 specification is

  • Two wire interface
  • Eight adjustable luminance levels
  • 3.3V/5V interface
  • Supports six alpha-numeric digits
  • Operating current consumption: 80mA

Using the TM1637 Display Module

graphic

Why to use TM1637 Display Module?

The TM1637 can be interfaced to any system using only two ports.   This is the main reason the module is preferred over other module.

Another reason TM1637 display is preferred is because of its low cost.    Although there are other display modules present in the market they cost more.

The module design is robust so it can sustain in tough environments and still can perform its function for a long time.   The module consumes low power and can be installed in mobile applications.  



How to use TM1637 Display Module?

As mentioned earlier the module communication can only be done using the two pins DIO and CLK respectively.   The data is sent to the module or received from the module though these two pins.   So the characters to be displayed are sent in the form of serial data through this interface. A typical circuit diagram of display module interface to a controller is shown below.



graphic



The module can work on +5V regulated power and any higher voltage may lead to permanent damage.   The interface is established as shown in figure above.   All you need to do is connect DIO and CLK to any of GPIO (General Purpose Input Output) pins of controller and establish serial data exchange through programming.

GCBASIC Support

The GCBASIC 7 segment display methods make it easier for GCBASIC programs to display numbers and letters on 7 segment LED displays.

The GCBASIC methods supports six 7 segment display devices, common anode/cathode and inversion of the port logic to support driving the device(s) via a transistor.

Brightness can be set: 8 is display on minimum bright , 15 is display on max bright. Less than 8 is display off.

The TM1637 chip supports the reading of the keyboard matrix however that is not supported in the library.

DataSheets

The datasheets can found here:

English - here.

Chinese - here.

Usage

The following will set the display.

Constant Description

TM1637_CLK

Must be a bi-directional port.   The direction/port setting is managed by the library.

TM1637_DIO

Must be a bi-directional port.   The direction/port setting is managed by the library.

Example program

  #chip mega328p,16
  #include <TM1637a.h>

  #define TM1637_CLK PortD.2      ' Arduino Digital_2
  #define TM1637_DIO PortD.3      ' Arduino Digital_3

  '---- main program --------

    TMWrite6Dig (17, 16, 17, 16, 0) 'clear display
      wait 2 s
    TMWrite6Dig (17, 16, 17, 16, 10,0) '- -
      wait 2 s
    TMchar_Bright = 10