Korg Trinity + Gotek with HxC problem

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »

Ramucho wrote:Can you confirm that the SD HxC works great with a Korg Trinity synth ?
yes !

Ramucho wrote:If so, do you have one that I could test. Of course I pay you a caution via Paypal if you agree.
No. Wasting time and money with the postage.
Ramucho wrote: Does the STM32 code is compiled with optimizations ?
Is it overclocked ?
This part is in assembly. There is no way to solve the drive selection io latency by software.
Anyway this is not the actual problem because the permanent drive selection solve this issue.

So please answer to these questions :

With the firmware i sent to you by email and the drive permanently selected (DS0 to gnd) :

Is the image change correctly detected by the Korg ?

If not : Is the image change correctly detected by the Korg when the you eject and reinsert the usb stick ?

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

There are differences between SD HxC and Gotek :

PIC 16F4620@32MHz (31.25ns clock period) vs STM32F105RBT6@72MHz (13.89ns clock period). 8bit vs 32bit. This implies that the signals generated by the STM32 must be delayed because of a higher speed clock. One solution is to underclock the STM32 to behave like the 16F4620 (STM32@48MHz for ex.). Have you ever tried that ?

There are no reasons the STM32 can not do the job. It's a much more powerful microcontroller.
It would be interesting to compare the signals generated by both drives particularly the delays and durations (timings). It is possible the STM32 reacts too fast and the signals are shortened :)

I'll try what you asked me to do later in the afternoon... ;)

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »

Ramucho wrote:There are differences between SD HxC and Gotek :

PIC 16F4620@32MHz (31.25ns clock period) vs STM32F105RBT6@72MHz (13.89ns clock period). 8bit vs 32bit. This implies that the signals generated by the STM32 must be delayed because of a higher speed clock. One solution is to underclock the STM32 to behave like the 16F4620 (STM32@48MHz for ex.). Have you ever tried that ?

There are no reasons the STM32 can not do the job. It's a much more powerful microcontroller.
You have completely missed the point that the SD HxC Pin 2, 34 and data lines are gated by NAND gates. There is no need to manage the drive selection/unselection by software. The speed of the SD HxC at this point is about ~20ns. ;)
The gotek have to manage it by software : Interrurpt latency -> Check the selection IO state, Change the all floppy pin state according the DS state,...
And a last thing : the gotek use very slow mosfets to drive the bus. The whole thing take between 600ns/1us...

An pure software solution can't just beat a simple hardware solution. Even with a MCU @ 400Mhz a pure software stuff can't be reliable at this point. A simple gate can save a product from lots of troubles and useless efforts ;)

The MCUs speed isn't the only thing to compare.

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Jeff wrote:
You have completely missed the point that the SD HxC Pin 2, 34 and data lines are gated by NAND gates. There is no need to manage the drive selection/unselection by software. The speed of the SD HxC at this point is about ~20ns. ;)
The gotek have to manage it by software : Interrurpt latency -> Check the selection IO state, Change the all floppy pin state according the DS state,...
And a last thing : the gotek use very slow mosfets to drive the bus. The whole thing take between 600ns/1us...

An pure software solution can't just beat a simple hardware solution. Even with a MCU @ 400Mhz a pure software stuff can't be reliable at this point. A simple gate can save a product from lots of troubles and useless efforts ;)

The MCUs speed isn't the only thing to compare.
You are right but it helps :) Do you know what are the typical timings in a floppy transaction ? I couldn't find that on internet. Have you ever compare the signals between SD HxC and Gotek ?
I don't think the 600ns/1µs delay is really a problem because floppy are originally quite slow, so are the transactions. The FDC needs the drive to be ready to do something. The Gotek is fast enough, I think. The response time of the STM32 is the most important. In this case try to overclock the STM32 @ 96 MHz.
So, all I have to do is to modify the Gotek with an additional NAND chip. Right ? ;)

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »

Ramucho wrote: You are right but it helps :)
Not really in this particular case. An interrupt still quite slow, even on an Core I7 ;)
Ramucho wrote: Do you know what are the typical timings in a floppy transaction ?
According to your feedback and the test results with the new firmware, the korg check the disk change line right after the drive selection. Probably 100/200ns after the drive selection.
Ramucho wrote: I couldn't find that on internet. Have you ever compare the signals between SD HxC and Gotek ?
These constrains are specific for each system. This depend how the fdc routines are coded into the machine.
Anyway a true floppy drive output signal are valid 20/50ns after the selection.
Ramucho wrote: I don't think the 600ns/1µs delay is really a problem because floppy are originally quite slow, so are the transactions. The FDC needs the drive to be ready to do something.
Don't mix the mechanical and the electronic part of the drive. The status signals must be valid right after the drive selection.
This is a major problem if you plan to design a "one mcu only" floppy emulator like the gotek.
Ramucho wrote: The Gotek is fast enough, I think.
Believe me : It is not.
(BTW and FYI : The gotek internal flash is quite slow and introduce many wait state at 72Mhz... ;) )
Ramucho wrote: So, all I have to do is to modify the Gotek with an additional NAND chip. Right ? ;)
No : Just stick the drive select to GND. Why you don't want do it ?

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

In this pdf http://www.techtravels.org/wp-content/u ... 070103.pdf there are interesting timings for a floppy drive and signals transaction.

Don't worry, I'll try later what you expected me to do :) I just try to understand and find a solution for these problems. I'm confident ! That's why I ask you many questions ;) Thanks for your answers and your patience.

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »


Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Jeff wrote: So please answer to these questions :

With the firmware i sent to you by email and the drive permanently selected (DS0 to gnd) :

Is the image change correctly detected by the Korg ?

