Retro computing field guide · Part 5

How to add 8K of SRAM to a 6502 computer

A 6502 needs writable memory for its stack, variables and changing data. An 8K×8 SRAM can provide 8,192 byte locations—but it must be selected only in its own address window, and only one device may drive the data bus.

Start with the 6502 parts guide

What “8K × 8” means

The 8K counts locations, not bits: 8,192 addresses each hold an eight-bit byte. That is 8 KB, or 65,536 bits. Thirteen address inputs, A0–A12, select one location (2¹³ = 8,192). Eight bidirectional I/O pins carry the byte. Static RAM retains its contents while powered and does not need refresh, but it is volatile: power loss erases the data.

Give the SRAM one address window

A 6502 has a 16-bit address bus, so its full map is 64 KB. In this example, the SRAM occupies $0000–$1FFF. Its A0–A12 connect to the corresponding CPU address bits. The higher bits A13–A15 go to an address decoder. When all three are zero, the decoder asserts a select signal; otherwise the RAM must stay silent. A 74HC138 can provide an active-low Y0 output for this window, as explained in the address-decoding guide. Other 8K windows may be assigned to ROM or I/O, but a usable computer also needs its reset vector in ROM at $FFFC–$FFFD.

64 KB 6502 map with $0000–$1FFF assigned to an 8K SRAM; A15–A13 decode the window and A0–A12 select a byte.
A15–A13 choose the 8 KB window; A0–A12 choose one byte inside it. This is a conceptual map, not a complete circuit.

Read and write are different bus transactions

The Fujitsu MB8464A has two chip selects: /CS1 must be low and CS2 high. For a read, /WE remains high and /OE goes low; the SRAM then drives its data pins after its access delay. For a write, the CPU drives the byte and /WE goes low while the SRAM is selected. The datasheet says /OE is irrelevant during a write. When the SRAM is not selected, its outputs are high impedance so another chip can use the bus. The 6502 R/W pin is high for a read and low for a write, but a real design must qualify these signals with the valid bus phase and check the chip’s timing—not simply wire every control pin straight through.

CPU address and data buses connected to SRAM, with separate address-decode and read/write control reaching chip select, output enable and write enable.
A read lets the selected SRAM drive D0–D7; a write lets the CPU drive them. Never allow two selected devices to drive the data bus at once.

Find the 28 pins before wiring

On the MB8464A, pin 28 is +5 V and pin 14 is ground. Pin 20 is /CS1, pin 26 is CS2, pin 22 is /OE and pin 27 is /WE. Pin 1 is NC, not another address bit. The drawing is a top view; check the notch and the exact package before placing a chip. The shop’s MB8464A-10LP-SK is the narrow 28-pin PSK through-hole variant; similar 6264-class chips may have different package shapes or control-pin conventions, so compare their own datasheets rather than assuming drop-in equivalence.

Top-view MB8464A 28-pin pinout showing A0–A12, I/O1–I/O8, /CS1 on pin 20, CS2 on 26, /OE on 22 and /WE on 27.
MB8464A pin assignment, redrawn from the Fujitsu datasheet. The package notch is at the top.

A useful first bench check

Start with the CPU held in reset or use a controlled test fixture. Confirm +5 V and ground, then verify that only the intended address range selects the SRAM. During a read, look for valid data after the access-time limit; during a write, confirm address and data are stable for the required setup and hold times. The -10 part has a 100 ns maximum address access time under the datasheet conditions; that number alone does not prove a whole 6502 system will meet timing. Add supply decoupling close to the IC and avoid connecting a 5 V part directly to a lower-voltage bus without checking logic levels.

Parts and next step

The shop carries the Fujitsu MB8464A-10LP-SK 8K×8 SRAM and SRM2264LC12 8K×8 SRAM. Check the current listing and each manufacturer’s datasheet for the exact package and timing. If address selection is new to you, read how the 74HC138 selects a memory chip; the 6502 parts guide shows where RAM fits in the larger machine.

Source: Fujitsu MB8464A datasheet (April 1990, edition 3.0). PDF.