Emulation of Fujitsu MB8877 Floppy Disk Controler with Arduino
ContextI have a Yamaha QX1 MIDI sequencer from 1984.
The backup medium is 5"1/4 floppy disks.
I want to replace the floppy drive (Canon MF-221) and the Floppy Disk Controler (Fujitsu MB8877a) with an Arduino.
DescriptionThe Fujitsu MB8877 is a second source for Western Digital FD1793.
(white pins are not connected on the QX1 DM board)
|37||/DDEN||Double Density||QX1||Permanently ↓ as we only use Double Density disks (256 bytes/sector)|
|3||/CS||Chip Select||QX1||Permanently ↓ (always selected)|
|24||CLK||Clock||QX1||Times the FDC logic; we don't use this signal to clock the Arduino. However, the clock starts only ~5.4 msec after powering up the QX1; before that, all signals are garbage.|
|19||/MR||Master Reset||QX1||Used during boot. MR ↓ ~4.6 msec after power up (the main CPU Hitachi HD68B09 only needs 110 nsec @ 8 MHz to boot).|
|7 to 14||DAL0-7||Data bus||both|| This bus is shared by several ICs on the board:
|5||A0||Address 0||QX1||Selects register (cf table below)|
|2||/WE||Write Enable||QX1||selects function (cf table below)|
|39||IRQ||Interrupt Request||FDC||Goes ↑ to warn the QX1 the previous command is completed|
|38||DRQ||Data Request||FDC||Goes ↑ to warn the QX1 data is available (read) or is required (write) on DAL0-7.|
|17(*)||Early||FDC||Pre-compensation signals. These signals are used to shift the timing of data to be written on the disk. 0=No pre-comp, 1=Pre-comp.|
|29(*)||TG43||Track > 43||FDC||Warns the CPU on head position. 0=head on track 0 to 43, 1=head on track 44 to 76.|
|31(*)||WD||Write Data||FDC||Data to be written on the disk drive|
|0||1||0||1||0||MPU wants to write into Sector Register|
SchematicThe schematic can be found here: Project schematic (PDF)
Some explanationsU1 (74LS245): buffer with DAL0-7
U3 (74LS244): buffer from the keyboard and the command pins (A0, A1, /RE and /WE)
U3 (74LS244): buffer to the LCD
U7 (74HC125): voltage adaptor (5V -> 3.3V) for the SD card and reverse voltage for the keyboard.
U4A (74LS139): this component manage the 8 bit bus (port D on the Arduino) by enabling/disabling the buffers U1, U3 and U6. U4A is managed via port C with the following table:
The QX1 - timingsAll the timings below are measured with a Saleae Logic 8 Analyzer at 12 Ms/Sec.
Bootup sequenceHere are the chronograms (timing) of the QX1 bootup sequence.
Problem with /RE and /WEOn the MB8877 datasheet, no information if both are low. However, I found many situation where /RE and /WE are both down.
|Examples where /RE and /WE are both low, an undefined situation.|
Timing for the read operation
The timing for a read operation (the MPU wants to read a register of the FDC) is the following: