This is a sketch that implements a floppy disk controller based on https://github.com/dhansel/ArduinoFDC and using exactly same hardware wiring. It works with Arduino Uno, Leonardo, Nano, Pro Mini, Micro and Mega.
Goal of this modification is to support formats for old 8bit computers, especially ZX Spectrum Betadisk and CP/M.
- Removed ArduDOS, because it is not usable here.
- Support for 128, 256 and 512 sectior sizes.
- Geometry definitions enhanced by sector size.
- Allow to change disk geometry on the fly.
- Ignore "side" sector mark, because Betadisk wrongly write 0 here on both sides.
- Less conservative seek timing, since my very old drives knows 6ms steps and 30ms head stabilizations.
- Enhanced interactive monitor, especially for partial image download and for ignore read errors. Easy to create TRD, IMG or other raw disk images.
- Added simple disk content type identification. (MS-DOS, TR-DOS, CP/M, MDOS)
To properly read/write data, the library must be configured for the drive/disk
combination that is being used. The drive type can be passed into the begin functions
or set afterwards by calling the setDriveType function. Supported types are:
- ArduinoFDC::DT_5_DD: DD disk in a DD 40 track drive (2x40x9x512)
- ArduinoFDC::DT_5_DDonHD: DD 40 track disk in a HD 80 track drive (2x40x9x512)
- ArduinoFDC::DT_5_HD: HD disk in a HD drive (2x80x15x512)
- ArduinoFDC::DT_3_DD: DD disk in a DD or HD 80 track drive (2x80x9x512)
- ArduinoFDC::DT_3_HD: HD disk in a HD drive (2x80x18x512)
The following commands are changed or added:
S [0/1][,l[,l]]Read RAW duisk image of the current disk and transmit them via XModem protocol. (fail/skip errors, start and end position by logical sequence sector number 0-based.)R [0/1][,l[,l]]Receive RAW disk image via XModem and write it to the current disk. (without/with verify, start and end position by logical sequence sector number 0-based.)gShow drive track geometry.g h,t,tsModify drive track geometry, 0=ignore. (num heads, num tracks, track-spacing)GShow drive sector geometry.G s,ssModify drive sector geometry, 0=ignore. (num sectors, sector size)iTry to identify disk in drive.4Turn 80tr. drive to 40tr. mode8Turn 80tr. drive to 80tr. mode