CPCWiki forum

General Category => Amstrad CPC hardware => Topic started by: zhulien on 20:50, 03 April 23

Title: USB Host Controller with Mass Storage Support
Post by: zhulien on 20:50, 03 April 23
We have USB stick support on CPC usually via some type of microcontroller.  I am guessing that Microcontroller is likely the best way to make a USB Host Controller for CPC with floppy, CDROM and perhaps Hard Drive support?  For me, I'd like floppy support - mainly as it might provide an alternative to reading floppies given I have removed my 3" drive to have a USB drive.  Also USB floppy drives are dirt cheap - not to mention CDROM drives too.  

Or would a cut down USB stack be worthwhile on CPC instead and handle it all in software?  What are the likely pitfalls of a software solution?  (no interrupt mechanism or missing packets?)...  I can see a hardware solution can offer DMA via mapped ROMs for reading at least - like an M4 does.

https://www.usb.org/sites/default/files/usbmass-ufi10.pdf
Title: Re: USB Host Controller with Mass Storage Support
Post by: GUNHED on 14:05, 04 April 23
Another solution? Another software? Another long development time for it?

USB? What's bad about using SF3, USIfAC II or ULIfAC?

Or take the Albireo, it has an USB port, you can program it. :)


Form the programmers POV it's just nasty to have a bunch of different hardware solutions an no standard. Do we want to cook all our own soup? Or wouldn't it be better to work together and have some kind(s) of standart(s)?
Title: Re: USB Host Controller with Mass Storage Support
Post by: eto on 14:25, 04 April 23
Such a solution will appear if someone sees the need for it. Usually a personal need. 

I can just talk for myself, but I don't see a purpose for a USB-floppy adapter or a CD-ROM.

Modern USB floppy drives only support 1.44MB floppies, so you either use disk images or have to support 1.44Mb directly. In the end it's as compatible as any mass storage solution but much less flexible and much more expensive than a SD card or USB drive. 

For CD-ROM it's even less useful. You don't even get the nostalgic feelings from the drive sound. Sure, you will be able to put almost 4000 disk images on a single CD ROM, which sounds great. But they will be read-only.

In both cases a 8GB USB stick is more versatile, costs around 4€ and you probably can put all ever released software onto it. 
Title: Re: USB Host Controller with Mass Storage Support
Post by: Prodatron on 14:34, 04 April 23
We already have the CH376 USB controller in the Albireo and the Usifac2.

The CH376 can handle any USB device afaik, at least HIDs and mass storage, including USB floppies and CD Roms. You just need to write drivers. For CD Roms you have to implement an ISO-9660 file system driver, too (or try to port this one from the MSX).
Title: Re: USB Host Controller with Mass Storage Support
Post by: zhulien on 15:15, 04 April 23
I agree that CDROM is pretty much useless unless you want to control an audio CD from the CPC - but for storage, not much use at all.

I didn't know Usifac2 had that inbult, great news.  What documentation do I need to read?
Title: Re: USB Host Controller with Mass Storage Support
Post by: Prodatron on 17:30, 04 April 23
Here is a CH376 data sheet. Starting from page 5 you will find the commands:

https://www.mpja.com/download/ch376ds1.pdf
Title: Re: USB Host Controller with Mass Storage Support
Post by: GUNHED on 16:05, 05 April 23
Quote from: zhulien on 15:15, 04 April 23I agree that CDROM is pretty much useless unless you want to control an audio CD from the CPC - but for storage, not much use at all.
Instead of an audio CD you can use SD cards with the MP3 player of the LambdaSpeak FS / III too.  :) You got the LS3 iIrc. Needs less space in addition.
Title: Re: USB Host Controller with Mass Storage Support
Post by: zhulien on 17:17, 11 April 23
Quote from: GUNHED on 16:05, 05 April 23
Quote from: zhulien on 15:15, 04 April 23I agree that CDROM is pretty much useless unless you want to control an audio CD from the CPC - but for storage, not much use at all.
Instead of an audio CD you can use SD cards with the MP3 player of the LambdaSpeak FS / III too.  :) You got the LS3 iIrc. Needs less space in addition.

yes, it was me who suggested to put that on the LambdaSpeak - which I have too. Sounds fantastic!
Title: Re: USB Host Controller with Mass Storage Support
Post by: GUNHED on 17:25, 11 April 23
Well done then  ;) :)
Title: Re: USB Host Controller with Mass Storage Support
Post by: Prodatron on 21:54, 11 April 23
In this case, the CPC is just acting like a stupid remote control. It doesn't load the data stream from a mass storage device and it doesn't send it to an output device.
It just tells someone, please play this file from your SD (or whatever) card.
TBH yes, playing MP3s already requires additional hardware for the decoding, but just using the CPC as a primitive remote control doesn't have the Z80 spirit for me anymore.
Title: Re: USB Host Controller with Mass Storage Support
Post by: GUNHED on 17:16, 12 April 23
" In this case, the CPC (snip) doesn't load the data stream from a mass storage device and it doesn't send it to an output device. "

Yes! And that's absolutely great!!!  :) :) :)

Every sound card (Moon Sound) or graphics card (VDP9990) is external hardware. As you told MP3 playing requires extra hardware too.
It is just logic to relieve the CPU from additional load and let the expansions do the hard work. Therefore we have them.
There is absolutely no need to send everything through the bottleneck of the Z80.

It's the same in PC world, no need to stay inefficient with the CPC, just because it's no 8086 PC? That makes imo no sense.

And yes, for some strange reasons there will be always persons only working with a CPC464 with nothing extra.

So, everybody shall be lucky in a personal way.  :) :) :)
Title: Re: USB Host Controller with Mass Storage Support
Post by: eto on 21:54, 12 April 23
Quote from: GUNHED on 17:16, 12 April 23Every sound card (Moon Sound) or graphics card (VDP9990) is external hardware.

For me, the questions is simple: Is the CPC extended by the device or is the device extended by the CPC? What's the core part of the set-up?

E.g. once you connect a Raspberry to the CPC to run DOOM, but DOOM runs entirely on the Raspberry and only I/O is passed through the CPC, this does no longer make any sense to me. It's just doing it for the sake of doing it. And if you pass through the graphics, the experience even gets worse than without the CPC as an I/O device. Something like this was done lately with a C64. It's not the C64 that is extended by the Raspberry, the Raspberry was extended by the C64, which is doing just the I/O for the Raspberry. 

On the other hand, there are extensions like the VDP9990, where the extension brings new capabilities, but the CPC is still an important part of the overall experience - and not just I/O. Games logic, sound, controls, graphics - all done by the CPC - but the graphics are more powerful thanks to the VDP.

A LambdaSpeak for replaying MP3 from an SDcard (to me) looks much closer to the Raspberry example than to the VDP example. It's not the CPC that is extended to do something, the LambdaSpeak is extended by the CPC to send over commands - and it doesn't really matter if the CPC is part of the set-up.



Title: Re: USB Host Controller with Mass Storage Support
Post by: GUNHED on 22:44, 12 April 23
Of course nobody wants to reduce the CPC to a pure keyboard, just like the c64 with supercpu.

And I see no difference between regulating the volume, number of track, etc. or to regulate what screen is shown with a gfx card.

Regarding MP3: The way of doing it is always the same, doesn't matter if it's a SF3, LS3, or MSX soundcare (connected by an Amsdap).

Imho it's pointless to shuffle everything through the cpu just for the sake of it.

However, we should get back to USB controllers now...
Powered by SMFPacks Menu Editor Mod