Welcome, Guest. Please login or register.

Author Topic: Floppy emulator  (Read 60969 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Floppy emulator
« on: December 07, 2005, 10:15:38 AM »
Hi,

My name is Tim. I'm a newbie in Amigas (got my first A500 only this summer).

I was so excited to see recent Minimig story that I decided to post my own project details. Although not as mindblowing as Minimig (Dennis, your work is by far the most impressive DIY Amiga story I've heard!), it is probably still fancy enough to mention.

The project's aim was to build a device that would eliminate the floppy nightmare I would've had should I decide to try and see all 600 megs of ADF on my old A500. The device would keep ADF images on some flash media, let me choose and load certain image, mount it and pretend it is real floppy drive.

I've used 8-bit RISC Atmel MCU running at 8MHz, an old 4M 30-pin SIMM for DRAM storage, LCD salvaged from an old Nokia mobile, and a couple of buttons to keep interface minimalistic.

So far the project lets me browse the SD/MMC card (cheating a lot - FAT16 only, no LFNs, no subfolders), load .ADF image, convert it to MFM tracks and run it as if it were a real DF1: drive attached to my Amiga.

While loading floppy image takes decent amount of time, about 30 seconds, converting it to MFM takes good three minutes. There are of course ways to reduce conversion time, like using more powerful MCU or preencoding floppy images, still to be investigated.

I have uploaded a few images should anybody want a look :-)

EDIT: images are available here: http://www.amiga.org/gallery/index.php?u=3561

Regards
Tim
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #1 on: December 07, 2005, 11:12:10 AM »
Quote

xeron wrote:
Thats cool. I have an A500 with a broken floppy drive, and this would make a nifty replacement. Will the final version be able to replace DF0?


That's what I am heading for - to fit it into A500 (must really make my mind before ripping it) so that I would have three or four hundred floppies always with me in a size of a single MMC card.

In fact, it should already behave as DF0 or just any of DF1..DF3 if using right select signal from floppy bus (and on external floppy connector only DS1 and DS2 are available).
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #2 on: December 07, 2005, 11:20:04 AM »
Quote

motorollin wrote:
Wow, that sounds like a great project! Using FAT is not bad thing, it means the card can be put in a PC for easy transfer of files. I assume the device connects to a standard Amiga floppy connector? And how fast is access to the disk images? And would it be possible to allow access to the files on the flash card like a hard drive as well as mounting it as a virtual floppy, for transferring files that are not in an ADF?

--
moto


Yes, the device connects to external floppy connector, although it is not seen well on the photos. I have a bunch of early development photos, too, showing the connections, running boot intro etc.

As to the speed, I can't tell. I only know there are no moving parts in it, so it should be slightly faster then real drive, if only Amiga can make use if it. I recall running speed test from DiskMonTools, and that gave me something like 24k per second on 64k file. I am not sure about them figures, will rerun test this night.

I don't think it is possible to access certain files on the card directly - at least I don't see how it can be done through the floppy interface. On the other hand, reading SD/MMC is not that difficult, there can be other solutions for it like using RS-232 port, and there probably are.


UPDATE. Speed test shows 24k/sec for 128k file. Puzzingly enough, the Workbench 1.2 floppy loads in 44 seconds, and the emulated one loads in 55 seconds.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #3 on: December 07, 2005, 11:26:14 AM »
Quote

bloodline wrote:
How many images can be mounted at a time?


Now it only allows for one image to be used at a time. There is simply not enough memory to hold more than one. Although it would be terrific to have a set of floppies be prepared in advance, like for multi-disk games, and switch between them at once.

Also it is a read-only solution, floppies can be read from but not written to.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #4 on: December 07, 2005, 11:35:02 AM »
Quote

Dingo_aus wrote:
Sounds cool.

What AVR are you running? I'd guess a low power Mega128 but would be really happy if you said something like a Mega32 (something that comes in PDIP)


I happened to have ATmega161, a 40-pin DIP chip suitable for most simple projects. First I ran it at 4MHz, than had to go for 8MHz.

I am planning to upgrade to ATmega128 (if they are still in production by the time), mostly because I am running out of IO pins. 16MHz will hopefully speed things a little (say, 20 seconds of loading instead of 30), bit it is the conversion part that is the most heavy one in terms of CPU power. I will look into pre-encoding .ADF into some .MFM format in advance.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #5 on: December 07, 2005, 11:45:56 AM »
Quote

patrik wrote:
@tnt23:

How fast mcu do you estimate would be needed to convert tracks from the adfs to mfm data on the fly?


/Patrik


Quite a bit I'm afraid. You have to deal with ~12k of data, with bit shifting, masking and checksumming, all within 0.2sec or so.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #6 on: December 07, 2005, 11:48:22 AM »
@humppa

Thanks, will look into MMC64 project. I've heard of a similar thing for the VIC-20 I believe, maybe that is it.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #7 on: December 07, 2005, 12:00:44 PM »
@motorollin

Really can't tell. I have completed the most tricky part only last weekend - dealing with FAT clusters - and there are for sure lots of bugs and assumtions to be fixed and approved. I am planning to design a decent PCB for the prototype, too.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Current status
« Reply #8 on: December 29, 2005, 07:17:08 AM »
Subdirectories support is almost complete, browsing the directory tree back and forth surprisingly works.

I have completed PCB design for the new prototype, and ordered a couple of boards. The design features MCU with 4K of static RAM and plenty of I/O pins, and also a 8Mx8 EDO DRAM chip. With that much of static RAM I should be able to speed up the MFM coding phase drastically.

Have a happy New Year everybody!
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Current status
« Reply #9 on: December 29, 2005, 02:00:46 PM »
@X-ray:

I use DF1 since it is available on external floppy connector, but I don't see why it cannot be DF2 or even DF3 :) It is a matter of soldering to the right pin.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Current status
« Reply #10 on: December 29, 2005, 06:21:34 PM »
Quote

PaSha wrote:

The DF1: pin on "small" Amigas (A500, A600 & A1200) is the same as the DF2: pin on "Big-Box" Amigas. So no worries.


BTW, can big Amigas be booted from floppy other than DF0?
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Current status
« Reply #11 on: December 29, 2005, 06:24:34 PM »
Quote

motorollin wrote:
I LOVE your avatar :-)

