Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fpga floppy controller??

310 views
Skip to first unread message

Lawrence Glaister

unread,
Feb 18, 2022, 6:23:07 PM2/18/22
to
Hi Guys, still messing around learning fpga coding.
John, I had a question for you and I couldn't wait until the Wednesday zoom meeting...
When designing your recent fdc boards, did you consider using the fpga directly as the controller? It seems all the disk interfaces are 5v ttl logic and that the fpga with a few level conversions, would be pretty good capturing a track of disk data into a fpga ram buffer for analysis. Real time performance should be better than most of the old hardware floppy controllers. I would love to hear you ideas as sd cards are cool, but nothing beats the raspy sound of drives seeking and the heads loading!.
I don't have one of your FDC boards, but I am working on experiments with your fpga_z80 board.
cheers
Lawrence VE7IT
Nanoose Bay BC, Canada

Peter Higgins

unread,
Feb 21, 2022, 3:41:28 PM2/21/22
to
I expect John might have considered implementing the 2793 floppy controller into the FPGA, if an FPGA implementation of the 2793 was already available. Designing a floppy controller in VHDL from scratch would be a significant task on its own. All I have been able to find (on www.opencores.org) was a single listing for a floppy controller - but it seemed to be an incomplete project, and it was modelled on the 8272 floppy controller family.

Josef Moellers

unread,
Feb 22, 2022, 3:10:27 AM2/22/22
to
On 21.02.22 21:41, Peter Higgins wrote:
> I expect John might have considered implementing the 2793 floppy controller into the FPGA, if an FPGA implementation of the 2793 was already available. Designing a floppy controller in VHDL from scratch would be a significant task on its own. All I have been able to find (on www.opencores.org) was a single listing for a floppy controller - but it seemed to be an incomplete project, and it was modelled on the 8272 floppy controller family.

Hm, this sounds veeery interesting to me!

I have an SB180FX microcomputer which boots from floppy and then
switches to the (parallel SCSI) hard disk.
Some time back I have replaced the disk with a solid state SCSI disk
which works fine (iirc something out of the Amiga or Atari universe).

I'm now worried about the floppy part and I would like to replace the
FDC (8266) AND the drive(s) with an FPGA, a microcontroller (my favorite
is the ATMega) and an SD card. Has anyone considered this already?
My idea is to use the FPGA only to handle the bus interface to the
command, status and data registers, as this is time-critical, and do
everything else in the uC, the RQM bit in the status register decoupling
the uC from the HD64180. DMA would be handled by the uC.
As I'm mostly running from the HD, I do not worry too much about speed
here, but if the floppy drive(s) I have cease to work, the whole thing
is useless.

Josef

PS My idea is to have drive 1 (the boot drive) "hard-wired" (in
software) to the first 2KB of the SD card and the rest of the card
randomly assignable to drives 2-4. That would also allow me to transfer
software more easily from a Linux machine to the SB180FX.

Dennis Boone

unread,
Feb 22, 2022, 12:55:19 PM2/22/22
to
> I'm now worried about the floppy part and I would like to replace the
> FDC (8266) AND the drive(s) with an FPGA, a microcontroller (my favorite
> is the ATMega) and an SD card. Has anyone considered this already?

Any particular reason you're not just replacing the drives themselves
with something akin to a gofloppy?

De

Randy McLaughlin

unread,
Feb 22, 2022, 2:45:03 PM2/22/22
to
It seems a new floppy controller without new mechanical floppy drives is odd.


Randy

Josef Moellers

unread,
Feb 23, 2022, 6:50:32 AM2/23/22
to
I had purchased something like that but it insisted on providing 512
byte sectors while the SB180FX likes 1024 byte sectors better.
In fact, I never managed to get the SB180FX to talk to or otherwise
recognize the GOTEK thingy.

NB I also regard this project as doing something for fun and (hopefully)
have some successes.

Josef

Josef Moellers

unread,
Feb 23, 2022, 6:53:19 AM2/23/22
to
On 22.02.22 20:44, Randy McLaughlin wrote:
> It seems a new floppy controller without new mechanical floppy drives is odd.

I'm not sure I understand what you're aiming at.

My idea is to replace the floppy controller and everything behind it by
the FPGA/uC/SD-Card contraption.

Dennis suggested leaving the FDC in and just replace the mechanical
drive with something not moving.

Josef

Peter Higgins

