HxC Floppy Drive Emulator

HxC Floppy Drive Emulator general information and news
It is currently Thu Jul 24, 2014 4:17 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Thomson MO5
PostPosted: Thu Apr 21, 2011 10:53 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
Ok, I'm working on the Thomson MO5 host support software now, so let's start a topic for it :)

After a week spent hacking around, I finally got the FAT driver working with the HxC, so I can list files on the SD card !
Now to write the software around that (I need to get write support working...)

For information, I used this FAT driver : http://elm-chan.org/fsw/ff/00index_p.html. My code currently takes 8 kilobytes, so it may be useful for other memory-constrained computers.

However, I have encountered a little problem : I can read fine (both from SD and floppy image) ; but I can't write if my real 5.25" drive is powered off (but still plugged to the floppy cable). I'll try unplugging it to see if it is better, but do you have any idea where this comes from ? It's strange because the MO5 thinks the data is written (no error), but when reading back, it's all gone...


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Fri Apr 22, 2011 9:03 am 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
Ok, I'm working on the Thomson MO5 host support software now, so let's start a topic for it :)

After a week spent hacking around, I finally got the FAT driver working with the HxC, so I can list files on the SD card !
Now to write the software around that (I need to get write support working...)

For information, I used this FAT driver : http://elm-chan.org/fsw/ff/00index_p.html. My code currently takes 8 kilobytes, so it may be useful for other memory-constrained computers.

However, I have encountered a little problem : I can read fine (both from SD and floppy image) ; but I can't write if my real 5.25" drive is powered off (but still plugged to the floppy cable). I'll try unplugging it to see if it is better, but do you have any idea where this comes from ? It's strange because the MO5 thinks the data is written (no error), but when reading back, it's all gone...


Hi,

Maybe a jumper setting conflit ?


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Fri Apr 22, 2011 7:23 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
It's set as DS0 when I want to boot from it and DS1 when I use it as a second drive with the other one plugged. It seems to behave fine (wakes up only when command are sent to its drive number). Other settings don't seem to work or behave strangely.

I think it just doesn't like having another drive plugged but not powered up, will try removing it to see if it's better.


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Fri Apr 22, 2011 9:31 pm 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
It's set as DS0 when I want to boot from it and DS1 when I use it as a second drive with the other one plugged. It seems to behave fine (wakes up only when command are sent to its drive number). Other settings don't seem to work or behave strangely.

I think it just doesn't like having another drive plugged but not powered up, will try removing it to see if it's better.


this probably a conflit with the other drive. The floppy disk drive is on DS0 or DS1 ?


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Fri Apr 22, 2011 9:46 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
The floppy drive is DS0 (so I can boot from it). So when I plug it with the HxC I set the HxC to DS1 obviously. In this configuration everything works fine.

When the drive is off, I can still use the HxC as DS1, but then I can't write to it. The other drive may be blocking the write signal somehow ?


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Fri Apr 22, 2011 10:30 pm 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
The floppy drive is DS0 (so I can boot from it). So when I plug it with the HxC I set the HxC to DS1 obviously. In this configuration everything works fine.

When the drive is off, I can still use the HxC as DS1, but then I can't write to it. The other drive may be blocking the write signal somehow ?


ah ok. Yes. In fact if you power down a drive on the bus, this one will drawn some current from the bus and "crush" the signal level of the bus...

So yes this is normal ;-).


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Wed May 11, 2011 11:06 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
Ok, unplugged my old 5.25 floppy drive and everything is running fine.

Now to the next problem : I'm making good progress on the host software for MO5/TO8, but I've found a problem. I think it's a "bug" in the firmware.

* When I run my software for the first time, everything works fine. I enter LBA mode and I can read and write without problems
* After some time without disk access, the drive motor is stopped (this is done by the MO5 floppy ROM, as I'm using the system routines for access to the drive)
* When I send a new command after that, the system stays locked. I get an "error 10" after a timeout. This means "drive not ready or not present".

I think the problem is when in LBA mode, the HxC doesn't send index pulses anymore, and the MO5 ROM/floppy controller is waiting for them (at least 5), to make sure the drive is spinning full speed.
I'm still using firmware 1.5.1.0. Should I upgrade ? was this fixed in a more recent version ? Or should I wait for a fix ? :) (sending index pulses in LBA mode). any other workaround to suggest ? Of course I could program the floppy controller directly, but there are at least 3 different models used in Thomson machines so this would make the whole thing a lot more complicated. The Floppy ROM is made to unify the disk access for everyone, and I'd like to use it.


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Thu May 12, 2011 12:24 am 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
Ok, unplugged my old 5.25 floppy drive and everything is running fine.

Now to the next problem : I'm making good progress on the host software for MO5/TO8, but I've found a problem. I think it's a "bug" in the firmware.

* When I run my software for the first time, everything works fine. I enter LBA mode and I can read and write without problems
* After some time without disk access, the drive motor is stopped (this is done by the MO5 floppy ROM, as I'm using the system routines for access to the drive)
* When I send a new command after that, the system stays locked. I get an "error 10" after a timeout. This means "drive not ready or not present".

I think the problem is when in LBA mode, the HxC doesn't send index pulses anymore, and the MO5 ROM/floppy controller is waiting for them (at least 5), to make sure the drive is spinning full speed.
I'm still using firmware 1.5.1.0. Should I upgrade ? was this fixed in a more recent version ? Or should I wait for a fix ? :) (sending index pulses in LBA mode). any other workaround to suggest ? Of course I could program the floppy controller directly, but there are at least 3 different models used in Thomson machines so this would make the whole thing a lot more complicated. The Floppy ROM is made to unify the disk access for everyone, and I'd like to use it.


In anycase upgrade your firmware to the last version.
The index signal is generate in lba mode.

are there an access to the floppy emulator at this moment?

Note : There are a sourceforge project now :
http://sourceforge.net/projects/hxcfloppyemu/
So you want to commit your work, let me know ;-)


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Thu May 12, 2011 7:47 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
No worry, the software will be opensourced when I get it to a good enough state to load a floppy image :)

