MyIDE Interface

Year
1999
Type
DIY project
Category
IDE / CompactFlash hard disk interface
Manufacturer
Homebrew design by Sijmen Schouten (SimonSoft / Mr. Atari); later PCBs and MyIDE-II by Atarimax
Close-up of a small MyIDE circuit board fitted inside an Atari XE Game System, with a PLCC flash OS socket, logic chips and a 40-pin IDE header, wired to the motherboard.

Overview

MyIDE is probably the simplest hard-disk interface ever designed for the Atari. Sijmen Schouten, known as "Mr. Atari" and publishing as SimonSoft, documented it around 2000. It connects a standard 40-pin IDE drive, and later a CompactFlash card through an adapter, to an XL or XE using two cheap 74LS logic chips and a handful of wires. The drive's own controller does all the hard work. The Atari just reads and writes eight IDE task-file registers mapped into one page of I/O space.

There are two builds: a cartridge version decoded at $D500 (the CCTL cartridge-control page), and an internal version at $D100, wired onto the BASIC ROM socket and the 74LS138 address decoder. The project ran from 1999 to 2006. Version 3 appeared in August 2002, and from autumn 2002 a printed circuit board was offered for a grey cartridge shell or internal fitting. Atarimax later produced the MyIDE+Flash (2006) and the CompactFlash-based MyIDE-II (2012), and Jonathan Halliday wrote SpartaDOS X drivers for all of them.

How it works

Only IDE address lines A0–A2 matter. They select one of eight registers at the base address:

Offset Read Write
+0 data data
+1 error (precomp, unused)
+2 sector count (0 = 256) same
+3 sector number same
+4 / +5 cylinder low / high same
+6 drive/head (bit 4: master/slave) same
+7 status command

To read a sector, the driver clears the error register, selects drive and head, waits for status bit 7 (busy) to clear, writes sector, cylinder and count, then issues command $21. When status bit 3 (data request) sets, it pulls 512 bytes from the data register. Writing uses command $31: push 512 bytes, then wait for busy to drop. Because the interface is 8-bit, only the low byte of each 16-bit IDE word is used.

The glue logic turns the Atari's single R/W line and the Φ2 clock into IDE's separate /IOR and /IOW strobes. Φ2 goes through a 74LS04 inverter, then a 74LS32 OR gate with R/W makes IOwrite, and a second OR with inverted R/W makes IOread. The IDE chip select comes straight from the Atari's page-select line: cartridge pin 15 (/CCTL) for the external version, or 74LS138 pin 14 for the internal one. Pins 1 and 38 are pulled up to +5 V through 4.7 kΩ.

Building it

Cartridge version (chapter 2A): an IDE ribbon cable with one end cut off, a 74LS04, a 74LS32 and a scrap XE cartridge board for the edge connector. The documentation gives the full pin-for-pin map. Data lines D0–D7 go to cartridge pins 10, 9, 8, L, 6, 7, 11 and M, A0/A1/A2 to pins 5, 4 and 3, and ground to pin B. Power comes from pin 13 (+5 V), and Φ2 and R/W come from pins S and R.

Internal version (chapter 2B): the same two chips, wired to the BASIC ROM (U4) for data, address, +5 V and ground, to CPU pins 36 (R/W) and 39 (Φ2), and to the 74LS138 for chip select.

Both are modest soldering jobs. You need to be comfortable working on a motherboard, but no programmable logic is involved.

Software

  • TESTER.BAS and FDISK.BAS run in plain Atari BASIC. They probe PEEK(53504+7) ($D107) and then PEEK(54528+7) ($D507), and a status value below 128 means a drive answered. (The original register table pairs the hex addresses with the wrong decimal values; the BASIC programs use the correct ones.)
  • FDISK stores the drive geometry and up to 15 partition entries in track 0. Each entry gives a logical drive number, start and end cylinder, and density (128 or 256 bytes per sector).
  • The driver copies the OS from ROM to RAM, installs itself in the area normally used by the international character set, and hooks the SIO vector. Calls for D: devices that map to a partition go to the hard disk, and everything else falls through to normal SIO. It verifies on both reads and writes. It occupies $CC00–$E000 and $570–$57F, so it needs an XL/XE with RAM under the OS. In practice the system requires a modified XL OS.
  • A later note explains how to make page $D7 into RAM (by cutting one pin of a 74LS08 on XLs, or of the CO61991 on XEs) so the SOS2000 operating system can run.

Using it today

A CompactFlash card in a cheap CF-to-IDE adapter is the easy way to give MyIDE silent, solid-state storage. If you'd rather not build one, the later Atarimax MyIDE-II cartridge, and drivers from atari8.co.uk, carry the design forward. Altirra emulates MyIDE and MyIDE-II as devices; its changelogs list MyIDE support, including slave drives. The Altirra Hardware Reference Manual documents the cartridge version's ATA registers at $D500–$D507 in 8-bit transfer mode. That makes it easy to build and test a disk image on the PC before writing it to a CF card.

Credits