How to use a Raspberry PI as an Amiga Floppy Drive Emulator

After several years of hard work, my Amiga floppy drive stopped working leaving me in trouble... do I have to buy a new drive (but several disks are in bad condition too), buy  a floppy emulator (nice but expensive for retro fun) ... or try to use my Raspberry PI other than as xbmc player?




Dislaimer
Whatever you do with the information in these pages or on the linked pages, I am not responsible for any damage you have for using this information. The information herein is provided AS-IS and there is no warranty whatsoever!



This is a very simple and finally very cheap (5-10 eur) project: a very common chip (74LS06), a couple of resistors and diodes, a protoboard. This interface doesn't require any change to the Amiga, you have only to remove the internal floppy and put the interface and the Raspberry PI in place. 






You can put the RPI so you can change/update the SD card without open the Amiga, as you see in the pictures.. 





The blue led on interface can be easily seen through the case holes without touching the case. As you can see, the interface needs 2 buttons I located in place of the remove disk button: the black one is the "change disk button", when pressed the next virtual floppy disk is inserted in virtual drive, and the red one is to "write to SD button", when pressed it saves all the modified disks on SD. If you push both the buttons, the interface goes in setup mode where you can choose the disk you would like to use.


In the following video you can see how it works.



  • at power up the setup program will start automatically
  • choice all the disks you would like to use 
  • start playing games; if you want to use another disk, push the "change button"
  • when you want to play another game just press both the button and reset the amiga, the system will go in the setup mode

Each drive has a stack of disks chosen during setup. When the "change button" is pressed the next disk in each stack is inserted in virtual drive. As example, if I do this in setup:

drive 0:

  • Monkey Island Disk1
  • Monkey Island Disk3
drive 1:

  • Monkey Island Disk2
  • Monkey Island Disk Savegame
after reboot Amiga will have "Monkey Island Disk1" inserted in drive 0 and "Monkey Island Disk2" inserted in drive 1. When the games asks for disk 3 or savegame disk I press the "change button" and the Raspberry PI will insert "Monkey Island Disk3" in drive 0 and "Monkey Island Disk Savegame" in drive 1. When the game asks again for disk 1 or disk 2 I only need to press again the "change button". To use is simpler than to explain...

Because the Amiga internal floppy drive connector has only 2 select line, it is not possible to have more than 2 virtual drives without modifying the Amiga, so you can only use the first and the second drive during setup (the others two will be useful with the external version of the interface).


The interface

The schematic:


     Partlist

     IC1                  74LS06
     C1                   10uF
     C2                   100nF
     C3                   220pf
     D1-D5/D7             SB140 (*6)
     D6                   1N4148
     R8/R14/R16/R26/R27   4k7 (*5)
     R15                  10k
     R1-R7                1k (*7)
     R9-R13/R17/R18       2k7 (*7)
     R19-R25              6k8 (*7)
     R28                  330
     LED1                 3mm 2.7V 2ma
     S1                   switch
     JP1                  Amiga Floppy Power   1X4
     JP2                  Amiga Internal Drive 2X17
     JP3                  Raspberry PI         2X13


Basically, for the input lines there are pull-up resistors and voltage dividers to adapt the 5V to the 3V3 of the Raspberry PI. The SEL1 line pass through a switch so we can disable the second drive, needed if you want to attach external drives (for ripping a real floppy disk into adf file in SD).
The outputs go through the 74LS06 containing 6 inverter with open-collector outputs, needed to correctly manage the disk bus. The RDY line is managed directly by the interface and it used to help protecting the bus when there are external drives disabling the CHNG line and the DKRD line (the other lines are managed by software).
The Raspberry PI is powered from the floppy power connection which it is enough for the model A. I tried model B, which require more power, without any problem, but I can't recommend because the maximum power requested in this case (700ma on certain conditions) is more than the power Amiga can provide through the connector (550ma). The interface require Raspberry PI v.2. 


These are the connectors on the Amiga we need to use, probably you would like to use the same cables used by internal floppy disk drives:



In the following image you can see the connectors of my Amiga 500 (rev.5!), I marked the pin 1 of the CN11 (it is the one near the yellow triangle) and the pin1 of the power connection (near the plastic line, 5V cable I have is brown). Be careful, the red cable (pin 4) is 12V and if you swap the cables red and brown (and there is no protection against that) you could damage Amiga and/or Raspberry PI and/or the interface.


Amiga Internal Floppy Connector and Floppy Power


These are the connections between Amiga and the interface:


Amiga RPI Drive Connections


As you can see, for the interface board I didn't made a specific PCB, indeed the circuit is finally so simple I preferred to use a protoboard. 


Amiga RPI Drive Interface

All the dirty work is made by the software.

The software

Here you can download the software. You have to unzip in a fat32 SD (like most of the Raspberry PI distro) and add yours adf or adz files. I recommend to use adz, they are much shorter and they will be loaded faster. The adz files are naturally "write protected", disk modified are saved always in adf files. To make adz files you just need to gzip the adf files with some free utility like 7-zip and change the extension to adz, or you could use powershell command: gzip filename.
That's all. The emulation is "complete" so Amiga will save the changes you made on the disks: the changes will stay only in memory until you press the "write to sd button". You can see the disks modified (which probably need to be saved on SD) during setup, they will have an asterisk before the name. Then if the disks are modified, they will be write back to sd making or overwriting the adf files, unless the files are marked as "read-only" on SD.
You can easily rip your disks just using an external drive and XCopy (I put inside the zip file) or you can do the opposite, you can create an Amiga floppy disk from an adf file, just remember to disable the second drive on interface before attaching external drive.



In the video you can see me ripping my old Workbench disk.


Interface details