I will try again with a newer firmware and see if it gets better.
There doesn't seem to be any activity : red led stays on, LBA sector doesn't move on LCD, and the Read command I send to the MO5 ROM code stays locked waiting for something. After ~5 seconds it timeouts and returns with no data read. Not sure which commands the ROM is trying to execute...


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Tue May 17, 2011 9:13 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
Ok, so I updated the firmware, and still no luck. Error 10 after the motor gets off.

This is really annoying, because once I'm in this state I can't do anything, getting out of LBA mode needs writing to the HxC which also doesn't work. I get both red and yellow led lit, and the screen shows LBA : 00001DF1 08 (last sector I read while drive was spinning).

I'm not sure what's hapenning, maybe the MO5 is trying to realign the drive head and doesn't get TRK0 signal back ? Hard to tell.

Anything else I can do to help debugging that ? Would allowing step commands to work even in LBA mode be an option ? At least sending Trk0 when getting a step or something like that ?


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Tue May 17, 2011 9:24 pm 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
Ok, so I updated the firmware, and still no luck. Error 10 after the motor gets off.

This is really annoying, because once I'm in this state I can't do anything, getting out of LBA mode needs writing to the HxC which also doesn't work. I get both red and yellow led lit, and the screen shows LBA : 00001DF1 08 (last sector I read while drive was spinning).

I'm not sure what's hapenning, maybe the MO5 is trying to realign the drive head and doesn't get TRK0 signal back ? Hard to tell.

Anything else I can do to help debugging that ? Would allowing step commands to work even in LBA mode be an option ? At least sending Trk0 when getting a step or something like that ?


Please Make a video of the problem, i want to see the emulator LED.


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Tue May 17, 2011 9:48 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
Here you go :
http://pulkomandy.lexinfo.fr/to8/

First video shows the bug
Second video is a closeup of the emulator
Third video first shows it working before the motor on timeout, then broken

At each read command I display the status on screen. 44 = ok, 10 = error.

Hope this helps. I should have some parts of the floppy reading routine disassembled somewhere, will see if I can find that in my messy harddrive...


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Tue May 17, 2011 10:39 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
Checked the ROM code, I think I found the offending part.
Beware, 6809 ASM talking to WD1773 controller below...

for reference, X points to the controller regs.

Code:
SeekCur LDA     $01,X   * Read the current track register
        STA     $03,X       * Copy it to the DATA register
        LDA     #$10        * Send SEEK command
        STA     ,X           
        LBSR    delay       * wait for ~35 cycles
        LDA     #$D0        * send FORCE INTERRUPT COMMAND
        STA     ,X           
        LBSR    delay       
        LDA     ,X           * Read FORCE INTERRUPT result
        ANDA    #$02          * Check 'index pulse' bit
        STA     TRACK3_LO   * Store it away
        LDY     #M8200       * Loop for a long time
ZA28B   LEAY    -$01,Y
        LBEQ    ZA2CA        * Delay out > Abort with error 10 << HERE IS THE ABORT
        LDA     ,X               * Read status again
        ANDA    #$02          * did index pulse bit move ?
        CMPA    TRACK3_LO
        BEQ     ZA28B          * If not, keep waiting


The actual error may be somewhere else. But it seems the ROM decided to seek for some reason, and it obviously doesn't work. Any idea what can be done ? Or should I try to work around it myself ?


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Wed May 18, 2011 12:22 am 
Offline
Site Admin

Joined: Fri Oct 20, 2006 12:12 am
Posts: 3447
Location: Paris
pulkomandy wrote:
Checked the ROM code, I think I found the offending part.
Beware, 6809 ASM talking to WD1773 controller below...

for reference, X points to the controller regs.

Code:
SeekCur LDA     $01,X   * Read the current track register
        STA     $03,X       * Copy it to the DATA register
        LDA     #$10        * Send SEEK command
        STA     ,X           
        LBSR    delay       * wait for ~35 cycles
        LDA     #$D0        * send FORCE INTERRUPT COMMAND
        STA     ,X           
        LBSR    delay       
        LDA     ,X           * Read FORCE INTERRUPT result
        ANDA    #$02          * Check 'index pulse' bit
        STA     TRACK3_LO   * Store it away
        LDY     #M8200       * Loop for a long time
ZA28B   LEAY    -$01,Y
        LBEQ    ZA2CA        * Delay out > Abort with error 10 << HERE IS THE ABORT
        LDA     ,X               * Read status again
        ANDA    #$02          * did index pulse bit move ?
        CMPA    TRACK3_LO
        BEQ     ZA28B          * If not, keep waiting


The actual error may be somewhere else. But it seems the ROM decided to seek for some reason, and it obviously doesn't work. Any idea what can be done ? Or should I try to work around it myself ?


Try to force the selection of the emulator by grounding the DS0 line.


Top
 Profile  
 
 Post subject: Re: Thomson MO5
PostPosted: Sat May 21, 2011 12:32 pm 
Offline

Joined: Sun Mar 20, 2011 6:55 pm
Posts: 131
No luck...
Put a strap on pins 10 and 11 of the floppy connector. Emulator now always answers (accessible as drives 01 and 23), but still error 10. I'm quite sure it's a problem with the MO5 wanting to go to track 0 and back to 255 before continuing to read...

Would it be possible to keep track of seeking while in LBA mode ? I think the sectors are always sent with track id = 255. Maybe having the track ID change when the computer sends seeks would be enough (possibly also with track 0 signalling).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group