ESP8266/Matrix

From Noisebridge
Jump to navigation Jump to search

Hacking on old Sure Electronics LED Matrix Displays.

The "current" generation of displays from sure use HT1632C chips and are referred to as 3208 with four 8x8 modules on a single board. The "original/older" displays use the HT1632 chip (no 'C') and are referred to as 0832, I've managed to get several of these working with some minor modifications and fiddling.

Wiring

For a single display you'll need 5 wires. +5v, Ground, CS1, WR, and data. You can connect up to 4 displays chained together by additionally connected CS2, CS3, and CS4. Set the dip switch on the back of each board so that only the switch corresponding to that boards position, starting with 1, is "on".

HT1632-for-Arduino

This seems to be the most popular library and looks to be designed for the newer boards, a few edits and it will work with the 0832's as well. https://github.com/gauravmm/HT1632-for-Arduino

The only real difference between using the HT1632 & HT1632C seems to be teh initialization. There's a bit more on that here http://timewitharduino.blogspot.com/2011/10/difference-between-3208-and-0832-led.html

To modify the library to additionally support 0832, do the following.

Edit HT1632.h and add #define LEGACY_0832 1

If you haven't already done so comment out #define TYPE_3216_BICOLOR 1 and uncomment #define TYPE_3208_MONO 1

Then edit HT1632.c and find this section

// Custom initialization from each:
#if defined TYPE_3208_MONO
	writeCommand(HT1632_CMD_COMS00);
#elif defined TYPE_3216_BICOLOR
	writeCommand(HT1632_CMD_COMS00);
	writeCommand(HT1632_CMD_RCCLK);  // Master Mode, external clock
#else
	writeCommand(HT1632_CMD_COMS00);
#endif

Change it to the following, by adding the additional if for legacy

// Custom initialization from each:
#if defined TYPE_3208_MONO
	#if defined LEGACY_0832
		writeCommand(HT1632_CMD_COMS10);  // PMOS drivers
		writeCommand(HT1632_CMD_MSTMD);  // Master Mode
	#else
		writeCommand(HT1632_CMD_COMS00);
	#endif
#elif defined TYPE_3216_BICOLOR
	writeCommand(HT1632_CMD_COMS00);
	writeCommand(HT1632_CMD_RCCLK);  // Master Mode, external clock
#else
	writeCommand(HT1632_CMD_COMS00);
#endif

When using the Text examples, comment out or do not use the line HT1632.drawTarget(BUFFER_BOARD(1));

Other Code

This library which is a re-packaging of the original code from sure will run with a couple of updates on Arduino http://download.milesburton.com/Arduino/Sure2416/MatrixDisplay_201B_0832Version.zip

There seems to be some issues with the newer versions of the Arduino IDE. You need to comment out the includes for wiring.h in the header files. You also need to modify the MatrixDisplay.cpp file by removing the calls to the pinMode() method, set these in your setup function of your main code file instead. In font.h you need to add const to the beginning of the myfont variable declaration.

If you are using a Leonardo the Serial.println() calls also need to be removed.

There is some additional info and vids available at http://www.milesburton.com/HT1632_Arduino_%22Matrix_Display%22_Library_for_the_Sure_2416_and_0832