Site Tools


HT1632-AVR : A library to interface HT1632 LED Driver ICs and AVR micro cont

Adam — Tue, 16/03/2010 - 4:39pm


H1632-AVR is my attempt at making an Arduino and generic AVR compatible library to interface with Hoktek's HT1632 LED driver IC; the main component in a number of LED matrix displays available from Sure Electronics. Here is the description of the HT1632 IC from the manufacturer:

The HT1632 is a memory mapping LED display controller/driver, which can select a number of out bits and commons. These are 32 out bits & 8 commons and 24 out bits & 16 commons. The device supports 16-gradation LEDs for each out line usingPWMcontrol with software instructions. A serial interface is conveniently provided for the command mode and data mode. Only three or four lines are required for the interface between the host controller and the HT1632. The display can be extended by cascading the HT1632 for wider applications.

For some of the background on why I wrote this library there's a fairly lengthy post here on Why I Wrote HT1632-AVR. Feel free to skip that though.

How it works

The HT1632 is a bank of memory with constant current drivers attached to some matrix scanning circuits. The memory is  read and writen over a serial bus which uses +5v clocked serial communication. It's odd in that it shares a single data line for reading and writing and uses two clock lines to tell the IC when to read and when to write. 

The library implements a class which encapsulates the communication method and data transfers to & from the driver IC. The class handles all the bit-banging using a set of C macros which directly manipulate the AVR's IO registers. The class handles things like initialising the device and setting reasonable defaults to get you up and running. It then exposes a few methods of communicating with the HT1632 from as low as setting the mode, address and then reading/writing data or as high as reading/writing to/from a bitmap buffer.


All of the source code is up on GitHub: devdsp/HT1632-AVR. GitHub provides a clonable git repository as well as snapshot downloads. The Master (default) branch should always be stable. If I start breaking things and breaking backwards compatibility it will be in another branch and I'll give people some notice on here when I may be considering merging an experimental branch in.


The GitHub project page is the most official way to get in contact regarding this project but feel free to drop in to the #MakeHackVoid IRC channel on freenode, I idle there most days under the nick devdsp. Feel free to jump in there or comment here if you don't want to sign up on GitHub.


Pull requests on GitHub for code. Contact me via comment here for anything else.


There isn't any yet. Sorry :(

There are plenty of example sketches in my repository and more will be added as I work out what I want to do with my displays. The examples give a decent look at the features and usage of the library, sometimes even in an easy to understand way. All of the current examples have been written for my Arduino Duemilanove and my 4 DE-DP104s. To run the examples on an Arduino and a Sure Electronics display; connect the Arduino to the display as shown in the table below and load one of the sketches onto your Arduino.

Display Label

Arduino DIO

Sure's Connector




























Don't forget that if you are looking at an IDC plug from the bottom, as you will if you are plugging in jumper cables, the rows are reversed. Just remember that CS1, CS2, WR, DATA and GND lines are on the keyed side of the connector and the rest go on the flat side.


Here's a very short demo of one of the configurations I have been playing with.

projects/ht1632_avr/ht1632_avr.txt · Last modified: 2014/02/07 02:53 by brenda