Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentations:devices:thmfc1 [2014/03/25 21:40] – created pulkomandy | documentations:devices:thmfc1 [2015/02/28 18:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | The THMFC1 is a custom floppy controller | + | The THMFC1 is a custom floppy controller |
====== Register map ====== | ====== Register map ====== | ||
Line 12: | Line 12: | ||
|E7D7 | |E7D7 | ||
+ | < | ||
+ | ===== 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, | ||
+ | |||
+ | 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 | ||
+ | ^Header|12 | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^Data |12 |00 |Bit synchronization | | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: | ||
+ | ^::: |