--
moto


I wonder if it can be done in 84x48, mono :-)
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #12 on: December 29, 2005, 07:16:45 PM »
Quote

MskoDestny wrote:
Quote

tnt23 wrote:
Quote

patrik wrote:
@tnt23:

How fast mcu do you estimate would be needed to convert tracks from the adfs to mfm data on the fly?


/Patrik


Quite a bit I'm afraid. You have to deal with ~12k of data, with bit shifting, masking and checksumming, all within 0.2sec or so.

Only if you did the work an entire track at a time before you started streaming the data. If you did it all a byte at a time while you were sending the data the processor requirements would be a lot lower (of course getting the timing right would be a major pain).


Unfortunately, you ought to have some data to be streamed in advance (right before you start to stream it), and it is impossible to know exactly which track will be requested the next second.

I must confess I don't quite get your point here.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #13 on: December 29, 2005, 08:44:05 PM »
@Zac67:

You're right, MFM itself is no big deal. My early setup managed to generate MFM flow on the fly completely in software, and that was running mere 4MHz. The tight loop was pretty tight; and it could not generate sync marks on the fly since they specially violate MFM standard.

I had to throw an idea away when it came to Amiga sector encoding scheme. All these odd and even bits splits, shifts and CRC calculations require a lot of CPU work.

In fact, I use table approach as the last step in building the MFM track.
 

Offline tnt23Topic starter

  • Full Member
  • ***
  • Join Date: Dec 2005
  • Posts: 195
    • Show all replies
Re: Floppy emulator
« Reply #14 on: December 30, 2005, 06:52:25 AM »
Quote

Dr_Righteous wrote:
Definately needs to work as DF0: replacement as well. Perhaps as a second, simplified design (sans the LCD screen) it would be easy to fit in the floppy bay of big box miggys. It really only needs a slot for the card and two buttons for scrolling though the ADFs... You'll know what disk it loads by what shows up on WB.


Given a floppy mounts in 100 seconds, now that would be a torture :-) The LCD I use is 39mm x 36mm and seems to fit in 5 1/2 inch drive bay well.