Floppy Disk Formatting Issue

124 views
Skip to first unread message

Murray Johnson

unread,
Dec 13, 2025, 4:44:19 PM (3 days ago) Dec 13
to Altair-Duino
I have built David Hansel's Disk Controller for the Altair-Duino and am running into an issue when I try to format a floppy disk with AFORMAT, using Mike Douglas' CP/M hard disk image .  Each track retries and fails at the fourth attempt, all the way through the disk.

The drive is a Teac FD-55GFR and the disks are MD2HD floppies.  Each tested out good on a Windows/DOS system, with no issues found by Scandisk after a full format.

The drive appears to be communicating properly with the Disk Controller; the Monitor function can do the head movements and measure rotation.  In CP/M I can address the drive with C: but of course there is a BDOS error as the floppy has not been formatted.  Reading the buffer for the first track returns all 00's.

The controller has the MITS firmware loaded and the header jumpers J2 - J7 are all at 1&2 except for J3, which is set to 2&3.  The four mode switches are all set to off.  I believe these to be the correct settings for CP/M, but I'm a newbie with this stuff.

Is there something that I'm missing?  Searching through the group didn't bring anything to light for me.  Thanks for any guidance.

John Galt

unread,
Dec 14, 2025, 12:44:05 AM (3 days ago) Dec 14
to Altair-Duino
you have all floppies unmounted in the configuration menu? under (D) for disk drives make sure Drive 0,1,2,3 all set to none.

Murray Johnson

unread,
Dec 14, 2025, 4:19:55 AM (3 days ago) Dec 14
to Altair-Duino
Yes, all floppies set to none.  Only the hard disk image is set in the configuration.  I think I will try programming another Atmega328P to see if there is something wrong there.  As the AFORMAT progresses the drive steps the heads as we would expect.  For some reason data isn't flowing as it should.

Patrick Linstruth

unread,
Dec 14, 2025, 6:00:42 AM (2 days ago) Dec 14
to Altair-Duino
You can also try using Mike's AFEXER tool for debugging your floppy drive and controller. It can verify if anything is being written to the disk.

-- 
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/altair-duino/b23e9cd5-f9fc-40df-a66a-f92452acd8acn%40googlegroups.com.

da...@hansels.net

unread,
Dec 14, 2025, 8:51:51 AM (2 days ago) Dec 14
to Altair-Duino
Make sure to turn off the "Throttle delay" setting in the AltairDuino config menu.
The AFORMAT (and ACOPY) programs send data to the drive using a very time-constrained protocol, so any tiny pause by the AltairDuino (such as for throttling the CPU to exactly match the 2MHz 8080 speed) will cause it to fail.
I would also suggest using either AFTEXER or the Monitor function to test writing to and reading from the drive. 

Note that since the Altair uses a hard-sectored disk format, you do NOT need to format a floppy before writing to it. You can just plop in a disk and start writing and reading sectors using the Monitor. AFORMAT (and regular FORMAT) just writes known data to each sector, it doesn't set up the sector structure itself as we are used to from soft-sectored drives. The sector structure on each track is defined by the sector index holes (when using hard-sectored disks that have an index hole for each sector).  For soft-sectored disks (only one start-of-track index hole) , the controller uses timing (time since it last saw the start-of-track hole) to define where the sectors are.
That's one other possibility why things may be going wrong: if the drive doesn't spin with a consistent enough speed then the controller may not be able to compensate for that.
Try writing and reading sectors within the monitor and see if you can get read the data back correctly.

David

On Saturday, December 13, 2025 at 4:44:19 PM UTC-5 ve3...@gmail.com wrote:

Murray Johnson

unread,
Dec 14, 2025, 10:15:07 AM (2 days ago) Dec 14
to Altair-Duino
Thanks for the suggestions, everyone.  I very much appreciate the help.  I tried a new Atmega328P with the same result, rechecked all my soldering, and confirmed continuity on the ribbon cable.  The throttling is turned off in the configuration menu.  I will proceed with testing using the monitor function.  That will at least point in a direction for further troubleshooting.

Murray

Murray Johnson

