µPD765 - Floppy Disc Controller (used in CPC 664, CPC 6128, 6128 Plus and [[DDI-1]] expansion).
Besides the Amstrad CPC, this chip equipped the [[PCW|Amstrad PCW]], the [[ZX Spectrum|ZX Spectrum +3]] , the [[SC-3000|Sega SC-3000]], and the [[PC|IBM PC]] (including [[Amstrad PC]]). The recommended ports used by Amstrad and compatible interfaces are: {| class="wikitable"|-!I/O port address!Function|-|&FA7E||Floppy Motor On/Off Flipflop|-|&FB7E||FDC 765 Main Status Register (read only)|-|&FB7F||FDC 765 Data Register (read/write)|} Note: Bit b10 of the address port is reset as the FDC is seen as an expansion, even if it is an internal chip. Bit b7 is reset to select the FDC. Bits b8 and b0 are used to select the specific mode of operation. All other bits should be set to 1 to avoid conflict. [https://www.cpc-power.com/cpcarchives/index.php?page=articles&num=48 Source] Note2: The [[Vortex Disc Drives|Vortex disc interface]] uses other ports. See its dedicated wiki page.
<br>
== Accessing the FDC 765 ==
The recommended ports used by Amstrad and compatible interfaces are:
{| class="wikitable"
|-
!I/O port address
!Function
|-
|&FA7E||Floppy Motor On/Off Flipflop
|-
|&FB7E||FDC 765 Main Status Register (read only)
|-
|&FB7F||FDC 765 Data Register (read/write)
|}
The Main Status Register signalizes when the FDC is ready to send/receive the next byte through the Data Register.
* Execution Phase: During this phase, the actual data is transferred (if any). Usually that are the data bytes for the read/written sector(s), except for the Format Track Command, in that case 4 bytes for each sector are transferred. During data transfers between the FDC and the processor, the FDC must be serviced every 26µs (for MFM mode with CPC timings) or the FDC terminates the FDC command.
* Result Phase: Returns up to 7 result bytes (depending on the command) that are containing status information. The Recalibrate and Seek Track commands do not return result bytes directly, instead the program must wait until the Main Status Register signalizes that the command has been completed, and then it must (!) send a Sense Interrupt State command to 'terminate' the Seek/Recalibrate command. During the result phase, all the result bytes must be read. The FDC will not accept a new command until all the result bytes are read.
Note: Bit b10 of The Recalibrate and Seek Track commands do not return result bytes directly. Instead, the address port is reset as program must wait until the FDC is seen as an expansion, even if it is an internal chip. Bit b7 is reset to select Main Status Register signalizes that the FDCcommand has been completed. Bits b8 and b0 are used And then it must (!) send a Sense Interrupt State command to select 'terminate' the specific mode of operation. All other bits should be set to 1 to avoid conflict. [https:Seek//www.cpc-power.com/cpcarchives/index.php?page=articles&num=48 Source] Note2: The [[Vortex Disc Drives|Vortex disc interface]] uses other ports. See its dedicated wiki pageRecalibrate command.
<br>
<br>
== Chip Variants == === IC Models used in CPC ===
More than one manufacturer made 765 compatible ICs. These are the ones known to be used in the CPC by looking at pictures of CPC mainboards. All should operate almost identically.
All the floppy disk drive models used by Amstrad are referenced here: [https://www.cpcwiki.eu/index.php/Amstrad_FDD_part Amstrad FDD part]
<br>=== Other Variants ===
== Chip Variants == NEC has developed various successors to the original uPD765, such as the uPD72065(used in the [[Sharp X68000]]), uPD72067, and uPD72069.
Intel has also produced successors of the 8272, such as the 82072, 82077 and 82078.
The КР1810ВГ72А is a Soviet clone of the Intel i8272. It is used in the [[Aleste 520EX]] clone of the Amstrad CPC computer.
The [https://map.grauw.nl/resources/disk/toshiba_tc8566af.pdf Toshiba TC8566AF] is also a variant of the FDC765.
=== Competitors ===
The main competitor of the µPD765 FDC chip on the market was the WD179x FDC chip family. Its main differences are:
* the 765 only does standard track formats (preamble, marks and data fields), while the 179x will write anything you tell it in the write track (formatting a track) mode.
NoteSome other computers adopted 3inch floppy disks like Amstrad, but used different FDC chips: While the * [[Oric-1/Atmos|Oric]] uses the same 3inch floppy disks as the Amstrad CPC, it uses the WD1773 (Jasmin) or WD1793 (Microdisc) FDC chip* [[Tatung Einstein]] uses the WD1770 FDC chip Third-party 3inch floppy disk drives (like the Amdek Amdisk) were also available for many systems: Apple II, Atari 8-bit, Tandy CoCo, BBC Micro, etc..
<br>
* [[Media:UPD765_App_Note_Mar79.pdf| NEC uPD765 Datasheet preliminary (1979)]] [[Media:D765 NEC.pdf]] [[Media:UPD765-NEC.pdf]] [[Media:Z765A datasheet.pdf]] - uPD765 disc controller
* [[Media:Intel 8272A Datasheet preliminary (1982).pdf]] [[Media:Datasheet.hk_d8272a_2873060.pdf|Intel 8272A Datasheet (1986)]] [[Media:Floppy Disk Controller(FDC) UM8272A UM8272A-4.pdf]] - Licensed clone of the uPD765
* [[Media:WD37C65 datasheet.pdf]] - NEC 765 controller clone with onboard data seperator and AT/EISA compatibility
* [[Media:TN6-1 9216 Floppy Disk Data Separator Jun82.pdf]] [[Media:FDC9216 datasheet.PDF]] [[Media:SED9420.pdf]] - Data separators
* [[Media:DDI Schematic.png]] - DDI-1 Schematic (disc interface for CPC464)
*[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://en.wikipedia.org/wiki/History_of_the_floppy_disk History of the floppy disk] Wikipedia article
*[https://www.cpc-power.com/cpcarchives/index.php?page=articles&num=92 Floppy disk formats (in french)]
*[https://www.fvempel.nl/3bible.html The 3inch bible]
*[https://info-coach.fr/atari/hardware/FD-Hard.php Atari ST Floppy Drive hardware analysis]
*[https://map.grauw.nl/articles/low-level-disk/ MSX low-level disk storage article]
*[https://youtu.be/aoXr7Anr5DY Réparation de lecteurs Amstrad CPC] by [[Rodrik Studio]]*[https://youtu.be/-A-USMg9xvE Un Gotek dans un CPC 6128 et du 5.25 aussi] by [[Rodrik Studio]]*[https://youtu.be/QPFVfgaMv68 Les disquettes : Le fonctionnement] by [[Rodrik Studio]]*[https://youtu.be/RMTYevdGH6I Les protections et bien plus] by [[Rodrik Studio]]*[https://github.com/dbalsom/fluxfox FluxFox] A floppy disk image library in Rust
<br>
[[Category:CPC Internal Components]][[Category:Programming]][[Category:DATA Storage]][[Category:Electronic Component]]