Changes
765 FDC
,/* FDC Command Table (15 commands) */
<br>
== FDC Command Table (15 commands) ==
{| class="wikitable"|+ Read ID (0Ah)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || x || MF || x || 0 || 1 || 0 || 1 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| Execution || colspan="8" | The first correct ID information on the cylinder is stored in data register|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Format Track(0Dh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || x || MF || x || 0 || 1 || 1 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: output TRcenter;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | N: bytes per sector|-| command byte 3 || colspan="8" | SC: sectors per track|-| command byte 4 || colspan="8" | GPL: gap 3 length|-| command byte 5 || colspan="8" | D: filler pattern to write in each byte|-| Execution || colspan="8" | FDC formats an entire track|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan Equal (11h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 0 || 0 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan Low or Equal (19h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 1 || 0 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD|| colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,SC2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector number|-| result byte 6 || colspan="8" | N: bytes per sector|} {| class="wikitable"|+ Scan High or Equal (1Dh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || MT || MF || SK || 1 || 1 || 1 || 0 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| command byte 2 || colspan="8" | C: cylinder number|-| command byte 3 || colspan="8" | H: head number|-| command byte 4 || colspan="8" | R: sector number|-| command byte 5 || colspan="8" | N: bytes per sector|-| command byte 6 || colspan="8" | EOT: end of track (ie. last sector in track)|-| command byte 7 || colspan="8" | GPL: gap 3 length|-| command byte 8 || colspan="8" | STP: scan test (1=scan contiguous,SZ for each 2=scan alternate)|-| Execution || colspan="8" | Data compared between the FDD and main-system|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | ST1: status register 1|-| result byte 2 || colspan="8" | ST2: status register 2|-| result byte 3 || colspan="8" | C: cylinder number|-| result byte 4 || colspan="8" | H: head number|-| result byte 5 || colspan="8" | R: sector during execution phasenumberRead Track|-| result byte 6 || colspan="8" | N: reads NM sectors bytes per sector|} {| class="wikitable"|+ Recalibrate (starting 07h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 1 || 1 || 1|-| command byte 1 || colspan="6" style="text-align: center;" | x || colspan="2" style="text-align: center;" | US|-| Execution || colspan="8" | Head retracted to track 0|} {| class="wikitable"|+ Seek (0Fh)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 1 || 1 || 1 || 1|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD|| colspan="2" style="text-align: center;" | US|-| command byte 2 || colspan="8" | NCN: new cylinder number|-| Execution || colspan="8" | Head is positioned over proper cylinder|} {| class="wikitable"|+ Sense Interrupt Status (08h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 1 || 0 || 0 || 0|-| result byte 0 || colspan="8" | ST0: status register 0|-| result byte 1 || colspan="8" | PCN: present cylinder number|} {| class="wikitable"|+ Sense Drive Status (04h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 1 || 0 || 0|-| command byte 1 || colspan="5" style="text-align: center;" | x || HD || colspan="2" style="text-align: center;" | US |-| result byte 0 || colspan="8" | ST3: status register 3|} {| class="wikitable"|+ Specify (03h)|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || 0 || 0 || 0 || 1 || 1|-| command byte 1 || colspan="4" style="text-align: center;" | SRT || colspan="4" style="text-align: center;" | HUT|-| command byte 2 || colspan="7" style="text-align: center;" | HLT || ND|} {| class="wikitable"|+ Invalid|-! !! D7 !! D6 !! D5 !! D4 !! D3 !! D2 !! D1 !! D0|-| command byte 0 || colspan="3" style="text-align: center;" | x || colspan="5" style="text-align: center;" | Invalid Codes|-| result byte 0 || colspan="8" | ST0: status register 0|} Abbreviations used: *MT = Multi-track (continue multi-sector function on other head)*MF = MFM mode (1 = Double Density)*SK = Skip deleted-data address mark (set if sectors with first sec past index holedeleted DAM shall be skipped)Read ID*HD = Head number select*US = Unit select (drive select) *HLT = Head Load Time: read ID bytes for current sec2 to 254ms in 2ms increments*HUT = Head Unload Time: 16 to 240ms in 16ms increments*SRT = Step Rate Time: 1 to 16ms in 1ms increments (F = 1ms, repeated/undelayed read lists all IDsE = 2ms, etc.)*ND = Non-DMA mode Notes:* Format Track: The processor must supply C, H, R, N to the FDC for each sector during execution phaseRecalib* Recalibrate: walks Walks up to 77 tracks, 80tr-drives may need second recalib if failed* Seek/RecalibRecalibrate: All read/write commands will be disabled until succesful senseintsense interruptSenseint* Specify: Set's IC if unsuccesful (no int has occured) (until IC=0)All timings will be doubled on CPC because the FDC runs at 4MHz instead of 8MHz for the datasheet
<br>
*[http://quasar.cpcscene.net/doku.php?id=assem:fdc Quasar FDC documentation (in french)]
*[https://64nops.wordpress.com/2021/07/04/a-la-decouverte-du-fdc/ FDC blog articles (in french)]
*[https://info-coach.fr/atari/hardware/FD-Hard.php Atari ST Floppy Disk Drive hardware analysis]
[[Category:CPC Internal Components]][[Category:Programming]][[Category:DATA Storage]][[Category:Electronic Component]]