Torode's microcontroller: instructions and code

Written by Herb Johnson and Dwight Elvey, last edit Feb 10 2008. My thanks to Dwight Elvey for his programs and his work to re-engineer, restore and program Dr. John Torode's & Digital Systems Inc.'s FDC-1 controller. More discussion of Dr. Torode's floppy controller is on this linked page.

reverse engineering of microcontroller

Dwight Elvey wrote to me in Feb 2008, as below, about his work on the FDC-1 microcode and software. The work on this page is based on This image of a portion of the microcontroller from the schematic for the Digital Systems FDC-1 controller card from December 1976. My edits to Dwight's comments below are in []'s. - Herb Johnson

Dwight Elvey: I've manually decompiled [the microcontroller] ROMs such that [the instructions] references [signals] on the schematic. That was how I first got it working. Another fellow, Stan Sieler, had the schematics but nothing else. I used the schematics and my ROM decompile to understand how to use [the floppy controller].

[Then] I assembled some [8080] boot strap code on my PC, and toggled it into my IMSAI. This was just a simple serial [port code] loader. I wrote code to format the disk and then to write the boot code on the first sector for the boot loader; and then the routines for CP/M to use.

[Then] I got the basic CP/M running and then used my simple serial and the debugger to load the rest of the code. (PIP just doesn't do serial well on binary).

I have the decompiled ROM code here. One file is the format code and the other is the normal read/write code. Since Torode couldn't get it all within one ROM sequence, to format one had to select a jumper on the interface card. I ran the jumper to a switch I put on the back panel of the IMSAI. Format is more complex than just read or write. One has to have data for everything except the CRC values of an entire track. I figured this all from the decompiled [microcontroller ROM] code. - Dwight Elvey

The FDC-1 is a hard-coded microcontroller, with an interface to a seperate "host processor" card. The microcontroller has its own ROM programs, which are controlled through the interface by the host computer. More discussion of Dr. Torode's floppy controller is on this linked page.

The FDC-1 manual says the host processor interface is a DMA interface. The interface provides 8-bit addresses and strobes for IN or OUT or DEVICE ADDRESS; and there is an 8-bit data path. References on the host side, presumably for an 8080 based system, is to addresses 07FH for status and commands, 07DH amd 07EH for DMA address, among other uses of those addresses. 131 decimal bytes (83H) are transferred per sector. The bootstrap reads track 0, sector 1, into DMA addresses 00-7FH.

The FDC-1 microcontroller has an internal 8-bit instruction bus on which instructions appear, as read from the 3601 ROM chips. They are decoded by a series of decoder chips, or other logic, which reads this bus. Each set of microinstructions are "read" by one of these decoders. There is also a decoder for various conditions of microcontroller activity; that decoder is read by "jump" circuity and the microcontroller will "jump" if the condition occurs (or not) when the jump instruction for that condition is executed. - Herb Johnson

microcontroller instruction set

From reading Dwight's reconstructed microcode, and the schematics as Dwight did, I've listed below an "instruction set" for the FDC-1 microcode.I've named the specific instruction decoder chips and pins on the FDC-1, and spelled out the signals which Dwight abbreviated slightly. This information must be read with the FCD-1 microcontroller schematic to make sense. - Herb Johnson

Jump instructions

;chips B4 and B3 (74161) execute the "jumps", instructions 0X and 4X. 
;chip A6 (74150) decodes the conditions to be tested as X = 0 thru F as follows below.
;these signals are ANDed with the signals named and fed back to the microcontroller.
; the "/" means the signal is active low, otherwise it is active high.
;  pin 8  D0  T (tied high)
;  pin 7  D1  EQUAL
;  pin 6  D2  DATA AM
;  pin 5  D3  /IDAM
;  pin 4  D4  CNT DONE
;  pin 3  D5  /DATA OK
;      2  D6  BYT RDY
       1  D7  /READY
       23 D8  READ REQ
       22 D9  WRITE REQ
;      21 D10 MAC RDA
;      20 D11 /TRK ZERO
;      19 D12 STP RDY
;  pin 18 D13 /BOOTSTRAP (changed from RESET)
       17 D14 /INDEX
   pin 16 D15 (unused)

;4X instructions will jump on the condition (signal) given. 
;0X instructions will jump on the NEGATION of these conditions.
;the subsequent microcode byte gives the 8-bit address to jump to.
;"J" is jump, "JN" jump on not

chips B3, B4, jump on negation of selected condition
01 JN(EQ)
02 JN(DAM)
03 J(IDAM)
04 JN(CNT)
06 JN(BRDY)
0A JN(MAC)
0C JN(SRDY)
0D J(RST) <<-- or BOOTSTRAP

chips B3, B4, jump on selected condition
40 JMP
43 JN(IDAM)
45 JN(OK)
46 J(BRDY)
47 JN(READY)	
48 J(RD)	
49 J(WR)
4A J(MAC)
4C J(SRDY)

control instructions

These instructions send specific control signals from the microcontroller to the rest of the controller, or back through the interface to the host processor.

:Instruction 80 is a signal from chip C4 pin 8, a few TTL gates
80 LDCNT

;CX instructions are from chip B6, 3205
C0 SET1X
C1 DCRDAT
C2 SETSTP
C3 CLRDMAD
C4 CLRDAT
C5 CNTDAT
C6 DCRDMAD
C7 INRDMAD

;FX instructions are from chip E1, 74154
F0 CLRCRC
F1 WRCRC
F2 SETCNTC
F3 SETCNTD
F4 CLRBRDY
F5 SETCLK0
F6 CLRWG
F7 SETWG
F8 CLRDSR
F9 SETTER
FA SETDCE
FB SETICE
FC SETIOF
FD DMARD
FE DMAWR
FF ZERODBIT

Read/write/seek microcode

The read/write microcode instructions from the DS microcontroller are listed on on this Web page. These were named by Dwight Elvey using the signals named on sheet #1 of the DS FDC-1. I've slightly edited the file Dwight sent me as he noted above. - Herb Johnson

Format microcode

The diskette format microcode instructions from the DS microcontroller are listed on on this Web page. These were named by Dwight Elvey using the signals named on sheet #1 of the DS FDC-1. I've slightly edited the file Dwight sent me as he noted above. - Herb Johnson

Contact information:

Herb Johnson
New Jersey, USA
To email @ me, see see my ordering Web page.

Copyright © 2008 Herb Johnson, from documents (C) Dwight Elvey