CPCWiki forum

General Category => Other retro => Topic started by: Gryzor on 16:27, 26 November 13

Title: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 16:27, 26 November 13
Really cool:


AMIGA RPI DRIVE (http://amigadrive.blogspot.it)


(cue discussion about whether it's possible to do for the CPC...)
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: TFM on 16:59, 26 November 13
If the Amiga can do it, then it's no problem for the CPC. One of my drives is still an Amiga drive.[nb]I'm just too lazy to change it, else I would use an other drive with more quick step rate.[/nb]
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: ralferoo on 00:37, 27 November 13
Quote from: TFM on 16:59, 26 November 13
I'm just too lazy to change it, else I would use an other drive with more quick step rate.
What? The step rate is determine by how fast you pulse the signal (within reason). Swapping another drive won't change that, it's the setting in the DPB that'll determine that. On the 765, the step rate is determined by the top nibble of the 1st byte in the specify command. It's almost certainly stored in the DPB somewhere too.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: ralferoo on 01:12, 27 November 13
It a shame he only supplies a prebuilt RPI image, but still sounds like an interesting project.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: TFM on 02:23, 27 November 13
Quote from: ralferoo on 00:37, 27 November 13
What? The step rate is determine by how fast you pulse the signal (within reason). Swapping another drive won't change that, it's the setting in the DPB that'll determine that. On the 765, the step rate is determined by the top nibble of the 1st byte in the specify command. It's almost certainly stored in the DPB somewhere too.


Well, sorry for being unclear. (English is my 2. language). What I mean is the following: Every drive has a minimum of step rate time. For 3" drives this is 12 ms. In some cases 10 ms.
The usual 3.5" can work with a 4 ms step rate time.
The 765 can adjust the step rate time in even numbers: 2, 4, 6, 8, 10, 12, 14 and so on. Of course you do need an DOS / OS supporting to change the step rate. I remember you can change that in Amsdos / ParaDOS / X-DDOS / V-DOS and so on. For sure you can set a default for CP/M and FutureOS. I don't know for SymbOS or Contiki though.



Quote from: ralferoo on 01:12, 27 November 13It a shame he only supplies a prebuilt RPI image, but still sounds like an interesting project.


Right, especially if one already owns an RPi.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: jrodriguezv on 20:48, 27 November 13
I've heard autor is debugging code for releasing sources. It can be a good start for porting it to CPC.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 19:22, 28 November 13
If it's so simple as he says it is, it'd be a fantastic, very cheap alternative to the HxC. As long as someone writes the CPC software...
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Jeff_HxC2001 on 08:56, 29 November 13
 Cheap ? Are really sure that this solution is a lot more cheaper than the Ready-to-use Slim HxC Floppy Emulator ?!?
Add all costs and we will see ;) (http://www.lotharek.pl/product.php?pid=91 (http://www.lotharek.pl/product.php?pid=91))
What is incredible is that the HxC Floppy Emulator was open since years but almost no one talk about the open part...

Anyway the HxC Floppy Emulator softwares are already working on Raspberry Pi :


USB HxC and RaspberryPi TCP/IP Network Floppy Emulator : control and upload through a web browser (http://www.youtube.com/watch?v=wJEekEhZtD8#) (the video demo)


http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=58345 (http://www.raspberrypi.org/phpBB3/viewtopic.php?f=41&t=58345)

http://torlus.com/floppy/forum/viewtopic.php?f=1&t=1120 (http://torlus.com/floppy/forum/viewtopic.php?f=1&t=1120)
This is the old USB HxC Floppy Emulator working with the Raspberry PI (Rev B) under linux.
In the present demo the file images (ADF,ST,MSA,IPF, DSK...) are uploaded to the Raspberry PI throught the Ethernet port.
Since all is working under Linux (Unlike the above solution...) the same can be done through a wifi interface, or an simple USB key, or what you want.

All sources are availables since years there :
HxC Floppy Drive Emulator / Code / [r1041] /HxCFloppyEmulator (http://sourceforge.net/p/hxcfloppyemu/code/HEAD/tree/HxCFloppyEmulator/)
All the software and libraries are working under Linux (and Raspberry Pi), Mac OS X, Windows...

Here is the file images loaders currently present in the library:
HxC Floppy Drive Emulator / Code / [r1041] (http://sourceforge.net/p/hxcfloppyemu/code/HEAD/tree/HxCFloppyEmulator/libhxcfe/trunk/sources/loaders/)

Please note that there is no conversion to do for the user: all is done "on the fly"...

To build your own USB HxC all is there :
http://sourceforge.net/p/hxcfloppyemu/code/HEAD/tree/HxCFloppyEmulator/USB_HxCFloppyEmulator/USB_HxCFloppyEmulator_PCB/ (http://sourceforge.net/p/hxcfloppyemu/code/HEAD/tree/HxCFloppyEmulator/USB_HxCFloppyEmulator/USB_HxCFloppyEmulator_PCB/)

So yes, i am actually working on the next generation HxC. All the software is already there.
Just need to finish the new hardware part to replace the old USB version. It will be probably very cheap to build but i want it decent enough to be able to use Linux and its network possibilities.. (and emulating the protected disk images like IPF... ;) ) ...
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 18:43, 30 November 13
Well, regarding price, the HxC Slim (which is veeeery sexy indeed!) is €60. A Pi can be had for €20 maybe, and the guy says the extra board costs €5-10 to make, so it's half the price.


Regarding functionality[nb]it's not clear to me how the project I linked to works in terms of controlling the Pi, I would guess with an Amiga program and not externally??[/nb], while the video is very cool as a tech demo, it's not really convenient. I'd go for the classic way any day of the week...


Can we prise some details for the HxC2 out of you? :)
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: redbox on 18:59, 30 November 13
An extension of this would be to have a serial connection from the CPC to the Pi as well (in the 2nd USB slot) much like demonstrated recently using Viewdata.

Then you could use Honeyterm (or any CPC comms program) to log into the Pi and download DSK images etc - no need for the Web interface on another PC and basically you would have a "standalone" CPC connected to internet with every single DSK image at your fingertips.

If you could shoe-horn a Pi, HxC USB, MegaFlash and MiniBooster into a normal CPC you'd have the most uber setup ever.  8)
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 19:03, 30 November 13
That's a fantastic idea, although I'd prefer a customised terminal program that would do things more easily rather than typing in commands. But, great idea indeed!


Why would you then need both a Pi and an HxC?
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: redbox on 19:07, 30 November 13
Quote from: Gryzor on 19:03, 30 November 13
Why would you then need both a Pi and an HxC?

Well I just said that because I liked the example Jeff linked to above.

Of course if you could get the Pi working as a floppy emulator on it's own as well (like with the Amiga) you'd have more space in the CPC ;)
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 19:10, 30 November 13
Ah, I see, and agree :D The extra connectivity would indeed make this a superb mod.


Let's hope when this guy opens the project up someone in here can translate it to the CPC...
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: reallynew on 09:45, 12 January 14
Sorry Jeff it will break your business... I make it for mi Amiga and it works pretty well! 6,35 Euro (+23 euro raspberry pi I use also for other stuff) and totally of 3 hours of work...
We hope you improve your product, considering external hd (aca-500) costs like an HxC I don't see any market for that...
I hope I will able to use for my CPC too ! ! It will be really awesome!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 11:14, 12 January 14
Hello ReallyNew, why don't you register and describe your process? I'm sure lots of people would be interested!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: robcfg on 13:06, 13 January 14
It's half the price if you only consider materials.


Now, a professional finish, the time saved soldering and testing, etc... is worth the other 30€.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 13:57, 13 January 14
Quote from: Jeff_HxC2001 on 08:56, 29 November 13
What is incredible is that the HxC Floppy Emulator was open since years but almost no one talk about the open part...

I may not have spoken about it, but I was certainly very happy and appreciative that it was open source. As well as the 7 or 8 HxCs I've bought from Lotharek, I've also built 2 or 3 (very early versions) of them for myself :)

Bryce.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: ralferoo on 14:02, 13 January 14
Only the USB version of the HxC floppy emulator is open source. The SD version seems to be completely closed, only the PC program to create images has source code available.

Or at least, if the source for the SD is available, I've not been able to find it anywhere despite looking (and asking) several times...

Of course, it's totally understandable. If the source was available, there'd be numerous knock off versions of the HxC floating around.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 14:15, 13 January 14
I definitely have schematics for the SD version that I built back then (Schematic date is 2008 Rev. A). Can't remember where I got the files from though? Here's a picture of what they looked like back then...
I built at least 2 of these. The source code wasn't supplied, only a pre-compiled HEX file.

There was an even earlier version that overlayed text onto the CRT and although I planned to make one of them too, I never got around to it :(

Bryce.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: gerald on 15:52, 13 January 14
As far as I remember, early revision of SD version schematic was available like the USB version. It become 'closed' when some clones appeared on ebay.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 16:47, 13 January 14
Mine didn't go on ebay. They got disassembled after I bought my first real ones from Lotharek.

Bryce.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: gerald on 17:08, 13 January 14
Quote from: Bryce on 14:15, 13 January 14
There was an even earlier version that overlayed text onto the CRT and although I planned to make one of them too, I never got around to it :(
http://atariamiga.free.fr/sdiskemul.php (http://atariamiga.free.fr/sdiskemul.php) ?
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 19:39, 13 January 14
Overlay text onto the CRT? How...????
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 20:30, 13 January 14
Quote from: Gryzor on 19:39, 13 January 14
Overlay text onto the CRT? How... ??? ?

That's easy. Strip the sync signal (with an LM1881 or similar) and use it to trigger a routine that pulses a single output pin of the PIC to switch one of the colour channels as required. With a bit more trickery you could even manage full colour overlays.

This is how those old VHS subtitle editors used to work.

@gerald: Yup, that's the one.

Bryce.

Edit: Found a picture of what the overlay looked like:
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: ralferoo on 21:29, 13 January 14
Sorry, yes I meant the firmware for the SD version. I did manage to find an older version of the schematic for the SD card, but I never managed to find the source code for the firmware.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 21:57, 13 January 14
I never went looking for the source. I only wanted to build myself one, so the HEX dump was all I needed.

Bryce.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 15:53, 14 January 14
I built an SDiskEmul last year but haven't had much luck getting it to work yet. I got a good oscilloscope and logic analyser recently so that should help :)


I actually think it's superior to the HxC, as it's completely seamless - you plug the joystick into it, then from it into the CPC, and the video comes out of the CPC to it, then to the monitor. It has a button, which when pressed brings up a menu as an overlay on the monitor, and you can select a new disk image with the joystick, once selected the joystick acts as normal again. Also, it supports dsk images so you don't have to convert anything.


The only problem is it doesn't support writing to dsk images.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 13:24, 26 January 14
I had another go with my SDiskEmul last week. Still haven't got it working, but the oscilloscope helped me figure out that the LM1881 wasn't producing the sync signals correctly. The reason turned out to be too much parasitic capacitance (damn strip board)... I shortened as many traces as I could, which still didn't work but was better (signals weren't quite right but almost), then removed the IC socket on the LM1881 and it now works correctly.


Next was debugging the SPI connection to the SD card. I got the logic analyser out and hooked it up, and could see valid SPI packets going between the two. Had a break for a while (and left it turned on), and when I came back the PIC now doesn't seem to be producing any valid packets at all. No clue what's up with it, I've tried a few things, the LM1881 is still going ok (I think the PIC software is interrupt driven based on the hsync so needs this), so I'll have to come back to it another time. Hopefully nothing died because I left it turned on (can't imagine why it would though).


It even displayed part of the screen overlay at one point, so I think I'm almost there.


I'd like to make a nice small PCB layout for it if/when I can get it working.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 20:11, 26 January 14
Please don't give up :)
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 13:06, 30 January 14
Think I may have cracked it. Looks like I've been using the wrong PIC micro.


The thing is on the website it says to use PIC18Fxxxx, so I didn't know what to use - I looked at the pictures and could read 18f452<unreadable last digit> so I went for an 18f4520, mostly because I can get them easily. I disassembled the hex file yesterday, then tried to reassemble it for the 18f4520, and I got a lot of errors about invalid RAM addresses. Reassembled for the 18f4525 (which is the same but with more RAM) and it worked!


So it looks like it was working as far as getting a directory listing from the card (I checked the SPI packets yesterday), and then crashing. I've ordered a new micro, though I may be able to rewrite the code to fit on the 18f4520 I'm not so hot on pic18 assembly and its RAM banking, so a new PIC is the easiest route. Fingers crossed for when it arrives...
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 00:55, 05 February 14
Well, I got the new PIC today, changed it over, and for a few minutes thought it was working. The overlay works, I can select a disk image from the SD, but when I run cat on the CPC I get a garbled directory listing. I'm out of ideas for now, but will have another look when I can. So close!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 16:30, 05 February 14
It lives! I was missing a pull up resistor, now it's working fully! W00P! :D


Will post some pics later.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: jrodriguezv on 16:58, 05 February 14
Great news!! Congratulations!!!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 19:35, 05 February 14
Ohhh yeah, definitely pics please!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 00:21, 06 February 14
Well, I've got pics, but also some bad news :( . Pics first.


Here's the SDiskEmul itself. On the left are the joystick, video and power connectors. On the right are SD card and floppy drive connectors.

(http://s7.postimg.org/uf6qsi8pz/IMAG0099.jpg) (http://postimg.org/image/uf6qsi8pz/)

Just to show it's really plugged in to a CPC:


(http://s27.postimg.org/6a68wuxrj/IMAG0101.jpg) (http://postimg.org/image/6a68wuxrj/)

The image selection menu:

(http://s22.postimg.org/zaa7omb6l/IMAG0102.jpg) (http://postimg.org/image/zaa7omb6l/)

After you choose an image you have to tell it whether to be A or B drive (not sure if this actually does anything):

(http://s22.postimg.org/9vborux3x/IMAG0103.jpg) (http://postimg.org/image/9vborux3x/)

Running cat:

(http://s30.postimg.org/bkqsbc5fx/IMAG0104.jpg) (http://postimg.org/image/bkqsbc5fx/)

And finally, we hit a problem:

(http://s14.postimg.org/uhcz2lail/IMAG0105.jpg) (http://postimg.org/image/uhcz2lail/)

So, something's up and I'm stumped. It sometimes works and sometimes doesn't. It generally says it can't find a file, and then cat just shows an empty disk, but type cat again and it shows the files just as it should. I didn't check it properly this morning, just loaded up the intro to prince of persia and that's it (I can actually get to watch the full intro, but pressing a key after that causes it to freeze). Similar stuff with every image I've tried.

I've checked the circuit and I'm pretty sure it's fine. I've tried with two different cables and two different CPCs, but I don't have any other cables (and both occasionally give me problems with my 3.5" drive). So I think it's either the cable or just limitations of strip/vero board?

Anyone got any clues? Bryce to the rescue!?
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Gryzor on 20:09, 06 February 14
Oh my, this is sweet! I hope you get there :) The OSD is super-cool.


Just take a deep breath, grab a beer or six, get some sleep, I'm sure you'll find the solution.


Awesomeness!
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Token on 14:57, 10 February 14
That and this OSD is indeed instant wowcool.  8)

Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Bryce on 15:51, 10 February 14
Hi Munchausen,
      looking at the your PCB / setup, the cables between the VeroBoard and the SDCard PCB are way longer than recommended and could cause the effects you're having. Shorten these to the minimum and it might resolve your problem.

Bryce.
Title: Re: Use a Raspberry Pi as an HxC drive!
Post by: Munchausen on 16:05, 10 February 14
Thanks Bryce, I'll give this a try :D


I shortened all the traces I could elsewhere, but didn't think of the SD card cables...
Powered by SMFPacks Menu Editor Mod