This interface don't use Linux kernel, but is bare metal, so everything it is done from scratch starting without any O.S. support. All the code is in kernel.img in only 240kb, it holds also the Amiga setup software (and sounds and graphics). So it is only needed 7 second to power up the system and start the emulation. This choise was because the floppy disk interface needs real time response and Linux can't manage that without adding external hardware. Since this interface manages more than 1 drive (it can manage 4) and it is suppose the disk bus is shared eventually with external drives, several signals (as CHNG) need to be managed by software in real time (answers not after than 400 ns) and only a bare metal system, with optimized code, can manage that. You can find more info on timings here (example for Amiga floppy) and here (for generic PC floppy).
During SD operations like read or write an adf/adz disk image, the system can't manage the bus requests. In this case the full emulation is stopped and the system appears like without disks inserted (all the disks will be 'ejected'): in this way the hardware can  directly manage the requests without generate errors or blocks. In this way the RPI is free to do something else. After these operations the emulation will start again and all the disks will be re-inserted in drives.
In order to manage the DKRD line (disk read) and have a full stream of data with exact timing (2us per cell) sent without any interruptions,holes or delays, the software uses the SPI interface in continuous mode: all the MFM data goes through the SDO pin while other SPI pins are not used and they are configured and treated as standard GPIO. In order to have a better shape for the DKRD line, the signal should stay low for less than 2 us (400ns should be good) so the signal was 'reshaped' by the resistor R15, the capacitor C3 and the diode D6, improving the compatibility with the Amiga software (really only few games are sensible to this timing). For the data in input, the DKWD line, indeed it was not possible to use  SDI because without a clock or a PLL, errors will appear soon. The approach in this case was to take the times between the 0 cells (on the falling edge) and use these to obtain the data stream. So if between 2 zeros there are 4 us, the system recognizes a '10' sequence (the line is inverted), if there are 6 us the system recognizes a '100' sequence and if there are 8 us the system recognize '1000', as it's the MFM coding. To know more about MFM coding anyway and other useful stuff here there are lot of infos.

Requirements

It works with all Amiga versions. Minimum requirements are kickstart 1.2 and at least 512kb.
Amiga 1000 users, in order to let the system get the kickstart, have to put the kickstart file on SD and call it "kickstart12.adz". The Rasperry PI will load it automatically on system power up. 


The Amiga RPI Drive project, software and hardware, is totally free. So feel free to use these information for your own or to build and sell you own interface or just enjoy the work made by those Amiga fans.

In the comments you can probably find the FAQ...

I hope you enjoy again Amiga as I did!



Downloads

Software to put on SD   Amiga RPI Drive.zip or Mirror1
Schematic PDF   Amiga_RPI_Drive_Schematic.pdf
Schematic sch (Eagle)  Amiga_RPI_Drive.sch.zip
Stripboard or Veroboard (Eagle) Protoboard.zip
Stripboard or Veroboard (png) Protoboard.png


Feel free to use and distribute.

Feel free to leave comments/suggestions.

Special thanks for the FatFS module to http://elm-chan.org/fsw/ff/00index_e.html

 