unread,
Feb 23, 2022, 10:44:21 AM2/23/22
to
Without modification the Gotek floppy emulator is designed to function as a standard PC-format 3.5" drive with 512 byte sectors, which won't work with most vintage systems like the SB180FX.
However, with third-party firmware installed on the Gotek (either the HxC firmware, or FlashFloppy) it can be configured to emulate any of the 5.25" floppy formats supported by the SB180FX. No modification of the SB180FX hardware or software is required. These alternative firmware solutions for the Gotek provide for a lot of configuration options - for example I have used the Gotek and HxC firmware to emulate a 5.25" double-sided 96tpi drive on a system that creates an 800K format disk using 1024 bytes/sector.

Dennis Boone

unread,
Feb 23, 2022, 11:33:31 AM2/23/22
to
> I had purchased something like that but it insisted on providing 512
> byte sectors while the SB180FX likes 1024 byte sectors better.
> In fact, I never managed to get the SB180FX to talk to or otherwise
> recognize the GOTEK thingy.

Interesting. A detail I'll have to keep in mind.

> NB I also regard this project as doing something for fun and (hopefully)
> have some successes.

Always a perfectly valid reason!

De

Josef Moellers

unread,
Mar 14, 2022, 8:59:02 AM3/14/22
to
Hello Peter,

On 23.02.22 16:44, Peter Higgins wrote:
> Without modification the Gotek floppy emulator is designed to function as a standard PC-format 3.5" drive with 512 byte sectors, which won't work with most vintage systems like the SB180FX.
> However, with third-party firmware installed on the Gotek (either the HxC firmware, or FlashFloppy) it can be configured to emulate any of the 5.25" floppy formats supported by the SB180FX. No modification of the SB180FX hardware or software is required. These alternative firmware solutions for the Gotek provide for a lot of configuration options - for example I have used the Gotek and HxC firmware to emulate a 5.25" double-sided 96tpi drive on a system that creates an 800K format disk using 1024 bytes/sector.

I successfully (by the 3digit LED display) flashed my GoTek with
FlashFloppy.

However, I'm apparently having problems getting the FF.CFG, IMG.CFG, and
IMAGE_A.CFG right.
Do you have any experience and would be able to help me?
I need an 80cyl, 2hd, 5spt, 1024bps, so I wrote this into my IMG.CFG:

+---------
[::819200]
cyls = 80
heads = 2
secs = 5
bps = 1024
gap3 = 99
+---------

and here's my FF.CFG:

+---------
interface = shugart
host = unspecified
pin02 = auto
pin34 = auto
write-protect = no
max-cyl = 255
side-select-glitch-filter = 0
track-change = instant
write-drain = instant
index-suppression = yes
head-settle-ms = 12
motor-delay = ignore
chgrst = step
ejected-on-startup = no
image-on-startup = last
display-probe-ms = 3000
autoselect-file-secs = 2
autoselect-folder-secs = 2
folder-sort = always
sort-priority = folders
nav-mode = default
nav-loop = yes
twobutton-action = zero
rotary = full
indexed-prefix = "DSKA"
display-type = auto
oled-font = 6x13
oled-contrast = 143
display-order = default
display-off-secs = 60
display-on-activity = yes
display-scroll-rate = 200
display-scroll-pause = 2000
nav-scroll-rate = 80
nav-scroll-pause = 300
step-volume = 10
da-report-version = ""
extend-image = yes
+---------

I have an image file BOOT.IMG which has the image of the boot floppy and
IMAGE_A.CFG has only one line: "BOOT.IMG"

When I try to read a sector off this in the monitor, I get a
Disk R/W Error !
Drive 0

ST0 40 01000000
ST1 04 00000100
ST2 00 00000000
Track 00 00000000
Head 00 00000000
Sector 11 00010001

The "01" bits in ST0 ist the "Interrupt Code" and means "Abnormal
Termination of Command (AT)":
"Execution of Command was started, but was not successfully
completed."
The "1" bit in ST1 means "No Data" (ND):
"During execution of READ DATA, WRITE DELETED DATA or
SCAN Command, if the FDC cannot find the Sector specified in the
IDR Register, this flag is set."
(The FDC is an FDC9266)

Any help would be appreciated,

Josef

Josef Moellers

unread,
Mar 15, 2022, 5:14:15 AM3/15/22
to
Problem solved: the floppies had sector# 17 ("11H") as the first sector
number in a track, not "1", as is the default.
I added "id = 17" and ... voila ... it worked!

So now my SB180FX boots from ... a USB stick, only to switch over to the
(flash) HDD immediately ;-)

Josef
0 new messages