
A complete MOS Technology 6502-compatible CPU with integrated peripherals, designed specifically for TinyTapeout. Features a bus multiplexer architecture to efficiently expose the full 64KB address space and peripheral functions through the limited 24-pin interface.
The 6502 MCU consists of three main components:
All memory accesses outside the peripheral range (0xA000-0xA047) are routed to the external bus via the multiplexer, allowing up to ~64KB of external RAM/ROM.
The multiplexer reduces pin count by sequencing through 4 phases within each CPU cycle:
| MUX_SEL | Phase | Direction | Data |
|---|---|---|---|
01 |
ADDR_HI | MCU → Ext | Address[15:8] |
00 |
ADDR_LO | MCU → Ext | Address[7:0] |
10 |
DATA_IN | Ext → MCU | Read data |
11 |
DATA_OUT | MCU → Ext | Write data |
The external controller (RP2040 on TinyTapeout demo board) monitors PHI2 and sequences MUX_SEL accordingly. There is no performance penalty - all phases complete within one CPU cycle.
| Address Range | Size | Description |
|---|---|---|
| 0x0000-0x9FFF | 40KB | External memory |
| 0xA000-0xA00B | 12B | GPIO registers |
| 0xA010-0xA017 | 8B | Reserved |
| 0xA020-0xA027 | 8B | Timer |
| 0xA030-0xA033 | 4B | Clock control |
| 0xA040-0xA047 | 8B | UART |
| 0xA048-0xFFFF | ~22KB | External memory |
Typical configuration: RAM at 0x0000-0x7FFF, ROM at 0x8000-0xFFFF with reset vector at 0xFFFC.
| Pin | Function | Description |
|---|---|---|
| 0 | MUX_SEL[0] | Bus phase select bit 0 |
| 1 | MUX_SEL[1] | Bus phase select bit 1 |
| 2 | RDY | CPU ready signal (active high) |
| 3 | NMI_N | Non-maskable interrupt (active low) |
| 4 | IRQ_N | Interrupt request (active low) |
| 5 | SO_N | Set overflow flag (active low) |
| 6 | GPIOA0 | GPIO pin 0 input (unidirectional) |
| 7 | GPIOA1 | GPIO pin 1 input (unidirectional) |
| Pin | Function | Description |
|---|---|---|
| 0 | PHI1 | CPU phase 1 clock |
| 1 | PHI2 | CPU phase 2 clock |
| 2 | R/W | Read/write signal (1=read, 0=write) |
| 3 | SYNC | Opcode fetch indicator |
| 4 | GPIOA2 | GPIO pin 2 output (unidirectional) |
| 5 | GPIOA3 | GPIO pin 3 output (unidirectional) |
| 6 | GPIOA4 | GPIO pin 4 output (unidirectional) |
| 7 | GPIOA5 | GPIO pin 5 output (unidirectional) |
| Pin | Function | Description |
|---|---|---|
| 0-7 | MUX_DATA[7:0] | Multiplexed address/data bus |
Testbenches use cocotb:
cd test
make
Tests cover:
Technology: IHP SG13G2 130nm Die Size: 2×2 TinyTapeout tiles Clock: 20 MHz nominal
Tiny Tapeout is an educational project that makes it easier and cheaper to get your digital designs manufactured on a real chip. Learn more at tinytapeout.com.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | MUX_SEL[0] - Bus phase select bit 0 | PHI1 - CPU phase 1 clock | MUX_DATA[0] - Multiplexed address/data bus |
| 1 | MUX_SEL[1] - Bus phase select bit 1 | PHI2 - CPU phase 2 clock | MUX_DATA[1] - Multiplexed address/data bus |
| 2 | RDY - CPU ready signal | R/W - Read/write signal (1=read, 0=write) | MUX_DATA[2] - Multiplexed address/data bus |
| 3 | NMI_N - Non-maskable interrupt | SYNC - Opcode fetch indicator | MUX_DATA[3] - Multiplexed address/data bus |
| 4 | IRQ_N - Interrupt request | GPIOA2 - GPIO pin 2 output (unidirectional) | MUX_DATA[4] - Multiplexed address/data bus |
| 5 | SO_N - Set overflow flag | GPIOA3 - GPIO pin 3 output (unidirectional) | MUX_DATA[5] - Multiplexed address/data bus |
| 6 | GPIOA0 - GPIO pin 0 input (unidirectional) | GPIOA4 - GPIO pin 4 output (unidirectional) | MUX_DATA[6] - Multiplexed address/data bus |
| 7 | GPIOA1 - GPIO pin 1 input (unidirectional) | GPIOA5 - GPIO pin 5 output (unidirectional) | MUX_DATA[7] - Multiplexed address/data bus |