Displays

de:volt models two classic hobbyist displays: the MAX7219 8x8 LED matrix and the HD44780 16x2 character LCD. Both are driven by bit-banged GPIO output from your Arduino sketch — the simulator decodes the serial or parallel protocol straight off the pin transitions and renders the resulting pixels or characters. You wire them exactly as you would on a real breadboard.

MAX7219 8x8 LED Matrix

The MAX7219 is an SPI-controlled driver for a 64-LED (8x8) matrix. It accepts 16-bit serial frames (an 8-bit register address followed by an 8-bit data byte) over a 3-wire SPI-compatible interface: DIN, CLK, and CS.

Pinout

PinLabelDescription
dinDINSerial data in (from MCU data-out)
clkCLKSerial clock (from MCU clock-out)
csCSChip-select / load; idles HIGH, pull LOW to start a frame
vccVCC4.0–5.5 V supply
gndGNDGround

Registers

The simulator decodes the standard MAX7219 register map:

RegisterFunction
0x01–0x08Digit/row data — the 8 row bytes
0x0AIntensity (0–15)
0x0BScan limit (0–7 rows active)
0x0CShutdown (1 = normal, 0 = shutdown)
0x0FDisplay test (all LEDs on)

Within each row byte, bit 7 is the leftmost column and bit 0 is the rightmost column. The simulator drives the matrix in raw mode, so write 0x00 to the decode-mode register (0x09); a non-zero BCD decode setting is stored but not rendered.

How the frame works

CS idles HIGH. To send a frame, pull CS LOW, clock 16 bits in MSB-first on the rising edge of CLK, then pull CS HIGH to latch the address/data pair into the chosen register. A typical startup sequence is: 0x0C = 0x01 to exit shutdown, 0x0B = 0x07 to enable all 8 rows, 0x0A = 0x08 for mid-intensity, then write rows 0x010x08 with your pixel patterns.

Single device only

v1 models a single MAX7219. There is no DOUT pin, so daisy-chaining multiple drivers is not supported.

Electrical model

Logic inputs are CMOS (V_IL max 0.8 V, V_IH min 3.5 V) and carry 1 MΩ pulldown insurance stamps, so undriven pins resolve to LOW rather than floating. The supply is modelled as a 150 Ω behavioural load (~33 mA at 5 V) standing in for a representative lit matrix. Per-LED current is out of scope for v1 — the teaching focus is the decoded pixel pattern.

Example circuit

Arduino D11 ─── DIN
Arduino D13 ─── CLK   ──  [MAX7219 8x8]
Arduino D10 ─── CS
            5V ─── VCC
           GND ─── GND

HD44780 16x2 Character LCD

The HD44780 is the ubiquitous 16-character by 2-line text display. It uses a parallel interface: the control lines RS, RW, and E plus an 8-bit data bus D0–D7. It runs in either 8-bit mode (all eight data lines) or 4-bit mode (D4–D7 only, two nibbles per byte) — both are supported via the function-set DL bit.

Pinout

PinLabelDescription
vssVSSGround
vddVDD4.5–5.5 V supply
v0V0Contrast — pot wiper, or tie to GND for max contrast
rsRSRegister select (0 = command, 1 = data)
rwRWRead/write — tie to GND (write-only)
eEEnable strobe; data latches on the falling edge
d0–d7D0–D7Parallel data bus (use D4–D7 in 4-bit mode)
aABacklight anode
kKBacklight cathode

Command subset

The simulator decodes the common HD44780 command set:

CommandFunction
0x01Clear display
0x02 / 0x03Return home
0x04–0x07Entry mode set
0x08–0x0FDisplay / cursor on/off
0x20–0x3FFunction set (4/8-bit, 1/2-line)
0x80–0xFFSet DDRAM address

DDRAM addresses 0x00–0x0F map to line 1 and 0x40–0x4F to line 2 (only the first 16 positions of each 40-byte bank are visible). ASCII codes 0x20–0x7E render; anything outside that range shows as a space. Cursor/display-shift (0x10–0x1F) is accepted but not rendered, and custom CGRAM glyphs are not supported in v1.

No read-back

The RW pin is sampled but read-back is not implemented. Tie RW to GND so the display is always in write mode — the busy-flag read used on real hardware is not available here.

Electrical model

Logic inputs (RS/RW/E/D0–D7) are CMOS with 1 MΩ pulldown insurance stamps. The supply is modelled as a 200 Ω behavioural load (~25 mA at 5 V) representing logic plus backlight draw. V0 sets contrast; in a real circuit connect it to a 10 kΩ pot wiper, or tie it to GND for maximum contrast. The backlight (A/K) draws through a current-limiting resistor on hardware — module-dependent, typically 47–100 Ω.

Example circuit (4-bit mode)

Arduino D12 ─── RS
            GND ─── RW
Arduino D11 ─── E
Arduino D5  ─── D4
Arduino D4  ─── D5   ──  [HD44780 16x2]
Arduino D3  ─── D6
Arduino D2  ─── D7
            5V ─── VDD
           GND ─── VSS
   10k pot wiper ─── V0

In 4-bit mode leave D0–D3 unconnected. A typical init is: function set 0x28 (4-bit, 2-line), 0x0C (display on), 0x01 (clear), 0x06 (entry mode), then write character bytes with RS = 1.

Both decode bit-banged output

Neither part needs special simulator hooks. de:volt watches the GPIO pins your sketch toggles, reconstructs the MAX7219 serial frames or the HD44780 parallel writes from those transitions, and updates the rendered display. Standard bit-banged Arduino code — or the common LedControl / LiquidCrystal-style sequences shown above — drives them directly.