Skip to content

Display

The display on the Arcade Coder is a 24x24 LED matrix. Each pixel works in 3-bit colour (giving 8 total colours). Each pixel also serves as a button.

The matrix is split into groups by row. The multiplexer selects the rows to be drawn to, and the data is sent to the rows via the shift register.

Pins

HC595 Shift Register

ESPShift Register
GPIO5Data In
GPIO17Clock
GPIO16Latch
GPIO4Output Enable

ICN2012 Multiplexer

The rows are selected by setting different combinations on the multiplexer.

ESPMultiplexer
GPIO19A0
GPIO18A1
GPIO21A2
A0A1A2Rows
000?
0014 & 9
0101 & 6
0116 & 12
1005 & 10
1013 & 8
1102 & 7
111?

Driving

  1. For each row, set the multiplexer (A0, A1 & A2) according to the table above to select the rows to be drawn to. Consider adding a short (e.g. 50µs) delay afterwards for the output to stabilize.
  2. Set output enable low, which is left low for the entire process, and set latch low.
  3. Write data out using the SPI bus for accurate timing. Otherwise, send each bit (MSB), setting the clock high, then low after each bit with a short delay.
  4. Set latch high, wait for a short time (e.g. 50µs), then set latch low.
  5. Repeat for other rows.

Ideally, you want to run this loop as fast as possible (≥ 30 times per second) for a proper persistence of vision effect.

Data Format

The data sent to each of the two rows is 9 bytes (or 72 bits). The bits are inversed, with a 0 representing the on state and a 1 representing off.

For testing, sending 9 bytes of 0xffffffff should result in all white LEDs, and 0x00000000 should turn off all the LEDs.

The table below is ordered with most significant bit first.

Byte 8 7 6 5 4 3 2 1
1 Green, pixels 5-12, top row
2 Red, pixels 5-12, top row
3 Blue, pixels 5-12, top row
4 Green, pixels 1-4, bottom row Green, pixels 1-4, top row
5 Red, pixels 1-4, bottom row Red, pixels 1-4, top row
6 Blue, pixels 1-4, bottom row Blue, pixels 1-4, top row
7 Green, pixels 5-12, bottom row
8 Red, pixels 5-12, bottom row
9 Blue, pixels 5-12, bottom row