# EEPROMs and the real-time clock WSDEV "EEPROM", "Internal EEPROM", "Real-Time Clock", "Bandai 2001", "Bandai 2003", "S-3511A pinout" at the pinned revisions. ## The Microwire interface Two identical controllers: internal (ports BAh-BFh) and cartridge (C4h-C9h, on the 2001 mapper's carts). A 16-bit command word (start bit, opcode, address; three layouts for 6-, 8- and 10-bit addresses) and a 16-bit data word; the control port starts a Read (16 bits out, 16 in), a Write (16 out, 16 out, then chip select dropped and re-raised while the EEPROM reports completion) or a Short (16 out) operation; the internal one also has Protect. More than one operation bit, or Abort on the cartridge side, cancels the request and clears all four bits. Command bits shift out MSB first. Commands: READ, WRITE, ERASE, EWDS, WRAL, ERAL, EWEN (M93LCx6 family). Parts (all M93LCx6-compatible): internal 1 Kbit (WS) and 16 Kbit (WSC, SC); cartridge 1 Kbit, 8 Kbit, 16 Kbit; WSDEV also lists 256-bit and 2 Kbit parts. The SPHINX emulates a 93C46 when running a mono game by rewriting the command it shifts out ("TODO: how exactly", U7). Errata on the page: the cartridge controller's Done bit is buggy; ASWAN's internal controller misbehaves on non-word access (U8: the board needs the exact rule). ## Internal EEPROM contents 128 bytes on WS, 2 KiB on WSC/SC, none on PCV2. Bytes 00h-5Fh are program data, writable even when protected (for moving saves between cartridges); 60h onward hold the owner's name (16 characters in a custom set), birthday, gender, blood type, the last booted game's publisher, colour and game id, and counters; colour models add the custom splash screen and its animation, which the boot ROM plays ("Internal EEPROM", "Splash animation"). A header bit (safe mode, byte 9 bit 7) and the colour boot ROM decide protection. **The board never ships an EEPROM image**: MAME's images are marked baddump; a player's own dump or a freshly formatted image (owner fields blank, splash off) is loaded (open decision 4). ## The S-3511A RTC (2003 mapper) Seiko's serial RTC, driven through the 2003 mapper's CAh (command/status) and CBh (payload). Registers: status/configuration (power-failure flag cleared by Reset or a status read, 12/24-hour mode, interrupt mode bits), date-time (BCD), alarm/frequency. The mapper's command numbers map onto the chip's; some do not (19h makes the mapper read an alarm of FFFFh "the S-3511A disagrees"; 1Ah sends two bytes the chip ignores). Interrupt modes: disabled, alarm (edge, at the set hour and minute), frequency (level, from the sub-second prescaler masked by the alarm register), per-minute edge (the first 10 ms of each minute) and per-minute steady (level); /IRQ reaches the cartridge interrupt ("Real-Time Clock"). Timing of the serial exchange: "Timing" page and the datasheet (not fetched; U9). Census: MAME's software lists mark 2 mono and 10 colour titles with an RTC (``). ## Chip rule | Chip | Other family users | Proposal | | --- | --- | --- | | M93LCx6 Microwire EEPROM | Atari Lynx carts can carry a 93C46 (lynx-python's documents to confirm) | stays in this board as a class with a pin-shaped interface; extract when a second board needs it (open decision 5) | | Seiko S-3511A RTC | Game Boy Advance carts (Pokémon Ruby/Sapphire/Emerald) use an S-3511A (gba-python to confirm) | same; the most likely shared chip of this board |