• Please review our updated Terms and Rules here

programming the Intel 8272

jerwin

New Member
Joined
May 5, 2008
Messages
9
Location
Seattle, WA
I need some help from old brain cells out there. I have the Compupro DISK1 board in my Imsai 8080 (rebuild project) and a pair of well-preserved 8" floppy drives. I am writing the basic disk control routines and have hit a snag.

All drives and controller are wired correctly and running. Seek works, specify works, the snag is with format track. The DISK1 docs are amazingly lean in this area. It looks like I am supposed to be feeding the controller sector information as it formats, but there is no indication as to how I do this. I set up the format track command per the tables and get just one sector programmed, then get data overrun errors, so I am starving the controller.

I remember from my INtel days (multibus group, very early 80's) that we were able to program sector interleave, so I am sure I am supposed to be providing the DISK1 controller sector information as it performs the FORMAT command, but there is nothing anywhere telling me how to do this.

Anyone out there remember how to do this???

Jeff Erwin
 
Hi,

I just wrote a working FORMAT TRACK routine for my N8VEM SBC Disk IO (i8272) project. I can feel your pain as this is a major hassle to get it to work properly.

Essentially what you need is the classic COMMAND, EXECUTION, and RESULT phase like any other 8272 command.

You send the COMMAND like normal but during the EXECUTION phase you send a stream of sector metadata (C,H,R, & N) for EACH sector as it whizzes by just like you were writing a sector. For example, after the COMMAND phase, send
00,00,01,02;
00,00,02,02;
00,00,03,02;
.
.
.
etc for each sector. Then process the RESULT phase like normal

For some unknown reason I had to send a $00 at the beginning of my sequence to get it order but I am not sure why.

Also, check with Rich Cini I think he has the Disk 1A documentation and source listings on how to format disks.

I have some sample code if you'd like to see it but it depends on how you are sending data to the i8272 as to whether it will work for you. Are you using DMA? Are you polling? Are you using pseudo-DMA or INT-/WAIT? etc.

The Intel datasheet is not very good. Check the SMC datasheet for the FDC765 for a much better explanation.

http://bitsavers.org/pdf/standardMicrosystems/_dataBooks/1985_StandardMicrosystems.pdf

Disk 1A documentation

http://www.hartetechnologies.com/manuals/CompuPro/

Hope this helps! Thanks! Good luck and have a nice day!

Andrew Lynch

PS you can use the IMD program and/or Catweasel to independently verify what the i8272 is writing to the disk. I found them to be very helpful in debugging my FORMAT TRACK algorithm.

http://groups.google.com/group/n8vem
 
Wow, very helpful! I worked on a Multibus floppy controller at Intel back in the early 80's that used this chip, some of this nonsense is coming back to me now.

I am using polling right now to get everything working before I attempt to use DMA. The DISK1 board allows me to poll for the interrupt, and in looking at the 765 info I should be getting an interrupt for each byte. WHy it needs the cylinder and head info for a track format is beyond me, any idea what would happen if I sent it the wrong track number? It seems like the sector number and sector size are the only important values here.

I will give this a try in the morning!

Jeff Erwin
 
Also, check with Rich Cini I think he has the Disk 1A documentation and source listings on how to format disks.

Actually my system is based on the Disk 1 which is the single-density version of the controller. Attached is some snipped code from my CBIOS. Hopefully it's commented enough for you to follow. I didn't write it; another IMSAI owner shared his CBIOS with me and I modified it to work with my system.

The docs are on my Web site on the IMSAI page.

Rich
 
Last edited:
Thanks a ton. I am working with the disk1 product as well, so I should be able to make some sense out of this.

Jeff Erwin
 
I am building a Disk IO IDE and FDC board for a Z80 home brew computer. If anyone is feeling ambitious regarding programming the i8272, I could sure use some help in designing, building, writing, testing, etc the project. The IDE portion already done and the software seems to work fine.

The Disk IO board is mostly built using prototype boards on my workbench and it works. It can reliably read and write sectors on IBM PC formatted disks such as 360K, 720K, 1.2M, and 1.4M. It can also format tracks. I have written software for a crude "Disk Monitor" program to test the system.

Designing FDCs is complex and regardless of how well my design works or not, it certainly could use another builder to try it out and shake out the bugs. I will make the PCBs available eventually and everyone will benefit from additional eyes reviewing the design, testing, etc.

Thanks! Have a nice day!

Andrew Lynch
 
Wow, very helpful! I worked on a Multibus floppy controller at Intel back in the early 80's that used this chip, some of this nonsense is coming back to me now.

I am using polling right now to get everything working before I attempt to use DMA. The DISK1 board allows me to poll for the interrupt, and in looking at the 765 info I should be getting an interrupt for each byte. WHy it needs the cylinder and head info for a track format is beyond me, any idea what would happen if I sent it the wrong track number? It seems like the sector number and sector size are the only important values here.

I will give this a try in the morning!

Jeff Erwin

Hi Jeff,

The NEC 765 seems to allow any value into the sector header regardless of it makes sense or not. As long as you send it in the proper order and sequence, it will write it. You can use it to make sector interleaving, etc.

However, you can easily get nonsense values in the sector headers. Stuff like physical track 0 sector 1 saying it is on track 243, sector 127, head 00, and 16KB long. There doesn't seem to be any error checking at all.

I would try it in the polling mode first and once that checks out, try the DMA mode. You might want to spin up a workstation with IMD on it to help checking whatever you are writing on the disk. Or get a Catweasel and CW2DMK software.

Thanks and have a nice day!

Andrew Lynch
 
Success!

Success!

Thanks you all for the great help. I got it to work by using DMA mode and letting the DISK1 board do the heavy lifting. I was unable to get the polling model to work, it seems like I would not actually get four interrupts per sector as the docs state, so the software would get hung up waiting for an interrupt that would never come.

On to create the read and write sector functions! My ultimate goal is to get CPM running on this thing, I am a ways away from that. I have been piecing this system together from stray parts off eBay, an old Tek scope, soldering iron and 8080 assembler. I built three of these in college but I don't remember it being this much fun! I am truly amazed at the amount of S-100 stuff that is still out there and still works. I found three identical 8K RAM boards that were literally brand new in sealed boxes. Where have these been for the last 30 years??

In any case, thanks again for the nudge. If anyone out there needs code for an Imsai 8080, I have written a full debugger/monitor/intel hex loader that uses the terminal program as the source for the hex files. I will have a full suite of basic functions for the DISK1 board as well in the very near future. I am more than happy to let anyone have the source just for asking!

Jeff Erwin
 
Back
Top