Group Projects
Members' Projects
HT1632-AVR : A library to interface HT1632 LED Driver ICs and AVR micro controllers
Adam — Tue, 16/03/2010 - 3:39pm
Introduction
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.
Download
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.
Communication
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.
Contributing
Pull requests on GitHub for code. Contact me via comment here for anything else.
Documentation
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 |
|---|---|---|
| CS1 | 4 | 1 |
| CS2 | 5 | 3 |
| CS3 | 6 | 2 |
| CS3 | 7 | 4 |
| WR | 8 | 5 |
| DATA | 9 | 7 |
| RD | 10 | 6 |
| GND | gnd | 11 |
| +5V | +5V | 12 |
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.
Demo
Here's a very short demo of one of the configurations I have been playing with.
HT1632-AVR + Arduino + DE-DP104 from devdsp on Vimeo.
- Flag as offensive
- Login or register to post comments
Search
Upcoming events
Recent Comments
Member Tweets
brendam
4 hours 54 min ago
—
Going to ACS branch forum.
|
dev_dsp
7 hours 14 min ago
—
FINALLY! #ausvotes
|
pawarren
7 hours 30 min ago
—
wicked dilemma lol, #ausvotes #ausalmostdonewaitinghurryitthefuckup
|
dev_dsp
7 hours 32 min ago
—
Just punch him out Oakshott. #ausvotes.
|
dev_dsp
7 hours 35 min ago
—
Did someone replace Windsor's speech centre with Katter's? Someone shut that man up! #ausvotes
|
dev_dsp
7 hours 39 min ago
—
I want to see the usage graphs on the ABCnews24 media servers and network links. They must be absolutely hammered right now. #ausvotes
|
geoff_swan
7 hours 57 min ago
—
@g_appleby don't think so. I assumed you weren't either... #howsyourback?
|
pawarren
8 hours 14 min ago
—
at least they have a camera for the interest rate ann. Too bad it's mounted on a bucking bull! #abcnews24
|
pawarren
8 hours 45 min ago
—
oh, but now you're back again, and still no camera :( #abcnews24 #ausvotes
|
pawarren
8 hours 45 min ago
—
good time to break #abcnews24
|
- 1 of 388
- ››






Library
rvbcrs — Sat, 24/04/2010 - 3:58amHi I like to try this library, but I don't know how to configure the wires from a arduino to the matrix board! Can you please tell me what wires to use!
Thanks,
Ramon
Hi Ramon, The examples in my
Adam — Fri, 30/04/2010 - 11:07amHi Ramon,
The examples in my repository use the following connections to Sure Electronics displays:
If you only have one display you only need to connect one of the 'Chip
Select' lines, just make sure that you set the dip switches on the back
of the display to match the Chip Select pin you have chosen on the
connector. You also don't need to have the 'Read Clk' pin connected, but you will only be able to write to the display.
Remember that when you look at the IDC cable's connector the rows are swaped over. If you hold the cable's connector with the tab facing towards you, pin 1 (the first chip select pin) is on the top row.
Thanks for pointing out that this isn't documented. I'll go and update the readme file with some ASCII art.
Adam.
Power
adammhaile — Tue, 07/09/2010 - 8:02amAre you powering all 4 Sure displays off of the arduino 5V output?
I see that each display is rated at 220 mA max, and I thought that that would max out the 800 mA current draw of the Arduino voltage regulator.
Or are you powering the displays off of a separate external power supply? If so, is there anything special required? Would a current regulated 5V "wall wort" work?
When I want to run more than
Adam — Tue, 07/09/2010 - 8:34amWhen I want to run more than 2 displays I power them with a 5v regulated wall wort I picked up from JayCar. One amp is enough to power four displays and the Arduino (by plugging the regulated 5v into the Arduino's +5v header). At a stretch; the Arduino's on board regulator can power two displays, even off USB, but I wouldn't do that for a permanent installation.
What's the difference between
adammhaile — Tue, 07/09/2010 - 8:58amWhat's the difference between plugging the 5V in to the +5v header and connecting power to the regular power jack?
I also thought the +5V header was only for power output...
Powering Arduino's off their +5v header
Adam — Tue, 07/09/2010 - 9:35amThe regulation circuit isn't 100% efficient, and due to the nature of the regulator it needs +7v or higher to provide the 5v needed to run the Arduino. Plugging 5v directly into the 5v header bypasses that circuit and just drives the input of the Arduino directly. The 5v net (traces) is the same regardless of where the power comes in.
Here's the quote from the Duemilanove's Arduino.cc hardware page:
5V. The regulated power supply used to power the
microcontroller and other components on the board. This can come either
from VIN via an on-board regulator, or be supplied by USB or another
regulated 5V supply.
VIN vs 5V
adammhaile — Tue, 07/09/2010 - 11:46amGuess I'm still confused. That description makes it sound to me like 5V is output only and that you can only input via Vin. Could you still input a regulated 5V on Vin?
RE: VIN vs 5V
Adam — Tue, 07/09/2010 - 12:11pmThe header pins don't have anything that dictate them as inputs or outputs. The are directly connected to the nets which use that voltage level. The putting 5v on the VIN pin is the same as putting 5 volts on the power jack (with the minor exception that the power jack has a diode inline to prevent damage incase you put a center negative plug in). The VIN net is on the 'outside' of the regulator and must be at 7v or above for the regulator to be able to supply 5 volts to the 5volt line. The 5v header is on the ATMega side of the regulator. Connecting to the 5v header is just like connecting 5 volts to the VCC pin on the ATMega. This might be easier to see on the arduino-duemilanove-schematic.