Skip to content

Conversation

@paulofduarte
Copy link

@paulofduarte paulofduarte commented Feb 2, 2019

Modified the behavior of the current track location on Arduino boot to better support other floppy drives, like SONY MPF920.

Hi Rob,

First I'd like to thank for this project. I can tell you put a lot of effort on it and it's great that you have shared it.

I've found some small issues with my floppy drive (SONY MPF920) using the current firmware code. After some trial and error I managed to drill down to the fact that my drive doesn't report track zero correctly unless the PIN_MOTOR_STEP is set to HIGH for some time. The effect of that is the goToTrack0 method keep trying to decrease the position even when the head is already at track 0 forcing the step motor. Making PIN_MOTOR_STEP HIGH at the Arduino setup solves the issue. This also seems more correct to me as after each call of stepDirectionHead the PIN_MOTOR_STEP is left at HIGH, so this could avoid potential issues (like skipping the first head move) with some floppy driver if the implementation expects the step motor to moving on the falling edge of the PIN_MOTOR_STEP pulse to low.

Another change I applied was to change the initial value of currentTrack from 0 to -1 and use this to identify an unknown head position. If a call to gotoTrackX is made with this state I've added a check to go to track 0 first, making sure the current head position is reliable. This would not affect the windows tools you provided as they always seems to call goToTrack0 before doing any of the read/write operations. But while I was playing directly with a serial terminal and with my attempts of writing my own read/write code I've realised that if you reboot the Arduino and the head is not at track 0, calling gotoTrackX is not reliable until you call goToTrack0, so I think adding this extra check will make the firmware more reliable.

Both changes are very simple and should not have any unwanted side-effects. I'd be glad if you could add mine contribution to the main project as it may benefit others suffering from similar issues.

Regards,
Paulo Duarte

…to better support other floppy drivers, like SONY MPF920.
@hpingel
Copy link

hpingel commented Sep 30, 2019

What is the symptom that led to you analysis? I have a symptom here and I would be glad if you would be able to clarify that this was also your symptom.

I am also working on a tool that communicates directly via serial connection and sometimes I have the following situation: Motor + green LED at floppy turns on, but when I issue the command to move the head to any track nothing happens. I don't hear a clicking noise at all.

@paulofduarte
Copy link
Author

What is the symptom that led to you analysis? I have a symptom here and I would be glad if you would be able to clarify that this was also your symptom.

I am also working on a tool that communicates directly via serial connection and sometimes I have the following situation: Motor + green LED at floppy turns on, but when I issue the command to move the head to any track nothing happens. I don't hear a clicking noise at all.

In my case what was happening was when I was using the application and I restarted the arduino board I was having trouble with the position of the head. Sometimes forcing it above its limits. So I've changed the sketch to don't assume head 0 at startup, setting it to -1 (unknown), then before doing anything that expect the head to be in position zero I call goToTrack0.

I think in your case the problem is due to the fact the the PIN_MOTOR_STEP is activated when a pulse to low is detected. I've also changed the line 188 of the sketch to make sure the value start as HIGH, so the pulse is correctly detected.

RobSmithDev added a commit that referenced this pull request Nov 24, 2020
…ck location on Arduino boot - paulofduarte) which also addresses issues with some drives and updated firmware to 1.4

Made a small change to the diagnostics code to also erase the track before writing it
@RobSmithDev RobSmithDev merged commit 1ff1d7e into RobSmithDev:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants