The THMFC1 is a custom floppy controller developed by Thomson and used in the TO8, TO9+, and TO8D, as well as the floppy controller expansion for the MO6 (which also works on older machines). It's a very flexible floppy controller, as it leaves a big part of the work to the CPU. One interesting fact is the ability to use QDD drives as well as regular floppies. ====== Register map ====== ^Address^Name ^Description ^ |E7D0 |STAT0/CMD0 |status/command| |E7D1 |STAT1/CMD1 |status/command| |E7D2 |CMD2 |command | |E7D3 |WDATA/RDATA|data read/write| |E7D4 |WCLK |clock (MFM bits)| |E7D5 |WSECT |sector | |E7D6 |WTRCK |track | |E7D7 |WCELL |cell size adjust| ===== E7D0: CMD0 ===== ^Bit^Description^ |7 |Must be 0 | |6 |Must be 0 | |5 |MFM (0)/ FM (1)| |4 |Enable sync detection | |3 |Disable sync detection (format track) | |2 |Write enable | |1,0|Operation code | Operations: * 00: reset * 01: write sector * 10: read address * 11: read sector ===== E7D1: CMD1 ===== ^Bit^Description ^ |7 |Compatibility | |6,5|Sector length | |4 |Side select | |3-1|Timing compensation | |0 |Enable READY signal detection| Sector sizes: * 00: 128 bytes * 01: 256 bytes * 10: 512 bytes * 11: 1024 bytes Timing compensation: * 62.5ns steps, must be set to 437.5ns ===== E7D2: CMD2 ===== ^Bit^Description^ |6 |Side select| |5 |Step direction (0 = towards track 0)| |4 |Step| |2 |Motor on| |1 |Drive select 1| |0 |Drive select 0| ===== E7D0: STAT0 ===== ^Bit^Description^ |7 |Character clock image (?)| |6,5|Must be 0| |4 |Operation finishing| |3 |Operation finished | |2 |CRC error | |1 |Similar to bit 7, for automated operations| |0 |Sync detection | ===== E7D1: STAT1 ===== ^Bit^Description^ |7 |Must be 0| |6 |Index pulse detection| |5 |Disk change | |4 |Motor state (1=stopped)| |3 |Track 0 | |2 |Write protected | |1 |Ready | ===== E7D4: clock type ===== Must be set to FF when writing data bytes, or 0A when writing synchronization bytes (inter-sector gaps). Other values may be used for custom disk formatting, at your own risk. ===== E7D7: WCELL ===== * Bit 7: set to 0 for inner tracks of disk. Compensate writes for the smaller disk surface. * Bit 6: ? ====== Sector format ====== The controller uses the standard shugart MFM coding for sectors, but can be programmed to do other things as well. | ^Byte count^Contents ^Description ^ ^Header|12 |00 |Bit synchronization | ^::: |3 |A1 clock 0A |Char synchronization| ^::: |1 |FE |Header mark | ^::: |1 | |Track id | ^::: |1 | |Side id | ^::: |1 | |Sector id | ^::: |1 | |Sector size | ^::: |2 | |CRC check | ^::: |22 | |Header GAP | ^Data |12 |00 |Bit synchronization | ^::: |3 |A1 clock 0A |Char synchronization| ^::: |1 |FE |Data mark | ^::: |sector length| |Data | ^::: |2 | |CRC check | ^::: |variable | |Data GAP |