AT28C256 EEPROM Emulation Specification

January 20, 2026 · View on GitHub

Overview

This document specifies how to emulate the AT28C256 (32 KB Parallel EEPROM) in a 6502-based system emulator. The goal is behavioral accuracy suitable for SBCs, monitors, and real ROM images, not just generic file-backed storage.

The AT28C256 is commonly used as ROM in 6502 systems, but it is electrically writable and has timing behaviors that differ from SRAM.


Chip Summary

ParameterValue
Capacity32 KB (256 Kbit)
Organization32,768 x 8
Address LinesA0-A14
Data LinesD0-D7
Supply Voltage5V
Typical UseROM / Firmware storage

Pin Definitions

PinNameFunction
A0-A14AddressByte address
D0-D7DataData bus
/CEChip EnableActivates chip
/OEOutput EnableEnables output drivers
/WEWrite EnableTriggers write cycle
VCC+5VPower
GNDGroundReference

Read Cycle Behavior

A read occurs when:

/CE = 0
/OE = 0
/WE = 1

Read Rules

  • Address must be stable before /OE is asserted
  • Data appears on D0-D7 after access time (ignored in most emulators)
  • Output is high-impedance when /OE = 1 or /CE = 1

Emulator Behavior

if CE == 0 and OE == 0 and WE == 1:
    data_bus = memory[address]
else:
    data_bus = Z

Write Cycle Behavior

A write occurs when:

/CE = 0
/WE = 0

(/OE is typically HIGH during writes)

Important EEPROM Characteristics

  • Writes are not instantaneous
  • Each write triggers an internal programming cycle
  • During programming, reads may return undefined data

Write Timing Model (Simplified)

Real Hardware

ParameterTypical
Byte Write Time~200 µs
Page Size64 bytes
Page Write Time~10 ms

Emulator Simplification Options

Option A - Instant Writes (Common)

  • Write immediately updates memory
  • No busy state
  • Recommended for early emulators

Option B - Cycle-Based Busy State (Advanced)

  • Track a "write in progress" timer
  • Reads during write return last value or 0xFF
  • Writes ignored until cycle completes

Page Write Emulation (Optional)

  • Page size: 64 bytes
  • Writes within same page before timeout commit together
  • Crossing page boundary wraps within page (hardware quirk)

Simplified rule:

page_base = address & 0xFFC0
page_offset = address & 0x003F

Write Protection Behavior

Some systems treat EEPROM as ROM-only after programming.

Emulator may support:

  • Read-only mode (writes ignored)
  • Programmable mode (writes allowed)
  • Runtime toggle (simulates programming jumper)

Power-Up State

  • EEPROM retains contents
  • No undefined data on power-up

Emulator should:

  • Load contents from image file
  • Preserve data across resets

Bus Contention Rules

ConditionBehavior
/CE = 1Data bus = Z
/OE = 1Data bus = Z
/WE = 0 and /OE = 0Undefined (avoid)

Emulator may:

  • Prioritize write
  • Or flag invalid state

Memory Mapping in 6502 Systems

Common layout:

\$0000-\$7FFF  RAM
\$8000-$FFFF  AT28C256 EEPROM

Reset Vector Usage

VectorAddress
RESETFFFCFFFC-FFFD
NMIFFFAFFFA-FFFB
IRQFFFEFFFE-FFFF

Emulator API Model

typedef struct {
    uint8_t memory[32768];
    bool write_enabled;
    bool busy;
    uint32_t busy_cycles;
} AT28C256;

Read

uint8_t eeprom_read(addr);

Write

void eeprom_write(addr, value);

FeatureSetting
Write DelayDisabled
Page ModeDisabled
Write ProtectEnabled
PersistenceFile-backed

Testing Checklist

  • Reset vector fetch
  • ROM reads under normal execution
  • Writes ignored in read-only mode
  • Correct address masking (15 bits)
  • No bus drive when disabled

References


Notes

This specification intentionally mirrors real hardware quirks while allowing emulator authors to choose between simplicity and accuracy. It is suitable for:

  • Educational emulators
  • SBC simulation
  • ROM development workflows
  • Integration with 6502 + 6522 + SRAM emulation