Led matrix with HT1632C controller (2)

by luca
10 comments

A new blog post about my led matrix display with a first example about interfacing it with Arduino…

WIRING

As I wrote, to drive the display you need only 3 pins. You can choose any digital pin of your Arduino: to keep my example clear, I defined some aliases in my sketch

#define DISPLAY_CS    3
#define DISPLAY_WR    4
#define DISPLAY_DATA  5

The display is powered with 5V, so you can take power and ground from Arduino too:

Display’s connector has 4 CS pins: connect to Arduino the one numbered as the dip switch

COMMUNICATION

To enable communication to the display, first you need to set low the CS pin.

Then, for every bit to be sent;

[checklist]

  • set low the RW pin
  • send the actual bit on the DATA pin
  • set high the RW pin

[/checklist]

The value you send on the DATA pin is indeed read on the rising edge of the RW pin.

From HT1632C datasheet you can notice that commands and addresses have to be sent from the most significative bit (MSB), while data have to be sent from the less significative one (LSB):

COMMANDS

HC1632C defines 3 commands, distinguished by the first 3 bits:

  • READ, 110
  • WRITE, 101
  • COMMAND, 100

The first two commands are followed by the memory address and the data; the third one instead is followed by a command code that specifies the specific command to be executed.

INIT

At power on, the display is disabled:

To use it, first you need to send SYS EN and LED On commands (we’re going to send these two commands in the setup() method of our sketch).

In the next page, you’ll find the first sketch

Related Posts

10 comments

Mike Monday January 7th, 2013 - 04:13 AM

How fast can the LEDs be updated? I’d like to write to the matrix so that everything is lit, then send a new image 100 – 300 milliseconds later and repeat this at least 10 times over 3 seconds.

thanks,

Mike

Reply
luca Monday January 7th, 2013 - 09:24 AM

Hi Mike,

referring to the datasheet (http://www.holtek.com/pdf/consumer/ht1632cv120.pdf) you can send data to the Holtek controller up to 1MHz
bye

Reply
123 Monday December 23rd, 2013 - 09:06 PM

Hello Luca

Is There any chance to translate your code for other
LED-display from Sure electronics.
I have this LED-Display

http://www.sureelectronics.net/goods.php?id=1136

I try to understand how the HT1632C works but I dont get it 🙁

Reply
luca Tuesday December 24th, 2013 - 08:48 AM

Hi Ahmet,

unfortunately this is the only display by Sure that I own so I can’t modify/test the code on different models…

Reply
Ahmet Wednesday December 25th, 2013 - 02:49 PM

Hello

Luca thank you its no problem, i got it

thank you very much! 😀

Reply
Giuseppe Friday January 23rd, 2015 - 10:27 PM

CIao Luca,
anzitutto complimenti, poi…..
non riesco a capire il codice arduino per accendere un led alla volta. In particolare quando entra nel loop, dove viene incrementato l’indirizzo di memoria dell’ HT1632 ? Io noto che anche ad ogni incremento di j l’indirizzo è sempre lo stesso. Come mai?
Ti ringrazio anticipatamente.

Reply
luca Saturday January 31st, 2015 - 10:15 AM

Ciao Giuseppe,

ad ogni “refresh” devi inviare lo stato (ON/OFF) di tutti i led… questo refresh viene gestito dal ciclo sulla variabile i. La variabile j che indica la posizione del led acceso viene invece incrementata nel loop() principale e – se è arrivata a 255, viene riportata a 0. Quindi il loop principale “cicla” la posizione del led acceso, mentre il loop interno invia al display – per ogni ciclo principale – lo stato di tutti i led.
bye

Reply
Man Saturday June 4th, 2016 - 09:08 PM

It’s really usefull.Great!Many thanks!

Reply
John @ LP Wednesday July 19th, 2017 - 12:33 PM

How fast can the LEDs be updated? I’d like to write to the matrix so that everything is lit, then send a new image 100 – 300 milliseconds later and repeat this at least 10 times over 3 seconds.
thanks,
John

Reply
luca Wednesday July 19th, 2017 - 04:30 PM

Hi John, the controller’s datasheet reports a clock of 256Khz and a frame length of 8*328 ticks… so if your microcontroller is fast enough, you should be able to update the matrix display at the rate you need.

Reply

Leave a Comment

1 × five =