A new blog post about my led matrix display with a first example about interfacing it with Arduino…
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:
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):
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.
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…