# The IEEE-488 bus and the drives on it ## The bus on the PET side (DOC: SCH-320349 sheets 2-3; UM2001 tables 7.3, 7.25) The PET's IEEE-488 port is a 24-contact card edge (J1), not the standard connector (UM2001: "The standard IEEE-488 connector is not used on the PET"). Eight data lines and eight control lines, all open-collector, wired-AND (any device pulling low wins): | Line | PET output | PET input | | --- | --- | --- | | DIO1-8 | PIA2 port B | PIA2 port A | | DAV | PIA2 CB2 | VIA PB7 | | NRFD | VIA PB1 | VIA PB6 | | NDAC | PIA2 CA2 | VIA PB0 | | ATN | VIA PB2 | (none on sheet 3) | | EOI | PIA1 CA2 | PIA1 PA6 | | SRQ | (none) | PIA2 CB1 | | IFC | RESET through a 7417 | (none) | | REN | not connected (sheet 2 shows no REN) | | The transceivers are MC3446s on the dynamic board (sheet 2). The KERNAL drives the three-wire handshake in software, so the bus is slow (the 2031 manual: "IEEE-488 Bus 1.2K Bytes/sec" against "Internal 40K Bytes/sec", DOC SM2031) and its timing is set by the programs on both ends, which is good news for an emulator: **the channel is a set of levels**, sampled by each side's CPU. ### The socket `Ieee488Bus`: sixteen wired-AND lines, each device a `Protocol` with `drive(lines)` and a callback on change; the PET is one device, each drive another. With nothing attached the lines float high (pull-ups) and the KERNAL times out ("DEVICE NOT PRESENT"), which is the base board's gate. ## The drives (DOC: SM2040, SM2031, DRM; OBSERVED: `mame -listdevices`) | Drive | Processors | Other chips | DOS ROMs (MAME) | Format | | --- | --- | --- | --- | --- | | 2040 / 3040 | **6502** (UN1, IEEE and DOS) + **6504** (UH3, the drive controller), 1 MHz each | 2 x 6532 RIOT (UC1, UE1), 6530 (UK3, holding the controller's 1K firmware: OBSERVED, MAME's 1K `uk3` image), 6522 VIA (UM3) | 901468-06/-07 + 901466-01 (6530) | 35 tracks (HYPOTHESIS: DRM documents the 4040, not the 2040) | | 4040 | as the 2040 | as the 2040 | 901468-11..16 + 901466-04 | 35 tracks, 48 TPI, 174,848 bytes a drive; its disks read/write compatible with the 2031 and the VIC-1540, not the 8050/8250 (DRM) | | 8050 / 8250 / SFD-1001 | 6502 + 6504 | 2 x 6532, 6530 (UK3, firmware), 6522; "8050 FDC" at 6 MHz in MAME | 901482-03/-04, -06/-07, 901887/888 + 901483/884/885/869 | 77 tracks (8050); 154, 77 a side (8250) (DRM) | | 2031 / 2031LP | **one 6502**, 1 MHz | 2 x 6522 (UAB1, UCD4), the 1541's gate array logic (MAME: 64H156); IEEE transceivers 75160/75161 (SM2031) | 901484-03/-05 | 35 tracks (DRM) | SM2040's chip list: "6532 - E1, C1", "6530 - K3", "6504 - H3" (OCR p. 1 area) and a section per chip (6532 PIA, 6504 MPU, 6530 PIA, 6522 VIA). The two processors of the 2040 family share RAM (HYPOTHESIS here: the mechanism, a job queue in shared RAM by community accounts, is to be read off SM2040's schematics and cited by page in the drive's own Phase 0). ### Relation to `c1541-python` - The **2031 is a 1541 with an IEEE-488 front end** (one 6502, two 6522s, the same gate array logic; SM2031 "MOS 6502 microprocessor - 1 MHz clock"). Recommend a **`c2031` row in the shared `c1541-python`** (vic20/c64/plus4 Phase 0s), with an `Ieee488Bus` front end where the 1541 has its `IecBus` (open decision 5). - The **2040/3040/4040/8050/8250/SFD-1001 are a different machine**: two processors, 6532s, a 6530 with mask-ROM firmware, GCR written by the 6504 through the 6530/6532 ports. They need a board of their own, `cbm-ieee-drives-python` or `c8050-python` (provisional), pinning 6502-python twice (the 6504 is a 6502 die in a 28-pin package with 13 address lines, no NMI, RDY or SO pins: a **package row** in 6502-python, upstream request), the 6522 core, and a 6532 core (open decision 6). - The 6532 RIOT already lives in a2600-python (`riot.py`, used by the 2600 and pinned by the 7800 plan); the IEEE drives would be its third user: the chip rule says extract `riot6532-python` then. The 6530 (RRIOT: 1K mask ROM, 64 bytes RAM, I/O, timer) has no other family user: it stays in the drive board. ### Order The PET board does not need a drive to reach BASIC, nor to load programs: a host helper can put a `.prg` into RAM (MAME's quickload does the same). The drive boards come after the PET reaches its picture milestones; the 2031 row comes first (cheapest, shares the 1541's work).