
A single-wire controller for an 8-line charlieplexed matrix (56 LEDs). uio[7:0] are the matrix lines. The controller scans 8 phases: in each phase one line is driven high (anode), lit cathodes are driven low and every other line is Hi-Z (uio_oe = 0).
Each LED is on/off, and a global 4-bit PWM intensity sets the brightness of the whole matrix.
Serial input is UART 8N1 on ui[0] (LSB first). Bit period = 16 << ui[3:1] clocks. PWM step = 2^ui[6:4] clocks. ui[7] low puts all lines in Hi-Z.
Byte format:
b[7:6] non-zero = on, 0 = off, b[5:3] = anode line, b[2:0] = cathode line (anode != cathode).b[7:6] = data):
b6Run at ~10 MHz, set ui[3:1]=3 (about 78 kbaud) and ui[6:4]=6, ui[7]=1. Send 0xC1 (LED anode 0, cathode 1, full brightness) from a UART.
An 8-line charlieplex LED matrix (a series resistor per line), and an MCU or UART source.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | RX (serial in) | phase 0 (debug) | LED line 0 |
| 1 | baud sel 0 | phase 1 (debug) | LED line 1 |
| 2 | baud sel 1 | phase 2 (debug) | LED line 2 |
| 3 | baud sel 2 | byte received pulse | LED line 3 |
| 4 | scan speed 0 | LED line 4 | |
| 5 | scan speed 1 | LED line 5 | |
| 6 | scan speed 2 | LED line 6 | |
| 7 | output enable | LED line 7 |