uSD Versus USB-Stick

272 views
Skip to first unread message

MartinR

unread,
Dec 29, 2023, 10:40:01 AM12/29/23
to RC2014-Z80
Just out of curiosity I decided to compare the speed of the SD card interface and Alan Cox's CH37x USB interface on my SC126. The SC126 was booted into CP/M 2.2 using the Dev40 version of RomWBW.

[Caveat] My experiment was not particularly rigorous in its methodology.....

The uSD card is a Kingston 64GByte 'Canvas Select Plus' (USB2.0), and the USB-stick is a SanDisk Cruzer Blade 16GB USB Flash Drive. These are what I had to hand. I ought to confirm the access times for those devices, but I suspect that it won't be the limiting factor.

Each transfer was of a 323,387byte file from the SC126 RAM disk to a freshly CLRDIR'ed drive on either the uSD card or the USB-stick. 

Using my phone as a stopwatch (I said it wasn't rigorous!), I recorded times of 12.9sec for the uSD card and 9.0sec for the USB-stick.

I wasn't expecting that! Not entirely sure why, but I did expect that the uSD interface would be the faster. On this basis, the USB-stick is about 40% faster.

Noting that RomWBW supports two USB interfaces, I might be tempted to modify Alan's design to create a dual USB module and drop the uSD card. I note that someone else on this forum maybe designing the same at some point. USB-sticks are far more convenient for transferring files to/from a  21st century machine - and, seemingly faster also.

Can anyone spot any pitfalls with what I'm suggesting doing to gain a little extra speed?


MartinR


Wayne Warthen

unread,
Dec 29, 2023, 11:58:38 AM12/29/23
to RC2014-Z80

I don't see any pitfalls with what you are suggesting

On Friday, December 29, 2023 at 7:40:01 AM UTC-8 MartinR wrote:
I wasn't expecting that! Not entirely sure why, but I did expect that the uSD interface would be the faster. On this basis, the USB-stick is about 40% faster.

    There are a few variables here, but the USB interface does benefit from the ability to use INIR/OTIR to transfer a block of bytes in one shot.  Perhaps that is the primary reason it is faster.

Noting that RomWBW supports two USB interfaces, I might be tempted to modify Alan's design to create a dual USB module and drop the uSD card. I note that someone else on this forum maybe designing the same at some point. USB-sticks are far more convenient for transferring files to/from a  21st century machine - and, seemingly faster also.

Or just use two of Alan's cards at different addresses.

Can anyone spot any pitfalls with what I'm suggesting doing to gain a little extra speed?

Nope.  Although, in practice, I'm not sure you will really feel the difference.  Your test is writing a single large file.  This minimizes the CP/M overhead of blocking/deblocking.  It also avoids repeated directory scans and updates.  The convenience of a USB stick cannot be denied and would be ideal for using RomWBW's hybrid disk layout containing both CP/M slices and FAT filesystem.

Thanks,

Wayne 

Alan Cox

unread,
Dec 29, 2023, 12:19:16 PM12/29/23
to rc201...@googlegroups.com
On Fri, 29 Dec 2023 at 15:40, MartinR <marti...@gmail.com> wrote:
>
> Just out of curiosity I decided to compare the speed of the SD card interface and Alan Cox's CH37x USB interface on my SC126. The SC126 was booted into CP/M 2.2 using the Dev40 version of RomWBW.
>
> [Caveat] My experiment was not particularly rigorous in its methodology.....
>
> The uSD card is a Kingston 64GByte 'Canvas Select Plus' (USB2.0), and the USB-stick is a SanDisk Cruzer Blade 16GB USB Flash Drive. These are what I had to hand. I ought to confirm the access times for those devices, but I suspect that it won't be the limiting factor.
>
> Each transfer was of a 323,387byte file from the SC126 RAM disk to a freshly CLRDIR'ed drive on either the uSD card or the USB-stick.
>
> Using my phone as a stopwatch (I said it wasn't rigorous!), I recorded times of 12.9sec for the uSD card and 9.0sec for the USB-stick.
>
> I wasn't expecting that! Not entirely sure why, but I did expect that the uSD interface would be the faster. On this basis, the USB-stick is about 40% faster.

It's not that the USB interface is fast, it's that the Z180 CSIO being
used for SPI to the SD card is pretty slow. It runs at a fraction of
the bus clock and does bitwide transfers. Adding a CF adapter or using
a dedicated fast SPI card will be faster than the USB.

MartinR

unread,
Dec 29, 2023, 12:55:04 PM12/29/23
to RC2014-Z80
Hi Alan - 

Thank-you for your insights. Much appreciated - and for helping my understanding. I can understand driving that the Z180 CSIO that way would be slower, but an interesting comparison anyway. I did say that my experiments weren't very vigorous.... and I was playing with the kit that I have available.

I've been really pleased with your PCB - any chance of a dual-version? The lurid purple of my board is down to my own stupidity of letting my daughter choose the colour....... The rest of my SC126 'stuff' is blue. Purple or otherwise -  it works great - thank-you for your design!

MartinR

unread,
Dec 29, 2023, 1:13:19 PM12/29/23
to RC2014-Z80
Hiya Wayne - 

Thank-you for your your reply. 

Yes - not a "real-world" experiment, but I found it interesting... And - yes, agreed - INIR/OTIR can be used efficiently (done it myself decades ago) which will help.

Two boards could be an answer, though my current board is thicker than the 10mm allowed on the SC126 bus connectors. Not good for two boards stacked up. I have spare unpopulated PCBs to play with.... In the long term, I'd rather save a slot and ensure that my modules could be in adjacent slots

And - yes - damned convenient!!

All the best - 

MartinR

Alan Cox

unread,
Dec 29, 2023, 1:50:53 PM12/29/23
to rc201...@googlegroups.com
On Fri, 29 Dec 2023 at 17:55, MartinR <marti...@gmail.com> wrote:
>
> Hi Alan -
>
> Thank-you for your insights. Much appreciated - and for helping my understanding. I can understand driving that the Z180 CSIO that way would be slower, but an interesting comparison anyway. I did say that my experiments weren't very vigorous.... and I was playing with the kit that I have available.
>
> I've been really pleased with your PCB - any chance of a dual-version?

I won't be making one but others may. It's also in theory possible to
drive a hub and multiple devices but that needs a *lot* more software
adding to ROMWBW which is also not on my list.

Alan

Phillip Stevens

unread,
Jan 7, 2024, 8:10:25 PM1/7/24
to RC2014-Z80
Perhaps it would be worth trying the official RC2014 CF Module v2.0, together with a  CF to SD adapter?
You get the benefit of direct on-bus I/O, together with a "coprocessor" in the adapter which does all the the SD Card (SPI) protocol support.
I've found that solution to be about the fastest storage solution available (not that it makes much difference really).

Cheers, Phillip

Jeff Ratliff

unread,
Jan 8, 2024, 3:58:57 PM1/8/24
to RC2014-Z80
I think it was a great experiment. It failed to support your hypothesis, so you had a to learn a bunch of stuff to figure out why.

And the resulting discussion brought a lot of good information together.  It also illustrates that speed is a good goal, but there are always other factors, like ease of use and media availability.
Reply all
Reply to author
Forward
0 new messages