unread,
Dec 14, 2025, 12:27:22 PM (2 days ago) Dec 14
to Altair-Duino
Using Monitor I can confirm that the floppy disk is being written to by the AFORMAT command.  I wrote a buffer of 19h to track 6,0, was able to read it back - then tried the AFORMAT command.  Each track retried 4 times and failed as before, but Monitor shows that track 6,0 changed from 19h to E5h. So the Monitor can write and read the floppy disk.  AFORMAT is writing okay but appears to not be receiving track data back.

I measured the rotation period with Monitor's M command, and results were consistent over about 45 seconds: 166.896 msec (360 RPM) with Min: 166.892 -0.002% and Max: 166.928  +0.019%.  I think that looks okay?

Perhaps I should check the expansion bus.

Murray

Murray Johnson

unread,
Dec 14, 2025, 1:35:51 PM (2 days ago) Dec 14
to Altair-Duino
So, until recently I had been proceeding under the (false) assumption that the floppy disk HAD to be formatted before it could be used.  Thanks to David for setting me straight.  I have been able to copy a file from the hard disk image to the floppy disk using PIP, and the program executed properly from the floppy drive.  After that I tried another AFORMAT on the floppy disk, but the result was still failure on each track.  The file I had copied was written over.  So, it's just AFORMAT that isn't happy with what it's reading back from the the disk (even though the data checks out okay (E5h)).

I guess I'm not going to worry about it :).

Cheers - and thanks again for the help!

Murray

Patrick Linstruth

unread,
Dec 14, 2025, 2:37:27 PM (2 days ago) Dec 14
to Altair-Duino
Even the hard sector disks have a format, but the format works different than a soft sector format.

Each sector within a track has information in addition to the data, such as the track number, sector number, and checksum. The AFORMAT program writes this information and fills the data with E5. It then reads back the sectors and verifies the data read from the disk is the same as the data that was written. AFORMAT will fail if data read from the disk does not match what was allegedly written.

It would seem that if everything is working correctly, AFORMAT should work too.

;---------------------------
; Altair 8" Diskette Format
;---------------------------
;  Raw Bytes/sector: 137
;     Sectors/Track: 32, numbered 0-31
;   Tracks/Diskette: 77, numbered 0-76
;
; Tracks 0-5 are "System Tracks" (regardless of how they
; are actually used). Sectors on these tracks are
; formatted as follows:
;
;     Byte    Value
;      0      Track number and 80h
;     1-2     Number of bytes in boot file
;    3-130    Data
;     131     0FFh (Stop Byte)
;     132     Checksum of 3-130
;    133-136  Not used
;
; Tracks 6-76 (except track 70) are "Data Tracks." Sectors
; on these tracks are formatted as follows:
;
;  Byte    Value
;     0      Track number and 80h
;     1      Skewed sector = (Sector number * 17) MOD 32
;     2      File number in directory
;     3      Data byte count
;     4      Checksum of 2-3 & 5-134
;    5-6     Pointer to next data group
;   7-134    Data
;    135     0FFh (Stop Byte)
;    136     Not used
-- 
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.

Murray Johnson

unread,
Dec 14, 2025, 7:12:15 PM (2 days ago) Dec 14
to Altair-Duino
Yes, AFORMAT should work.  I've tried a different drive, a 3.5 Teac FD-235HG and saw the exact same behavior.  I've also tried the combinations of F flags in the Monitor setup (Sync After Step & Relative Sector Timing) with no change.  There is data being recorded on the disk and it's being read back.  The rotation appears to be correct and stable.  Unless there is some kind of timing issue that AFORMAT is exposing I really don't know what to try next.  That being said, I do appreciate the suggestions.

Murray

John Galt

unread,
Dec 14, 2025, 10:22:40 PM (2 days ago) Dec 14
to Altair-Duino
don't rule out that your card is not 100% right....

I put together a few batches of cards for the Disk controller and one card just refused to work right couldn't figure it out,, tossed it in a box and just soldered another one together.

I had one RTC card that just refused to work right in that case i figured out that half the Clock chips i purchased appear to have been statically damaged and i kept replacing them until i found one chip that worked right.

