BadSector "A" Hardware and Software
Downloads
Orcad schematic in PDF format (V2.0)
C source code V2.00 (zipped)
Atmel AT89S53 Datasheet in PDF format
Hardware Overview
The current implementation uses the Atmel AT89S53 processor for each of
construction. The Atmel part supports in-circuit programming capability
for its 12k byte of internal flash ROM. This saves wiring up an external
EPROM chip. The Atmel part is pinout compatible with the standard 8031/8051
device. Although the Atmel device has a second DPTR, it is not used for
the sake of compatibility. There is no reason that an external EPROM can't
be used. A later schematic will show how this can be done.
Note that the IDE interface is designed around the Intel 8088 CPU bus
interface. Interestingly the 8031 architecture is also an Intel design
and shares a very similar bus interface. This meant connecting the IDE
drive to the 8031 was easy (once the penny had dropped!). A big difference
between the two processors is that the 8088 has a 16 bit databus and the
8031 an 8 bit databus. As a consequence only half of the IDE databus is
connected. This doesn't actually matter as only the write and read data
use the full width of the bus. The 512 byte sectors are accessed as 256
words of 16 bits. In this design half the data is lost. This is not a problem
as it still leaves 256 bytes per sector which maps perfectly with the Atari
double density format. In fact for the implementation of single density
format (128 bytes per sector) the "top" half of the 256 bytes of data per
sector is ignored. Therefore real hardware sectors map to Atari sectors
whatever the density. Neat!
Software Overview
The software was developed nearly completely in C using the SDCC free C
compiler. Machine code has been used in a few places for efficiency.
TODO
-
Support double density 256 byte sector IO. This is an interesting problem
since the data packet size plus the checksum byte is 257 bytes total, which
overflows a single page of memory. A 16 bit pointer is now required to
replace the current 8 bit pointer.
-
Support both large disk drive + many virtual floppy disks. May need to
put the configuration information into the very first (few?) sectors.
-
Add private commands recognised by the "BA" device.
-
Support warp speed IO (like the Happy Mod). This may be the same as US
Doubler - not sure. Need to understand more.
-
Write formatting software to run on the Atari which will also allow the
drive parameters (#cylinders, #sectors per track & #heads) to be downloaded
and stored.
Return to Atari Projects home page