MatrixDisplay 16×16
Inputs
| Pin | Type | Description |
|---|---|---|
| DevAddr | bus8 | Device address — 0x1C sets X, 0x1D sets Y, 0x1F sets pixel value |
| DataIn | bus8 | Data — X coordinate, Y coordinate, or pixel value (1 = on, 0 = off) |
| WE | bit | Write enable — must be 1 to write a pixel |
| IO_SEL | bit | I/O select — must be 1 to activate the display |
Outputs
| Pin | Type | Description |
|---|
This element has no outputs.
How It Works
The MatrixDisplay is a 16×16 monochrome pixel matrix addressed through memory-mapped I/O ports:
- Port 0xFC (DevAddr = 0x1C): write the X coordinate (0–15).
- Port 0xFD (DevAddr = 0x1D): write the Y coordinate (0–15).
- Port 0xFF (DevAddr = 0x1F): write the pixel value (1 = lit, 0 = cleared). WE must be 1.
All writes require IO_SEL = 1. The protocol is sequential: first set X, then Y, then write the pixel. Coordinates outside 0–15 are ignored. The display persists across simulation steps — to clear the screen, write 0 to every pixel.
Writing protocol example:
; Draw pixel at (5, 10)
OUT 0xFC, 5 ; X = 5
OUT 0xFD, 10 ; Y = 10
OUT 0xFF, 1 ; pixel ON at (5, 10)
Usage
The MatrixDisplay is used in the following levels:
- Level 24: display a static pixel pattern.
- Level 27: display text characters.
- Level 28: animated moving dot across the screen.
- Level 29: Snake game — food placement, snake rendering, and collision detection.
To use the display in your own circuits, connect it to the I/O subsystem via BusAND-gated data bus, and drive IO_SEL, DevAddr, DataIn, and WE from your control logic.