117 commenti:

  1. I need fresh copies of KickStart 1.0 and WorkBench 1.0 to use my Amiga 1000. Contact @virtualCableTV on Twitter if you can help

    RispondiElimina
    Risposte
    1. Wow, kickstart 1.0 is almost a prototype... the minimum requirements for this software is kickstart 1.2 and at least 512kb.
      To use with Amiga 1000, you need to put the kickstart in the is and name it "kickstart12.adz". The system will recognize this file at startup and will load it before to start with disk choice.

      Elimina
  2. Hello there. Just wondering which model Raspberry PI is required to complete this project? Can I use a RP A with 256mb?
    Thanks for the great work you have done on this!

    RispondiElimina
  3. @JasonM You're welcome! The RP A with 256mb is the recommended version, so sure you can use it! :D

    RispondiElimina
  4. force_turbo=1 voids warranty afaik, so be warned.

    RispondiElimina
  5. See first comment (Eben's comment) on http://www.jeremymorgan.com/tutorials/raspberry-pi/how-to-overclock-raspberry-pi/

    RispondiElimina
  6. @Özay Turay This is what Raspberry PI org said about "force_turbo=1" http://www.raspberrypi.org/archives/2008 and also this http://elinux.org/RPiconfig. You will lose your warranty if you set that AND you do strong overclocking and overvolting. Since the frequency is set to 800 it is quiet the standard, but if you prefer you can slow down to 700, the system really don't feel so much the difference :D

    RispondiElimina
  7. @Özay Turay Here http://www.raspberrypi.org/phpBB3/viewtopic.php?p=176865#p176865 there is a nice "formula" for the warranty:
    What sets the warranty bit now, is:
    (force_turbo || current_limit_override || temp_limit>85) && over_voltage>0

    Cool ;)

    RispondiElimina
  8. @Özay Turay http://www.raspberrypi.org/phpBB3/viewtopic.php?p=176865#p177014 About warranty bit

    You may be okay. force_turbo doesn't set it on its own. Only in conjunction with over_voltage>0

    RispondiElimina
  9. Hi, cool project, thinking of building it myself, this seem to be done in eagle, would u release the .brd file ?

    Glenn

    RispondiElimina
    Risposte
    1. Update, In the downloads you can find the schemtic and what I used for my prototype...
      Hope it helps

      Elimina
  10. ciao da malta!
    hai intenzione di rilasciare il source code? grazie mille

    RispondiElimina
    Risposte
    1. Si, dovrò ripulirlo un po' e renderlo "presentabile"...

      Elimina
  11. Complimenti! Bella soluzione, magari si potrebbe anche usare hdmi con minidisplay per avere la possibilità di cambiare dischetti on the fly? Ho postato il link su a1k.org.

    RispondiElimina
    Risposte
    1. Sì, in effetti non sarebbe difficile, il problema maggiore sarebbe la scelta che con i due pulsanti sarebbe alquanto laboriosa... poi probabilmente si dovrebbe comunque effettuare un reset, non saprei...

      Elimina
    2. Certo sniffando la tastiera dell'Amiga... in effetti potrebbe essere un'opzione carina e tutto sommato a costo 0... ci penserò ;-)

      Elimina
    3. Magari con l´ opzione genlock si potrebbe anche scartare hdmi :D

      Elimina
    4. In effetti per il display avevo pensato a questo tipo http://www.ebay.it/itm/MONITOR-LCD-3-5-PER-AUTO-TELECAMERA-RETROMARCIA-DVD-/161189681448?pt=Monitor_Caricatori_ed_Accessori&hash=item2587a75928&_uhb=1
      È un monitor LCD da 15 euro (si trova anche su amazon a prezzi simili) collegabile ai 12 v del connettore floppy e all'uscita video del Raspberry PI. Un display tutto sommato economico e "di lusso" rispetto ai comuni display testuali che alla fine costano anche troppo... e che non richiede una gestione particolare e pins da parte del RPI... fermo restando che si può collegare comunque allo stesso video al quale è collegato l'Amiga, quindi all'ingresso video e/o hdmi ;-)

      Elimina
  12. Risposte
    1. Checked right now, it seems to work without problem (it is hoste by google sites...). Anyway I inserted a mirror link ;)

      Elimina
  13. Hi,

    Great Project! Just wondering if you can copy any disk (not just ADF format disks) to this by using xcopy or other amiga copying programs?

    RispondiElimina
    Risposte
    1. Really it use a lower level format called mfm (because is pre-mfm decoding) and it is used if the data don't match with adf format. So it does more that adf, which is another step, so it can copy like what in xcopy is called "nibblecopy" but honestly I haven't chance to try with some real protected disk. Best way? Just try ! !

      Elimina
  14. Non mi interesso di Amiga, peró ti faccio i miei complimenti per questa soluzione di gran classe! Bravo :)

    RispondiElimina
  15. It's really great!!! It could be usefull for a lot of computers.

    Had you think to program a version of your software for other computers like Amstrad CPC or Spectrum?

    If not, could be possible to access to the program sources?

    RispondiElimina
    Risposte
    1. Thank you. I made this project in my free time for my old Amiga and to learn more about Raspberry PI capabilities. I don't have those computers so I don't feel to adapt the work. It should be not so much work but I just really can't.
      I'm cleaning the source removing old debugging part and improving the code reading... I will realese under GPL and I will put on github in order to let people who want to make all the changes needed :-D

      Elimina
  16. Great!

    It was a pleasure to make a quick Protoboard for this. Look here:

    http://www.a1k.org/forum/showpost.php?p=681060&postcount=16

    DISCLAIMER: Not tested jet!

    Matthias

    RispondiElimina
    Risposte
    1. It's always good to share... another way (not tested yet!) is this service http://oshpark.com/shared_projects/L1KuUKNe
      I ordered (just for fun to give some friends), 3 boards 20$, but long time, I didn't yet received... In the States. Just to give more options

      Elimina
    2. Othe option is this http://imall.iteadstudio.com/open-pcb/pcb-prototyping.html?pcb_size=125 but again, in the States and I didn't test...

      Elimina
  17. Very nice idea. Because I own some other vintage computer, I have an other question, not Amiga related.
    It should be possible to use the device also with an older PC or a CP/M computer (which uses also Floppy Disk Drives)... do you have plans to make it more generic ?
    Anyway, thanks for sharing it !

    RispondiElimina
    Risposte
    1. This was designed for Amiga because I have it. To support other hardware it will require little changes which need at least to be tested with real equipment I don't have. So I think the best way will be release the code under GPL to let each one make his changes for different hardware.

      Elimina
  18. What clock divider do you use for SPI? Also what about the one clock gap between SPI bytes? Can you eliminate that by setting the control register or do you set clock fast enough it doesn't matter?

    RispondiElimina
    Risposte
    1. I put the divider 500

      SPI_REGS->CLK = 500

      so you have a throughput as 250Mhz/500 = 500kbit

      You have to keep the SPI buffer filled, you can't miss a bit!! Because of bit shifting architecture this will blow out all the track...

      Elimina
  19. Impressive project, simple but powerful. Good on you.

    My question is now : how did you get the content of the floppies onto the SD card? I know there are some (more or less complicated) solutions out there, but you obviously have a very good understanding of the workings of the floppy drive. Would it be possible to connect the floppy drive to the RPI and copy the disk contents to the SD card? The would be a fantastic add-on project making many people happy. But don't get me wrong, I understand this is done in your free time and I already appreciate what you have done.

    RispondiElimina
    Risposte
    1. You can get the content of floppies with the software X-Copy you find in the software package (see above the software section, there is a video too). These are in detail the steps you need to follow:

      1- disable the second drive on interface using dip-switch
      2- connect an external disk drive
      3- in the setup you put in first virtual drive X-copy and as much "Empty Disk" as you need, the original floppy in the external disk drive
      4- start the program and, when you are in X-Copy click the "change disk button", it will remove the X-Copy disk and put the "Empty Disk" in the first drive
      5- select "NAME" to see the name of the original disk. The Adf file we are going to make will have this name. if the name is "illegal" because no standard AmigaDOS disk, you have to quickformat the "Empty Disk" giving it the right name
      6- in copy select "DOSCOPY+", X-Copy will start copying the floppy content
      7- push "Write to SD" button so save all the work

      If you have a lot of disks to rip, I suggest to put the SD in a PC and make all the adf files named as you like (you just make an empty file copy it and rename it), so in start up program instead to choose "Empty Disk" you can choose the right one.

      Elimina
    2. Thank you very much for this detailed explanation. My problem is that I do not have an external drive (point 2). I was hoping to connect the internal drive and your drive emulator at the same time. Is that possible?
      Oliver

      Elimina
    3. You should temporary connect the interface to the external connector and use it as a virtual external drive. You have just to take the same signals you have in external connector. Remember to connect SEL0 line of interface to SEL1 line of the connector (pin 21) and SEL1 of interface to SEL2 line of interface (pin 9). Here is the link to external floppy drive connector:
      http://3.bp.blogspot.com/-dHS6sVp8nbg/Upf9L6I3ETI/AAAAAAAAB_Q/LStjJA2MnA0/s1600/Amiga-External-Diskdrive.gif

      Elimina
    4. If you were to support 4 SEL lines, which GPIO should I hook up to the extra ones? ;-) I'm envisioning a rotary switch to select addressing scheme, where internal drive can be any one of the four ones OR not in use, while the Pi handles the remainders. 2 pc 74HCT153 and a bunch of wiring would probably work, depending on timing.

      Elimina
    5. The pin for SEL2 is 23 and the pin for SEL3 is 24. The kernel is not exactly the same, here
      https://sites.google.com/site/amigarpidrive/home/kernel_4drv.zip?attredirects=0&d=1
      you can find the 4 drives kernel, if you don't use these "extra lines" you should put a pull-up resistor (20k) on them. I don't understand exactly what you are going to do, the software will manage these extra lines like the others so you don't need to put extra stuff other than what needed for these lines (like the others 3 resistors and 2 diode each) . Keep in mind while it is not common, it is legal to have more than one select line selected ;-)

      Elimina
  20. This is very nice as Amiga floppy drives are not too easy to find these days, but it looks like it only supports double-density disks? I hope you get the sources tidy enough for you to be happy releasing them as I'm really interested in low-level programming the RPi. Great project and very glad you've documented it for the benefit of the community!

    RispondiElimina
  21. hello, good job! I suppose it will also work as disk drive replacement for commodore 1581 drive?

    RispondiElimina
    Risposte
    1. Commodore 1581 has a totally different connector and signals and protocols (it seems to be very slow), which make this project not suitable for an easy replacement. Good news is that, because the requirements are very low, it's easy to have a similar approach with good results. See at http://www.insentricity.com/a.cl/208/C64PiVideo ;-)

      Elimina
  22. Hey Maurizio ! Very nice work !
    I wanted people to know about your project so I did an article about it on my website :)
    http://www.retrogamer.ca/retrogaming/modding/amiga-rpi-drive-quand-le-raspberry-pi-se-prends-pour-un-lecteur-de-disquettes/

    RispondiElimina
  23. Thank you!
    This is just "the start", Raspberry Pi has so much more to give... ;-)

    RispondiElimina
    Risposte
    1. I worked a lot to made it very easy to build, in order to share with a lot of people... common components you can find in the nearest electronic store and an hour to sold the component in a prototype board, a boy with a minimum electronic skill could do it just for fun... :-D

      Elimina
  24. Great project.

    Would it be hard to modify it for use with other vintage computers? (Atari ST for example?)

    RispondiElimina
    Risposte
    1. It really depends on the vintage computers, how are their floppy connector... Some are totally different (C64 for instance) and some are really close but not just the same (like PC). For Atari ST I see the connector it's very similar, same lines, so it should not require so much adapt the emulation software. The loader, where you choose the disks to put on, is instead totally different because it's amiga code, and it need to be written for each computer for their hardware and roms...

      Elimina
  25. hi in first of all you made an excellent work,but i see inconsistencies between the schematics and the protoboard.png
    For instance on the schematics there is no link between the 74ls06 pin 5 to pin 8.
    Also on the protoboard i see some connections that are inconsistent with the schematics pinout numbering to raspberry,what i mean is that they don´t match in some cases ,can you confirm this to me?

    Best regards

    RispondiElimina
    Risposte
    1. Hi Jose, the 74LS06 has 6 inverter (A-F) which can be swapped without affecting the functionality, So for instance, if you need, you can swap the gate D (pins 9-8) with the gate E (pins 11-10) while inputs still be inputs(9 and 11) and outputs still be outputs (8 and 10). This is what I've done implementing the schematic for routing optimization. If you want to put the component like I did, you could use the protoboard; if you wants to make your own solution, you can use the schematic and you can change the gates as you need. (for reference, this is the datasheet of 74LS06 http://pdf1.alldatasheet.com/datasheet-pdf/view/46205/SLS/74LS06.html )

      Elimina
  26. So if i connect from schematic,the pinout numbering to de Raspberry pi Double header correspondent will it still Work?

    Thank you once Again for the Reply

    RispondiElimina
  27. Ijust Don´t understand witch pins on raspberry are 3,3v ,+5v and Ground to connect between the circuit and the Pi if i had the raspberry pi schematics it was more easy :/

    Thank you once Again.

    RispondiElimina
    Risposte
    1. Here http://elinux.org/RPi_Low-level_peripherals you can find the raspberry pi pinout and some photos. 3,3 v is the pin 1, 5v are pins 2,4 (which you prefer) and Ground are pins 6,9,14,20,25 (again which you prefer),
      You're welcome!

      Elimina
  28. hello, can you put the pictures of downside of your protoboard, and a clean shot of rpi <-> protoboard connections?

    I'm having trouble following the schematic and want to check your connections visually. thank you!

    RispondiElimina
    Risposte
    1. Hi! The downside of protoboard exactly corresponds to the blue lines on the protoboard picture http://3.bp.blogspot.com/-tL30u5EUUL4/UpQymHO7lwI/AAAAAAAAB_A/UfmNPBzwa4s/s1600/Protoboard.png. In the comments above there is also a link to the rpi pinout, which can help in case of doubts, in the schematics you can find the pin numbers (on my protoboard I take 5V from pin 4 and GND from pin 9) just pay attention to understand which is the pin 1.

      Elimina
    2. hI! Thank you very much ,i can now finish my project pcb.

      Grazie Mille

      Elimina
  29. Wow, thank you very much for this great project. I built it my own (took 10 hours) and I am really exited. It works great.
    Thank you so much for investing your time and making it publicly available.

    RispondiElimina
  30. I would be interested in buying this interface. Is there anyone who can make one for sale?

    RispondiElimina
  31. hello,
    I tried to run the software on rpi (on different revisions, 1 x 256MB, 2 x 512MB version) but it hangs on Coloured splash screen (http://elinux.org/R-Pi_Troubleshooting#Coloured_splash_screen )

    I unpack all files in Amiga RPI Drive.zip file, put it on a fat32 SD card, but no joy.

    Raspbian working on very same SD card, so SD card works. I also tested 3 different sdcards.

    What I'm doing wrong?

    Thank you!

    RispondiElimina
    Risposte
    1. While the software is made to work on every release, the hardware of v1 is a little bit different from the hardware of v2, so this interface needs Raspberry PI v2 (it is the version sold from more than 1 year ago). Do you see the led on interface flashing? Anyway the video output of raspberry pi isn't used, so you will see every time a splash screen. You have to connect to amiga, it is the amiga who shows you the disk choice.

      Elimina
    2. Doh! I spent yesterday evening making this interface a couple of times on breadboard and only after reading this I noticed it requires Rev2 of Raspberry Pi and I have Rev1 bought at release. Damn. Could this software be made to work on Rev1 also? From the looks of it there should be need to do more than change few GPIO pins, 2 -> 0, 3 -> 1, 27 -> 21 am I correct? If you could release the source code or release a build for Rev1 also I would appreciate it :)

      Anyways, great project and thank you for releasing this, simple and most low cost way of adding DIY floppy emulator to Amiga 500. :)

      Elimina
    3. Hi, I uploaded the file kernel.img you need to replace on your SD in order to use Raspberry PI hardware v1.
      Here's the link:

      https://sites.google.com/site/amigarpidrive/home/kernel_%28RPI_V1%29.zip?attredirects=0&d=1

      Enjoy it!

      Elimina
  32. Hi, where is the souce code download link ?
    best regards.

    RispondiElimina
  33. Hello, i'm Renix from www.Retronia.cl

    Here is the Eagle PCB full routed...

    http://retronia.cl/foro/viewtopic.php?f=21&t=985&p=13538#p13538

    Regards,

    RispondiElimina
  34. Hello... Can I use a 74LS04 instead of 74LS06 ?

    RispondiElimina
    Risposte
    1. No, you can't. The disk driver bus needs open collector outputs and 74LS04 has driven outputs.

      Elimina
  35. This is really great. I am going to make the board to test it out with my pi.

    It is amazing how many uses there are for the pi.

    I have been planning to get a floppy emulator for my Amiga, but I like this DIY solution.

    Have you seen the version using a Pi to control a USB to universal Floppy Emulator?
    http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=58345

    There are two question I have about this solution.

    Would it be possible to adapt this to another computer beyond the Amiga? The Atari ST series would be my primary other interest.

    Also, would it still be possible to send files to the SD card by ethernet or wifi like is mentioned in the link above, or does the "bare metal" mean that there is no way to send by wifi or ethernet?

    RispondiElimina
    Risposte
    1. It's possible to adapt to other computers but it really depends on the computers, some use a similar disk drive signals (like pc or atari st) some are very different (like C64). As bare-metal by now it's not possible to have an easy access to ethernet or wifi while you (as the link above) could connect another raspberry pi, through I2C for instance, which can act as a network shield. You could do it but IMHO it seems something complex and finally useless, considering that in an SD you can easily put thousands floppy disks...

      Elimina
  36. Really good work on this, I copied how you instructed and built an interface, which after several weekends of soldering works (with a model B Pi on external power for the interface). I have found a few minor issue though:

    File name length - it seems that theres a limit to the filename length for the menu I wondered if you knew how long this might be?

    Reliability - I'm not sure if my Amiga is just a bit more flakey due to its age, or maybe if its drive timings but it seemed to crash a fair bit. I have been using ADF files (as most of what I downloaded is adf as standard)

    More disks/External Drive - I found that with games like Indiana Jones/Flight of the Amazon Queen/Monkey Island, the Games have 11 disks and you can only apply 4 disks per drive? You mentioned that when used internally you can only use 2 of the 4 drives is there a way round this? Do you have info on how to make the device external? I know with Kickstart rom 2 and above its possible to set the Amiga to boot from external drives first meaning you could have the device using all 4 drives. do you know if the external drive can have more power than the internal one?

    You have done a great job with this, now all we need to do is use the Pi to become an Amiga HardDrive unit :o)

    RispondiElimina
    Risposte
    1. For the menu the file name length it's not fixed because the font is proportional... so it really depends on the text, if text size is too long it will be crunched preserving the head and the tail (it usually contains the disk number). Anyway it should not be a limit in a normal usage (I mean if you don't put others info on the filename like year released, company etc.). So for instance a long game name like "Fiendish Freddy's Big Top 'O' Fun Disk 1' fits without problems.

      During the development I tested with more than 3500 games without issues. Do you have problem with some particular games/disk? While the most delicate components of the amiga (after the disk drive) are the cia chips who manage external peripherals (like joysticks, mouse, serial port,parallel port, and disk drive), if your floppy drives works good, the interface should do the same.

      With 2 disk drives you could have 8 disks per session. Usually (Monkey Island for instance) you shouldn't need 11 disks available on the same time, you could use first 7 disks and a save disk, when you go forward and you don't need anymore disk 2 because you finish level and before to arrive to disk 8, you could replace disk 2 for disk 8. But if you really want to have more disks, without having to change to much disks, the best solution is to add 2 other drives.
      In a comment above I linked the 4 drives software, the hardware it's almost the same, you need only to double select lines, for df2 and df3. The "problem" is that /SEL2 and /SEL3 are not available directly on the connector, so you have to take directly from the CIA chip. Other solution is to connect the interface to the external drive port (which unlikely doesn't have /SEL0), but you can't use long cord for reliability issues, I done that but using input buffers so I preferred internal version to make hardware simple and to save space.

      Using RPI as Amiga HardDrive will be great, but it seems to me very to realize using RPI :D :D



      Elimina
  37. Well I have modified my names so they arent so long now, I'll see it that cures that problem :o)

    Not sure on the games but what you do mention is the CIA chips, I dont know if it has a connection to just the internal drive or the external too, but the internal drive is the one which has become more of a problem and wasnt reading discs (hence building your great device!) I will have to get everything mounted up properly (bought a model A RPi to put in the Amiga permanently) and try again. I know that before building this interface Cannon Fodder was working pretty good so I think the Amiga might be ok.

    I didnt really think about the best way to use the 8 disk situation, Its been ages since I have played some of the games but I thought some required you to skip to discs ahead of the number sequence, but I certainly think your right! I'll have to do some experimenting :o)

    Thank you for your work!

    RispondiElimina
  38. I've found some timing issues with the ACA-500 if I use Kickstart 1.3 and the maprom feature turned on. (Either the original kickstart or the one provided by ACA-500). It seems like the disk is randomly removed and reinserted several times per second. This leads to "YOU MUST REPLACE VOLUME ... IN DRIVE DF0:" or "ERROR VALIDATING DISK" requesters. After pressing "RETRY" several times workbench screen appears. Drive LED is still going on and off.

    With the original 1.3 Rom and maprom turned off, everything works fine.
    With Kickstart 3.1 it works fine even if maprom enabled.
    On CD32 with SX Pro 68030@50MHz there are also no issues.

    I have 2 additional questions:

    1. Would it be possible to modify your software to be able to use it from Workbench to change disk images from Workbench / CLI?

    2. Do you think it would be possible to use a XMOS Startkit http://www.xmos.com/startkit/what to handle the realtime stuff while using the RPi with Linux?

    Maybe I can do some experiments myself when you release the source of your software.

    Thanks again and happy new year

    RispondiElimina
    Risposte
    1. Thanks for very interesting feedback! Unlikely I don't have (yet) an ACA-500 so I can't test directly but it seems that this specific configuration (ACA-500 kickstart1.3 and maprom) access to disk controller with a more strict timings than standard specification. The old software (kickstart v1.3) for some timings is code dependent and moving it to fastmem with maprom make it too fast and reduce all the code-dependent timings going out of the standard. The newest kickstart (3.1) use timers (CIA) and not the code to correctly manage the timings.

      About the questions:

      1. This could be a nice option, instead the loader where you choose the disks just do that but without requiring Workbench. So it is possible to add this feature but not easily with this version of software. I'm working on changing it without loose the compatibility in order to add some other feature (like keyboard sniffing and external display, so stay tuned! )

      2. I didn't know this board, it's very nice and very cheap but IMHO it seems very useful to manage real world stuff (fast and several ADC for external sensor, parallel threads...). So to interface RPI even in this case is useful but just not enough to have a "full" Linux on RPI. More feasible way should be connect Amiga RPI drive to another RPI with Linux, but finally is it really useful? Perhaps using other boards can helps (in my previous version I used a CPLD) but one important goal of this project, other than the cheapness, is the "easy and fast to build" feature, you don't need even to build a PCB, you can use a stripboard (or veroboard), very common components and a solder. So we could make a more sophisticated solution, but finally for a good useful purpose.

      Hope it answers.

      Happy New Year!!

      Elimina
  39. I had some PCB of your circuits fabed but it seem that you changed the design since then. I was wondering, was there anything wrong with the previous design? I am having some difficulty reading the part outline though as they seem to not be lined properly and are overlaping.I am scared that you might have changed the part numbering or value since then

    RispondiElimina
    Risposte
    1. The schematic never changed, just keep in mind the 74LS06 has 6 inverters and for routing optimization you can change pins connected without changing the functionality. So for instance you can change pin 11 with pin 3 changing pin 10 with pin 4 (if you change the input of inverter you have to change the output too). So if you use a stripboard you can change the inverter to optimize the route (as I did in protoboard.zip), while with a pcb 2 layer you can change inverters in order to have a smaller (cheaper) board. No part number or values changes.

      Elimina
  40. Interface runs ok, but if i want to start a Program it welcomes me with a Software Failure.
    Think it's an error in my Interface, but where should I start to look for the error?
    I can't find it.

    RispondiElimina
    Risposte
    1. I understood you can choose a disk but when the system reboot it gives you a Guru Meditation error. Is it correct? Which Guru Meditation error code it shows? The setup program where you choose a game is itself a program like another adf, if you are able to choice a game the interface is really "close" to work. If you are NOT using an Amiga 1000, you could try to rename your game in adz format using the name "kickstart12.adz" so the loader will load it without going in setup program, just to check if the reading lines are really ok as it seems. I think the problem are in the writing lines DSKWDB DSKWEB, when you choose a disk these are the lines used to communicate the choice to the interface. You should check about short circuit on these lines and clean all the spaces around these tracks. They are simple input lines, so you should power your interface disconnected to Amiga and Raspberry PI and check the voltage at these lines on Raspberry PI side (DK_WDB_IN DKWEB_IN) changing the others input lines on Amiga side (SEL0 SEL1 DIR STP TK0 DKWEB DKWDB).
      Let me know if it works.

      Elimina
  41. yes it's correct. Guru Meditation 00000004.00C01570
    renaming xcopy to kickstart12.adz works. xcopy starts :)
    voltage on DKWDB=0V and DKWEB=3,3V

    RispondiElimina
    Risposte
    1. Good. When the interface is disconnected from Amiga and from Raspberry PI and it is powered by 5V, the voltages on input lines should be 3,3V. It seems DKWDB as problem on pull-up resistors (R5 1K R13 2K7) or check there is no short circuit to ground.

      Elimina
  42. Hi,

    the layout of this Project is allmost finished:

    http://www.a1k.org/forum/showpost.php?p=695118&postcount=63

    It fits nicely as a floppy. There will be a possibility to obtain this PCB in this Forum too.

    btw: I think you have a Little flaw in your design: The Buttons are pulled up to 5v. RPI does not like 5v on the GPIO Pins. I fixed it by using the 3,3v from the RPI itself for pulling the Buttons up.

    Additionally I have one feature request:

    Could you introduce two Folders, e.g. DF0 and DF1 on the SD and modify your code that adf/adz files put in these folders are automatically mounted on startup? That would be great!

    Best regards Matthias

    RispondiElimina
    Risposte
    1. Very nice work!
      Actually the 4,7k resistors and the rpi's internal clamping diodes guarantee a drop voltage so the RPI is always safe. But taking 3,3v from Raspberry PI is it ok too and better in some way.
      I like your PCB is big enough so you can fix it directly using the old drive screws.
      Have you considered to put also a connector for the extra 2 lines (SEL2 and SEL3) as someone did (see comments above). The interface was born to handle 4 drives but when I released I included only the lines SEL0 SEL1 inside the floppy connector (for newbies) reserving the optional 2 drives for more expert people. The kernel handling thie extralines is available here:

      https://sites.google.com/site/amigarpidrive/home/kernel_4drv.zip?attredirects=0&d=1

      (it just enables SEL and SEL3)

      These 2 extra lines need to be taken with a cable directly from CIA pins, this is the most difficult operation. On the board these lines need to be treated as SEL0/SEL1 lines, so 1k resistors to vcc, 2,7k to pins 23 (SEL2) and 24, 6,8k resistors to ground, 2 diodes to ground(like D3/D4) and 2 diodes like D5/D7. Having 4 drives is really awesome!

      I don't understand what do you mean "mounted on startup", do youy mean without the choice of disks, like kickstart12.adz? Or do you mean putting game disks on these? I remember when you choose a disk, to load the selected disks you can use the key RETURN, to add the selected disk to the same drive, keypad ENTER, to add the selected disk
      into the following drive and F1/F2/F3/F4 to add the select disk directly to DF0/DF1/DF2/DF3. This way seems IMHO the simplest and the more flexible, managing differents configuration like when you use workbench and other software, or if you don't want to load all the disks (monkey island 2)...

      Let me know

      Elimina
  43. My idea was to put two folders in the root directory of the SD card. adfs placed there are automatically assigned to the drives to avoid the start screen. I use a hard disk and your start menu is time consuming for many adfs.

    Matthias

    RispondiElimina
    Risposte
    1. How could you change the disks without start screen? You should change anytime the files in the SD removing it and using another pc...

      Elimina
    2. It should be like a preconfig:

      Is there a folder df0/1/2/3x? yes: Assign all adfs in alphabetical order from that folder to to df0/1/2/3 and start up
      Is there no folder - >Startscreen

      This way you can avoid the start screen and boot right through, even from a HDD ;)

      btw: you could use the last IO-Pin for simulating HD-drives with 1,76MB-adfs!

      Best regards Matthias

      Elimina
    3. Both interesting options. Preconfig will be in the next release.
      For HD seems no to be a problem but I have to do some more checks. Is it avaialable from kickstart 3.1 right?

      Elimina
  44. Is it possible to build a similar interface for the external floppy drive?

    RispondiElimina
    Risposte
    1. Actually the same interface could be used as external just connecti to external floppy drive using the same lines. Here is the pinout of external floppy connector:

      http://3.bp.blogspot.com/-dHS6sVp8nbg/Upf9L6I3ETI/AAAAAAAAB_Q/LStjJA2MnA0/s1600/Amiga-External-Diskdrive.gif

      Keep in mind the external connector has the lines SEL2 and SEL3, so it will be useful to use 4 drives emulation software (get the kernel on the comments above). The external connector doesn't have SEL0 lines, so if you want to emulate internal drive too, you have to disconnect it and connect by a cable SEL0 from the internal connector.

      Elimina
  45. thanx maurizioram !
    R5 was not good soldered so that 1 pin was not connected.
    Now it works perfect. Thanx for your great work and your help performance.

    RispondiElimina
    Risposte
    1. Very good!! You're welcome and enjoy Amiga!!

      Elimina
  46. My attempt here:
    https://www.youtube.com/watch?v=BVYVZ3fsesk

    RispondiElimina
  47. Excellent work. By the way, the two links to timing information (Amiga and PC) point to the same document. One of them must be wrong. Could you fix it, please?

    RispondiElimina
    Risposte
    1. I corrected it. Consider that timings are almost the same, due to shugart connector. With few hardware changes on floppy connector you can use a PC floppy drive (non HD) for Amiga (and viceversa).

      Elimina
  48. Hi Maurizio. Very nice work, me and my colleague are currently trying to build your amiga rpi drive.
    At the moment we have kind of an unstable behavior and are running out of ideas on where to check for errors.

    We have tested with 2 separate Pis and 2 SD cards on an Amiga 500 with Kickstart 2.0

    Behavior:
    -------------
    - We have seen the ADF-selection screen twice so far and put a game in drive 0. The loading screen appeared, but would not go away. For the last couple of tries, not even the selection screen is showing anymore.
    - When starting, the LED on the interface sometimes blinks, sometimes it remains dark. Also the activity LED on the Pi itself seems to have a different blinking pattern every time we start.

    Insecurities about the schema
    -------------------------------------------
    - We have skipped the switch so SEL1 is always connected, since we don't have an external drive. Should that be working?
    - For power on Pi side we need to connect the 2 5V and the 5 GND pins, correct?

    Measurements
    ---------------------
    - No signal on RDY, DKRD and TRK0
    - Signal on SEL0 and SEL1
    - Spike on INDEX
    are those correct?

    Thanks a lot and best regards
    Peter

    RispondiElimina
    Risposte
    1. - The initial blanking leds are ok, it means the rpi is reading the SD (the patterns should be the same every time, few seconds of flashing depending on how many adf disks you have)
      - skipping SEL1 is ok
      - only one 5V line and one GND line are needed, but more it is even better
      - spikes on INDEX are ok, there should be 200ms between 2 spikes
      - RDY line should follow SEL0 or SEL1 line (SEL0 =0V -> RDY=0V)

      These are checks recommended (read also the comments above similar cases):
      - first if you can, connect the old floppy and see if everything is good (the CIA chips on the Amiga)
      - with interface disconnected and powered from 5V line check the input lines (SEL0,SEL1,STEP,DIR,SIDE), you should check 5V on the floppy connector side and 3.3V on the RPI side. if you pull down (connecting to GND) an input line on the floppy side, you should see only the related line on the RPI going to 0V

      So interface disconnected and powered:
      SEL0_IN, SEL1_IN, DIR_IN,STEP_IN,SIDE_IN check = 3,3V

      connect lines to ground:
      SEL0 = 0V --> SEL0_IN check = 0V (others unchanged)
      SEL1 = 0V --> SEL1_IN check = 0V (others unchanged)
      DIR = 0V --> DIR_IN check = 0V (others unchanged)
      STEP = 0V --> STEP_IN check = 0V (others unchanged)
      SIDE = 0V --> SIDE_IN check = 0V (others unchanged)

      - with interface disconnected and powered from 5V line check the ouput lines (RDY,DKRD,TRK0,INDEX,CHNG). Because these seem to be affected in your interface you should check R8 and R14 (4,7Kohm resistor pull up to 5V) and the diodes D5, D7, D1, D2 (their direction). To test the ouput lines is a little bit difficult: you should pull up these lines (1kohm to 5V on floppy connector side) and power the related lines on RPI with 3.3V, keeping SEL0 on floppy connector connected to GND. For each line you should check RPI 3.3V -> floppy line 0V, RPI line 0V -> floppy line to 5V. When you leave SEL0 free you should see 5V on floppy connector line and 3.3 on RPI side and you should see 5V on the RDY line, when SEL0 is connected to ground you should see 0V on the SEL0 line on the RPI side and 0V on the RDY line.

      Hope it helps.

      Elimina
  49. Thanks for the quick response! Hope to be able to try it out in the next couple of days.

    RispondiElimina
    Risposte
    1. Unfortunately trying the floppy failed as well. I believe the two times we saw the disk-selection screen was the Amiga's last breath :o(

      Elimina
    2. I suspected some short circuit broke the CIA chip ((99% sure), this old technology is very delicate. But don't worry, your Amiga is still alive! First of all, Amiga has 2 CIA chips even and odd, try to swap them. Floppy connector (mainly) is connected to the even one and parallel port to the odd, if you swap them you should see everything working. If you need parallel port you can buy a new CIA at vesalia.de for less than 7 eur. After all double check the interface for short circuit, very important check the input lines (they are also easy to check).

      And good luck!

      Elimina
    3. Yes, we had realized the two CIA chips were the same, so we have already swapped them for a test, but the floppy still would not work. It acts like no disk is inserted (continuous little back and forth movement of the reading head). So we cannot be sure whether the 2 chips are damaged or if the floppy is broken and we have a mistake in the interface. The only thing that does work is the external hard-disk, do this make use of the chips?

      Anyway, thanks for your answers!

      Elimina
    4. No, external hard disk doesn't use the CIA signals (but perhaps some software will use CIA timers...). The movement of drive's head is good, it means SEL0,DIR,SIDE,STEP are on CIA-even so it should be ok. RDY,TK0,CHNG are on CIA-odd so considering you swapped CIAs, the broken CIA is now on the CIA-odd place (if the Amiga can't see CHNG it thinks there is no disk)... (pinout is here http://www.amiga-stuff.com/hardware/8520.html)

      Elimina
  50. Hi Maurizio!

    Congratulations and thank you for your good work! Do you already know when you plan to make the sources public?

    Best regards,
    Sven

    RispondiElimina
    Risposte
    1. You're welcome!
      Sources will be released when it will be realeased the version 2.0 which is with an optional external display, a knob and a new "core". The hardware anyway will be almost the same.

      Elimina
    2. Sounds great! I'm really looking forward to it!

      Elimina
    3. As a suggestion, If you are interested in programming raspberry pi for this project you could start using the interface to connect it to raspberry pi using linux. While emulate more than one drive is not so easy, emulate only one drive with this interface is quiet simple, you need to know about SPI programming and GPIO usage, which are used in this project too. Unfortunately I dedicate my (free) time to this project and I can't program this alternative approach but I know some people will appreciate it!

      Elimina
  51. Just Wanted to say Thank you for this incredible interface. Looking forward to 2.0 version of software !

    RispondiElimina
  52. Hi. Not sure if it is ok to submit incompatible software or not. Just to let you know almost EVERYTHING runs perfectly. I only found 2 demos so far that have problems: Jesus on E's keeps "Loading" all the time and never starts. Hardwired runs perfect up to the bouncing balls on triangle part, where it stops with music still playing. Both run fine from floppies.

    RispondiElimina
    Risposte
    1. Sure it is ok! And it is really usefull! While I tested a lot (more than 4000) of disks a didn't test (and I don't have) all the disks available. I know the demos are "difficult beasts" because sometimes they are made just to work on standard drives without respect too much timings and specifications.. Anyway the aim is to be as real as possible, so I will check to know and eventually to fix it. Thank you!

      Elimina
  53. This is totally awesome! I hope I'll someday have the time to try this with my old Amiga 500.
    Nice work!

    RispondiElimina
  54. Hi this is amazing work. I'm wondering if it could be adapted to be a universal floppy drive replacement for all the old computers of that era? I have an Apple 2 that would be nice to be able to fire up from SD card

    RispondiElimina
  55. It has enough power to do that... and usually computer older than Amiga have simpler interface. Perhaps RPI can connecto to AppleII using the same inteface, changing only the software. In case I need to check some prototype, could I call you?

    RispondiElimina
  56. Hi, I was wondering about your choice of using SPI for the output, was that how you started? Was there any issue of using a 2us interrupt instead?
    Thanks

    RispondiElimina
    Risposte
    1. I tried the 2us interrupt, but too much delays and not constant latency. So I preferred to use spi, precise clock and almost no cpu load. And the data was easier to be sent by spi.

      Elimina
  57. Hey! Nice project!
    Works nicely with my Raspberry Pi Model A+, which I hid under my Amiga 500's keyboard. This way I can access the SD card through the trapdoor and don't have anything sticking out of the disk slot.

    Are you still planning to release the source code? I'd like to have a look at it (and maybe add something useful if I find time to do it)!

    RispondiElimina
  58. I think you should be fine with the power consumption with a Model B but the best would be an A+
    See here for the power consumption of the A, B, B+ and A+ - http://raspi.tv/2014/raspberry-pi-a-how-much-power-does-it-need

    Do you know if the A+ will work?

    RispondiElimina
    Risposte
    1. It works fine with my A+

      Elimina
  59. Michele Silvestri3 dicembre 2014 17:00

    Hi Maurizio, great project! Thanks for sharing it.
    I lost a lot of time to make it work, because I was using a 7406 instead of a 74LS06.
    Now, with ls model all work perfectly.

    RispondiElimina