on the one controller card that refused to work, the monitor on that card works fine and i can copy and burn disks with the monitor when i try to access the card from the altair-duino side it just refused to see the disks similar you the issue you have... i gave up on it and soldered another one together and it worked, i could not find if one of the chips was marginal or if it was an issue with a VIA or something i tried swapping ICs and it still didn't work... not worth the effort, just start over and get a good one and don't waste your time...

if you keep having cards not working then start to look at your backplane. i had a backplane that i hacked into an older revision and worked great until i opened the box to make a change inside and when i put it back together the backplane acted all flaky took forever finally found some wires that looked as if they were connected to my 25 pin adapter but turned out they fell out of the retention plates it was weird but what can you do.

Murray Johnson

unread,
Dec 15, 2025, 3:54:11 PM (yesterday) Dec 15
to Altair-Duino
Some good points there.  I rechecked the Floppy card, the expansion bus and the backplane.  Continuity looks good, no shorts.  I put a scope on the ribbon cable to the drive and found that the Side Select (pin 32) was not changing while running AFORMAT.  With Monitor I can change sides from 1 to 2 and back again - the scope shows HI when set to side 1, LO when set to 2 and the drive is jumpered accordingly (default).  When running AFORMAT pin 32 just stays high as the drive steps inward from the outside.  I expect that it should be toggling to each side with every step.  Like you John, I've swapped some chips around.  The output enable and direction pins on the 74LVC245 show lots of activity and swapping that chip made no difference.  It's probably time to study the firmware to see if I can gain some insight.

da...@hansels.net

unread,
Dec 15, 2025, 3:56:50 PM (yesterday) Dec 15
to Altair-Duino
The original Altair disk drive is single-sided so that is what is emulated. 
The monitor function allows to select both sides of modern disk drives but the Altair will only use one.

Murray Johnson

unread,
Dec 15, 2025, 6:31:38 PM (23 hours ago) Dec 15
to Altair-Duino
Thanks David - That's what confused me.  I'm guilty of making assumptions based upon MS-DOS...  Going through the firmware I see now the only place that disk sides show up is in the Monitor.  BTW I tried to copy a DSK image to a floppy using the Monitor and it reported success in validation mode.  When I try to read it I get a BDOS Bad Sector error, although the directory looks okay.  I think I'll take John's advice and just build another card.  This particular one just doesn't want to work.

John Galt

unread,
Dec 15, 2025, 7:32:52 PM (22 hours ago) Dec 15
to Altair-Duino
reminds me i have to get around to assembling another disk card myself it has been sitting on my workbench for months.

da...@hansels.net

unread,
Dec 15, 2025, 9:32:26 PM (20 hours ago) Dec 15
to Altair-Duino
One other question: did you compile the firmware for the Arduino Due yourself or did you use Chris' pre-compiled firmware?
If you compiled the firmware yourself and didn't set the optimization mode to "performance" then the AltairDuino runs too slow
to reliably communicate with the disk controller. Chris has the procedure in the "install software" instructions on his site.

David

Murray Johnson

unread,
2:22 AM (16 hours ago) 2:22 AM
to Altair-Duino
I bought the Experimenter Kit from Chris - the Due came pre-programmed with firmware and with a microSD card.  I assume it was his pre-compiled firmware?

Murray Johnson

unread,
2:21 PM (4 hours ago) 2:21 PM
to Altair-Duino
Well, I tried a different approach that seems to work.  Instead of using AFORMAT on the HDSK image, I created a blank floppy image with phatchman's Altair tools utility and used Monitor to install the image on real floppy disks, verifying each one.  That was successful for 10 physical disks.  I then exited Monitor and transferred some really large ASM files to a floppy and then TYPEd them to the screen.  I checked the disk with AFEXER and was able to move around and arrive at the expected tracks.  No issues whatsoever.

I am still mystified as to why AFORMAT won't work, but I now have 10 floppies that I can apparently use and trust.  Perhaps it has something to do with the tolerance of the 16 MHz crystal that is installed on the ATMEGA328P.  It's +/- 30 ppm, so who knows?  David says the timing is critical for that program.

I want to thank the group here for their suggestions and guidance.  I continue to be amazed at the technical skills and willingness to help exhibited by the folks in this community.

Cheers -

Murray
Reply all
Reply to author
Forward
0 new messages