If not : Is the image change correctly detected by the Korg when the you eject and reinsert the usb stick ?
Well, I did it ! I put back the firmware you sent to me.
So, yes the synth detects disque change but I need to touch the screen twice to get the files displayed (refreshing).
I can then select a file and load it.

If I eject the USB stick and wait a while before inserting it again, then it is detected, and I always need to touch the screen twice to get the files displayed.

Whatever the disk selection you choose (DS1 or DS0 to GND) it works the same.

Now, with the original firmware no change. It works the same way as the firmware you sent to me.

In both cases, the synth doesn't display the message "Medium changed" as it does normally with a floppy drive.

------

You spoke about interrupts to detect signals. Are they edge or level sensitive ? I hope they are edge sensitive otherwise it could cause problems in syncing.


Important :

With the original firmware :

If I change the image and wait for about 4-10s and refresh the files, then most of the time the synth has a correct behaviour and display the message "Medium changed" ! This delay is about the same when a real floppy drive is connected to the synth and a refresh is done (see previous post). It's like the FDC waits for the drive to be ready.

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Hi Jeff, great news !

Well, I decided to realize a small breadboard with some electronics to create my own disk change signal and it's working great as expected !

The disk detection signal goes low and stays in this state each time I change the image. It goes high only when a refresh occures using step and drive selection signals. Now I can load files in the synth with no problem without forcing the drive selection signal to GND. The synth displays the "Medium changed" message. This is the correct and normal behaviour of the drive.

Now I'm going to make a small breadboard and integrate it in the Gotek and close the synth forever :)

So I can confirm that the problem is really in the generation of the disk change signal with the STM32F or in the detection of the signals step and disk selection. However, they can be detected correctly because files can be loaded. Oops ! This depends on how your code works maybe. The shortest signal is "step". Do you detect this signal first (interrupt) and test disk selection low after that to change the DC signal ?

Many thanks for your help and your patience.


P.S. : The next problem to solve is "debouncing" the buttons (see one of my posts in which I explained the problem) ;)

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »

Email sent.

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Hi Jeff,

Nice improvement with the firmware you sent to me. It works, but the synth never displays the "Medium changed" when the image changes. The DS1 jumper must be set. The problem is that I need to touch the screen twice or more to make the refresh happen. I have the same problem with my own disk change signal I made except that "Medium changed" message is displayed.

A thing I've seen is that if I press severals time the up or down buttons, I need to touch the screen more than twice to get a refresh (even with my own signal). Is it due to the synth ? I don't know.

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Ramucho wrote:Hi Jeff,

Nice improvement with the firmware you sent to me. It works, but the synth never displays the "Medium changed" when the image changes. The DS1 jumper must be set. The problem is that I need to touch the screen twice or more to make the refresh happen. I have the same problem with my own disk change signal I made except that "Medium changed" message is displayed.

A thing I've seen is that if I press severals time the up or down buttons, I need to touch the screen more than twice to get a refresh (even with my own signal). Is it due to the synth ? I don't know.
Any idea Jeff ? :)

Jeff
Site Admin
Posts: 7327
Joined: Fri Oct 20, 2006 12:12 am
Location: Paris
Contact:

Re: Korg Trinity + Gotek with HxC problem

Post by Jeff »

Ramucho wrote:
Ramucho wrote:Hi Jeff,

Nice improvement with the firmware you sent to me. It works, but the synth never displays the "Medium changed" when the image changes. The DS1 jumper must be set. The problem is that I need to touch the screen twice or more to make the refresh happen. I have the same problem with my own disk change signal I made except that "Medium changed" message is displayed.

A thing I've seen is that if I press severals time the up or down buttons, I need to touch the screen more than twice to get a refresh (even with my own signal). Is it due to the synth ? I don't know.
Any idea Jeff ? :)
About what ? Is there a problem ?

Ramucho
Posts: 37
Joined: Mon Jun 20, 2016 9:36 pm

Re: Korg Trinity + Gotek with HxC problem

Post by Ramucho »

Ramucho wrote:Hi Jeff,

Nice improvement with the firmware you sent to me. It works, but the synth never displays the "Medium changed" when the image changes. The DS1 jumper must be set. The problem is that I need to touch the screen twice or more to make the refresh happen. I have the same problem with my own disk change signal I made except that "Medium changed" message is displayed.

A thing I've seen is that if I press severals time the up or down buttons, I need to touch the screen more than twice to get a refresh (even with my own signal). Is it due to the synth ? I don't know.

First test done when not in the synth disk menu :

I'm looking for an image to load. So I press the up and down buttons several times on the Gotek. When ok, I press the disk button on the synth to enter the disk menu. Automatically, the synth refreshes the image content without any problem and I can load the selected file. All is done ok.

Second test done from the synth disk menu :

a) If I only press the Gotek up or down button once :
I just need to press the touchscreen once to refresh the image correctly and load it. So no problem

b) If I press several times the up or down buttons on the Gotek, I need to touch the screen twice or more to get a refresh. Then after that, I can load the selected file.

So what do you think about this beahaviour ? Is it due to the synth or not ?

alchemist
Posts: 31
Joined: Wed Nov 29, 2017 9:48 pm
Location: Belgium

Re: Korg Trinity + Gotek with HxC problem

Post by alchemist »

Hi!,

I have flashed a Gotek drive and tried it with my Korg Trinity.

But the Trinity doesn't see the diskettes images. I tried with the S0 and S1 jumpers, and without jumpers: I got "unformatted" messages or "no drive", and I cannot format or access the images.

And after reading the 4 pages of this thread, I cannot see if the Gotek will work with the Trinity.

Can someone tell me if it will work?

Otherwise, do the genuine SD HxC version work?
Kind Regards,
Xavier Miller

Post Reply