Led matrix with HT1632C controller (2)

luca 03/10/2012 8

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;

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

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

Pages: 1 2

8 Comments »

  1. Mike 07/01/2013 at 04:13 - Reply

    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

  2. 123 23/12/2013 at 21:06 - Reply

    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 :(

    • luca 24/12/2013 at 08:48 - Reply

      Hi Ahmet,

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

  3. Ahmet 25/12/2013 at 14:49 - Reply

    Hello

    Luca thank you its no problem, i got it

    thank you very much! :D

  4. Giuseppe 23/01/2015 at 22:27 - Reply

    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.

    • luca 31/01/2015 at 10:15 - Reply

      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

  5. Man 04/06/2016 at 21:08 - Reply

    It’s really usefull.Great!Many thanks!

Leave A Response »

This website uses cookies to ensure you get the best experience on our website maggiori informazioni

Questo sito utilizza i cookie per fonire la migliore esperienza di navigazione possibile. Continuando a utilizzare questo sito senza modificare le impostazioni dei cookie o clicchi su "Accetta" permetti al loro utilizzo.

Chiudi