Closed Tallguy297 closed 2 years ago
https://aminet.net/package/disk/misc/Empty_ADF_files
You can find it inside this package on aminet. You can also create one using "install df0:" shell command with an empty HD ADF inserted in Gotek.
Sorry to bother you Kierf, I was trying to set dens/ndens signal to pin34 in FF.cfg to use it to supply the disk density info to the external pcb (in that way I can remove the manual switch) using regular flashfloppy 3.35 fw, but the custom settings of pin2 and pin34 in ff.cfg, seem to have no effects. Is it normal? Should I change something else?
pin34 configuration won't work for interface=amiga. It should work for any other interface setting.
Hi Keirf, Here is some info after a few tests. On my configuration (A4000, stock A3640, kickstart version 46.143 (3.1.4)) with a gotek drive SFRC9220 I just can't boot with an HD drive nor use any HD image. The Workbench say "unreadable drive" (translate from french) when I select an HD image. I used a logic analyser to capture some of the signal from the connector with a second real floppy drive to compare the ID negociation between the too. The real drive is slightly more reactive than the Gotek (more or less 1 sample @4Mhz) but what is different is that the real disk drive does not change the DCHNG line during the negociation. The Gotek does. The result is that the real drive is in the Select Boot Drive list in the early staurtup but not the Gotek drive. Don't know if this is important. I can send you an capture of the sequence (screenshot or pulseview file) if you want.
Yes please, traces with some explanation would be very illuminating for this boot time issue!
Inspecting more closely, the low to high transition of the RDY if a little late comparing to the real floppy drive. About 750 ns / 1 us. Attached is the Pulseview files with two drives (Gotek + real) with both HD floppies. I've zoom on the ID negociation but you can see the full sequence (No boot, because no drive recognized for SD0 which is Gotek) HD cold boot sequence with two drives.zip After the ID negociation, the SEL0 signal is never pull down again. This is like the Amiga give up with this drive.
Late response is unavoidable because signal gating is managed in software. I assume you are using an STM32 or AT415 chip? New 435 Goteks should respond much faster (but still not as fast as a real drive).
Still it is presumably fast enough as HD identification seems to work apart from at boot?
No, the HD identification doesn't work at all. HD image are not recognise. In the sequence, the RDY signal is shifted one pulse earlier with the gotek compared to the real drive. So I think the amiga see 010101 instead of 10101 (or the contrary) ? And yes, this is a STM32 model.
If you're really interested to get better emulation you will need to hook up motor signal on your gotek. Or get a new 435 based gotek which is both faster and has motor signal jumperable. And then try the test firmware linked here about three weeks ago.
Another option is to work together to design an external circuit to generate ready signal properly, generate motor signal from mtrx, and gate signals on select signal in hardware.
External circuit works fine already, but the signal den/nden doesn't seems to work with Amiga ADF, I always get a low signal with both DD or HD ADF inserted, so you have to switch manually the external circuit.
I've already mod the gotek with a 1k pullup resistor and connect the pin16 to pin 36 of STM32. And the test I sent you is with the fimrware downloded from this discussion. The OLED says b559c92. Is it the last one ?
Motor signal delay is not really needed for HD ready signal to work, however the ready pulse timing must be correctly in sync with the sel and motor signal from the Amiga
I've already mod the gotek with a 1k pullup resistor and connect the pin16 to pin 36 of STM32. And the test I sent you is with the fimrware downloded from this discussion. The OLED says b559c92. Is it the last one ?
Yes that's right. Did you also put the required settings in FF.CFG?
External circuit works fine already, but the signal den/nden doesn't seems to work with Amiga ADF, I always get a low signal with both DD or HD ADF inserted, so you have to switch manually the external circuit.
From stock firmware? I could fix this. However den/nden are also gated on select input signal. For your external circuitry you might not want that.
I think this is the case : interface = amiga pin02 = auto pin34 = auto motor-delay = 200
signal
Well it would be great to have a single output pin: signal low (0V) when a DD ADF is inserted and signal high (5V) when HD ADF is inserted. The external circuit would then work without manual switching. It even boots HD ADF, already tested with the manual switch.
I think this is the case : interface = amiga pin02 = auto pin34 = auto motor-delay = 200
Yes that's right. Perhaps the Gotek is just too slow to work reliably in all cases. It does seem to be mostly working for Madowax. The new faster Gotek chip might work better but hard to know for sure.
In my case your test firmware works great except for boot, but with the external circuit even the standard firmware works fine and it even boots, no need to use interface=Amiga or motor-delay in FF.cfg. The only thing missing is the density output signal from gotek to allow the external circuit to automatically switch the ready signal from DD to HD.
In my case your test firmware works great except for boot, but with the external circuit even the standard firmware works fine and it even boots, no need to use interface=Amiga or motor-delay in FF.cfg. The only thing missing is the density output signal from gotek to allow the external circuit to automatically switch the ready signal from DD to HD.
Do you need the pin to output 0v when a DD ADF is inserted regardless of whether the drive is selected? Ie an ungated output? Also would it be okay if DD were 5v and HD 0v?
Yep ungated would be great, like the HD/DD hardware switch of many PC drives, if the floppy got the HD hole the switch is not pressed and if the floppy has no HD hole the switch is pressed, it is the same for me if the signal output is DD = 5V and HD = 0V.
Yep ungated would be great, like the HD/DD hardware switch of many PC drives, if the floppy got the HD hole the switch is not pressed and if the floppy has no HD hole the switch is pressed, it is the same for me if the signal output is DD = 5V and HD = 0V.
I should be able to rustle something up.
No, the HD identification doesn't work at all. HD image are not recognise. In the sequence, the RDY signal is shifted one pulse earlier with the gotek compared to the real drive. So I think the amiga see 010101 instead of 10101 (or the contrary) ? And yes, this is a STM32 model.
Have you tested to see what ID Amiga Test Kit reads in its floppy subtest? Every time you enter the subtest menu, the floppy IDs are resampled and displayed.
Yes that's right. Perhaps the Gotek is just too slow to work reliably in all cases. It does seem to be mostly working for Madowax. The new faster Gotek chip might work better but hard to know for sure. What is strange, is that the RDY line of the Gotek seems to be one SEL0 pulse ahead compared to the real drive. In this pictures you can see tha t the first pule of RDY line is "under" the first pulse of SEL for Gotek and the second pulse of SEL for the real drive.
Hmmmmm agreed. I will have to test this myself.
Okay here is a trace on my 435-based drive, using Amiga Test Kit (hence the SEL pulsing is much slower here, as ATK is written in unoptimised C, rather than the slick asm used for low-level Kickstart ROM routines). Click the picture to enlarge and make it legible.
So what's happening here?
Why does this work for me? Apart from the SEL toggling being way slower, note that the RDY runt pulse is about 850ns wide. I estimate that the two ISRs take a total of about 1200ns to run from SEL being asserted. This would probably therefore work in your case too, since your worst-case SEL pulse width is about 1500ns.
But you are not running on a 435. STM32 and 415 chips are clocked at 72MHz, that's a quarter speed of the 435! Plus STM32 is executing out of slow Flash. There is prefetch, but branches and exceptions are more expensive. So the STM chip is running at less than quarter speed of the 435. So that total of 1200ns ISR latency on 435 is probably more like 5000ns on STM!
In short: STM is just too slow to implement this accurate (enough) HD ID emulation. You need to get yourself a faster Gotek :)
PS. As to why DSKCHG is asserted in your boot trace on Gotek. Do you have a trace from power on? Can you see where the drive heads are stepped and thus the drive should deassert DSKCHG? Perhaps the Gotek is too slow to boot and misses the head step? Perhaps 435 is faster or we can otherwise work on this...
Thank you for this detail explication. So un real life, we have two choices :
PS. As to why DSKCHG is asserted in your boot trace on Gotek. Do you have a trace from power on? Can you see where the drive heads are stepped and thus the drive should deassert DSKCHG? Perhaps the Gotek is too slow to boot and misses the head step? Perhaps 435 is faster or we can otherwise work on this...
Here are the traces for a full boot sequence with an DD image, two drives connected (Gotek + real). The first one at the very beginning on power on (+5v is used as a trigger) The second one approx. 3.4s after with the ID sequence and the same problem. It seems the the DCHNG signal his exactly the same as RDY. I think that 3.4s is enough for the gotek to boot, but let me know. Between the to traces no signals changes at all.
And @keirf , where can we buy such a 435 based model for sure ? I tried ebay for exemple and there is nowhere a mention of the exact model of the chip used... :/
Well, I did honestly expect there would be more resellers by now. But you can get them from me directly. I am zeroflux on ebay uk. Or email me. I do 888 LED model for £28 and OLED + rotary model for £37. Plus postage.
Here are the traces for a full boot sequence with an DD image, two drives connected (Gotek + real). The first one at the very beginning on power on (+5v is used as a trigger) The second one approx. 3.4s after with the ID sequence and the same problem. It seems the the DCHNG signal his exactly the same as RDY. I think that 3.4s is enough for the gotek to boot, but let me know. Between the to traces no signals changes at all.
DSKCHG looks like RDY because both are asserted (LOW). But they are gated on drive select. So of course they toggle together, in response to drive select.
I think it is normal for DSKCHG to be asserted at power on, even if a disk is inserted at power on. I have just confirmed this on drives made by NEC, Sony, and Teac.
The only thing that should deassert DSKCHG is a head step operation (ie a pulse on STEP while drive is SELected). If you do a trace from power on, is there any activity on STEP before the ID sequence?
Can you boot Amiga Test Kit and check DSKCHG behaviour in the floppy signal test? When you eject a disk from the real Amiga HD drive you should see CHG asserted. You should then see it deassert only after you insert a disk and then step the heads (action key F6). Some drives may instead deassert CHG after a second or two after inserting a disk. It would be interesting to know which behaviour the real Amiga HD drive exhibits.
The only thing that should deassert DSKCHG is a head step operation (ie a pulse on STEP while drive is SELected). If you do a trace from power on, is there any activity on STEP before the ID sequence?
You're right, there is no step activity on power on until the first disk activity after the ID sequence.
The only thing that should deassert DSKCHG is a head step operation (ie a pulse on STEP while drive is SELected). If you do a trace from power on, is there any activity on STEP before the ID sequence?
You're right, there is no step activity on power on until the first disk activity after the ID sequence.
I do actually have an Amiga HD drive myself. I will find some time to do some experiments.
The only input signals needed are SEL0 and MTR0 from the amiga motherboard for the HD ready ID to work properly. If there is a HD ADF in the drive it should not pull the READY line low the second time the SELECT line is low. For every even pulse on the SELECT line no READY pulse is given. Also an open drain output for the ready signal seems to be required since it is quite fast and it sinks quite a lot of current.
On reflection I'm pretty sure the boot time DSKCHG difference is a red herring.
On reflection I'm pretty sure the boot time DSKCHG difference is a red herring.
Furthermore, I plugged in my Amiga HD drive and as expected DSKCHG is not deasserted until after a head step operation. And DSKCHG is asserted at power on. So this whole DSKCHG thing probably really is a diversion.
Hi Keirf, I can confirm that this is only a timing issue. The delay between SEL0 and RDY must be really short the allow the Amiga to detect the right value on RDY. My CHINON FB-357A as not the same behaviour than the Gotek regarding DSKCHG on power on but this change nothing for the boot sequence. I suceeded to boot from Gotek with HD floppy and a little external circuit (certainly the same as Madowax). So I conclude that the STM Gotek model will never be fast enough to support HD floppy for Amiga. If this work, this is only kind of luck and not reliable. For the external circuit to be autonomous, it needs to have a signal to know the density of the floppy disk. In my version, DD=0, HD=1 (5v) but can be change easely.
Do you have a link or reference for the external circuit?
Do you have a link or reference for the external circuit?
http://jope.fi/drives/fz357/CHINON1.JPG
Reference circuit for Chinon, it works every time with gotek. I have designed a little pcb that can be directly soldered on gotek floppy header using this reference.
The pull down resistor at pin 6 is a bit weird. I suppose maybe that's to work with drives with no HD capability and no output on that pin?
I propose a new interface=shugart-amigaden which would put permanent /DD output on pin JC. Pin 34 would work as regular Shugart. JC would be open collector and require a pull up rather than pull down.
That's exactly what I've done. Based on your Schema, MadoWax and changed the pull down with an 1k pull up. Work every time. /DD open for HD and connected to ground for a DD. Kerif, your proposition sound good. Madowax can you share your PCB design ?
The pull down was there for when the Chinon had no floppy inserted, so the pull down resistor would pull the signal down and force a DD ready ID. it is not needed with a manual switch or it could be inverted to pull up with your proposed open collector output on JC, pin 34 can also be configured as none in FF.cfg since the ready signal would be completely handed to the external pcb. So if you need that pull up resistor I will modify the schematics and post them here for your approval, is it ok for you?
The alternative is to put the density signal on pin 34, rather than JC. I did wonder though if alternative designs might want to use RDY on pin34 when motor is on.
This is designed to slide and be soldered directly on the gotek floppy pin header, you just have to remove the pin header black spacer rows, the board will replace them and keep together the pin header. the whole board is 1,5 cm high and I can still shave off a couple of millimeters.
The alternative is to put the density signal on pin 34, rather than JC. I did wonder though if alternative designs might want to use RDY on pin34 when motor is on.
I prefer to not change the behaviour of pin34. My design pick the signals from the gotek PCB and I prefer not to desolder the floppy cable header. So the way it work with pin34 is fine. With /DD signal on pin34 the external circuit as to be between the gotek and the ribbon cable. Maybe an option ?
The alternative is to put the density signal on pin 34, rather than JC. I did wonder though if alternative designs might want to use RDY on pin34 when motor is on.
I prefer to not change the behaviour of pin34. My design pick the signals from the gotek PCB and I prefer not to desolder the floppy cable header. So the way it work with pin34 is fine. With /DD signal on pin34 the external circuit as to be between the gotek and the ribbon cable. Maybe an option ?
Maybe I did not explain myself, there is no need to desolder anything with my pcb, you can also keep the pin 34 behavior and not change it, it works nevertheless. You just solder the PCB on the header without desoldering or anything.
The alternative is to put the density signal on pin 34, rather than JC. I did wonder though if alternative designs might want to use RDY on pin34 when motor is on.
I prefer to not change the behaviour of pin34. My design pick the signals from the gotek PCB and I prefer not to desolder the floppy cable header. So the way it work with pin34 is fine. With /DD signal on pin34 the external circuit as to be between the gotek and the ribbon cable. Maybe an option ?
Maybe I did not explain myself, there is no need to desolder anything with my pcb, you can also keep the pin 34 behavior and not change it, it works nevertheless. You just solder the PCB on the header without desoldering or anything.
Sorry, I juste understand :) : You just have to remove the black plastic and slide the PCB as far as possible and solder it. Good idea ! I just wonder why you need 3 ICs on your solution ?
@Madowax does your Gotek have the JC jumper position? (ie. just to confirm it is not an old SFRKC30.AT2 board)?
The alternative is to put the density signal on pin 34, rather than JC. I did wonder though if alternative designs might want to use RDY on pin34 when motor is on.
I prefer to not change the behaviour of pin34. My design pick the signals from the gotek PCB and I prefer not to desolder the floppy cable header. So the way it work with pin34 is fine. With /DD signal on pin34 the external circuit as to be between the gotek and the ribbon cable. Maybe an option ?
Maybe I did not explain myself, there is no need to desolder anything with my pcb, you can also keep the pin 34 behavior and not change it, it works nevertheless. You just solder the PCB on the header without desoldering or anything.
Sorry, I juste understand :) : You just have to remove the black plastic and slide the PCB as far as possible and solder it. Good idea ! I just wonder why you need 3 ICs on your solution ?
I choose to use 74hct08+7406 instead of a single 74ls38, it is more versatile if you just need to invert a signal without wasting a nand/and gate to do so. But it can be build with just two ICs with minor mods.
Okay, here is a new build with new features for interface = amiga
:
pin34 = rdy
to make pin 34 behave as Shugart.Note that if you do want to completely ignore Gotek pin 34 output on your adapter, you will need to cut the pin. It seems to me you could do this after soldering your adapter board to all 34 pins. After this, simply cut pin 34 where it meets the Gotek PCB? It would then still be mechanically secured by its solder connection to the adapter board.
PS. You need to be logged into GitHub for the below link to work. PPS. Note that signal JC is on the header row furthest from the JC text on the PCB. The pin right next to the text is GROUND!
https://github.com/keirf/flashfloppy/suites/8572573786/artifacts/383573937
I recently created a few bootable ADF 1.76MB Workbench Images.
They only seem to boot if I go through the AUTOBOOT process and select an image manually.
If I reset and try to reboot the same image, it is skipped and boot commences from the hard-drive.
It seems to get stuck on the 1st couple of tracks and then decides to skip.
If I boot using the hard-drive, 1.76MB ADF image is sensed. I can read, write & format.
If I select a standard 880Mb ADF image, when I reboot the image will boot successfully.
If boot the Workbench from the hard-drive, I can read, write & format the standard ADF image.
Is this a problem than can be corrected with a firmware patch/upgrade?
Thankyou...