News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Zetr0

Mass Storage (8/16 bit IDE) for CPC464/6128 Project

Started by Zetr0, 22:15, 04 September 12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zetr0

Hello there my fellow CPC'ers

I have decided that I want to make this project official so I can share its development with you all as well as get some help in resources and ideas.

This will be my only project for the CPC this year, and would be awesome if it can be realized before Christmas, so any help - pointers would be awesome - besides its not fair that I keep bugging Bryce all the time ;)

I have been a C / C++ developer for over 20 years on various systems and know quite a few other high-level languages.  I am currently re-teaching myself Z80 ASM through the use of PASMO and z88dk.  This open project is quite simple in that to develop an IDE adapter for the Z80 bus. 

As a premise I looking to adapt the 8bit and 16bit Z80 bus IDE adapters that the Spectrum uses and its about time that we CPC users had this as well.


(here is one I made earlier ;))

The above adapter can be configure like this



A0,A1 and A2 IDE Configuration

Using Z80 - A8   (pin 38) - IDE A0
Using Z80 - A12 (pin 2)   - IDE A1
Using Z80 - A13 (pin 3)   - IDE A2

Also it can be configured to use  different Z80 addresses for A0, A1 and A2 of the IDE

Using Z80 - A3 (pin 32) - IDE A0
Using Z80 - A6 (pin 36) - IDE A1
Using Z80 - A7 (pin 37) - IDE A2


The hardware is quite simple indeed, and consists mainly of passive components


40pin Z80 ZIF Socket (for CPU)

40pin ZIF Header
(For connectivity to the motherboard CPU Socket)

40-pin IDE connector
(to connect up to two IDE Hard Disk Devices)

74HC10 IC
Handle /M1 , IORQ (for R/W), A4 and CS0 / CS1

Initialize IDE Reset


       
  • BC327 transistor
  • 100K resistor
NMI De-bouncing

       
  • 33pf Capacitor
  • 1MOhm Resistor
The work behind it all is in fact the ROM routines, by far the most experience I have had with them is from the +3e environment hence I will be focusing on this area for adaptation.  Also an interesting fact is the +3 DOS ROM is by Cliff Lawson, it is essentially a rewrite of the Amstrad PCW DOS which implements a CP/M compatible disksystem.

In ROM2 from the Spectrum +3e then we have +3DOS with IDEDOS, the IDEDOS part was written by Garry Lancaster and is designed to hook into the simple 8-bit IDE interface designed by Pera Putnik. which a hardware adaptation I have linked here.


Programmers resource Here



So any help in resources, current projects and just ideas would be most welcome.

Thanks for reading.
If I had a hammer.....

TotO

Hello !

Thank you for your interest about the CPC. An IDE adapter will be great today. :)

I got some questions:
- Is, using 8bit on the 16bit databus will allow to work properly with all kind of units ?
- Or, is it possible to buffer 2x8bit before sending 16bit ?
- Because today it's really common to add 2.5" CF adapter or Disk-On-Module directly to the auto-powered 44-pins connector and save space inside the computer (no more ribbon cable and power supply hack), should you change the 40-pins for it ?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Bryce

According to your schematic above, the HDD (CS0) is selected when:

A4=1 OR /IORQ=1 OR  /M1=0 Correct?

I think his would cause hardware/firmware chaos on the CPC (and although I know very little about the Spectrums expansion specs) I can't understand how this would work on the Spectrum either.

Can you explain what addresses and signal states are required to read and write to the HDD.

Thanks,
Bryce.

Zetr0

Hello TotO

lets see if I can answer those questions.

1. Is Using 8bits on the 16bit data-bus allow for the proper working of all kind of units.
QuoteShort answer = No.

Long Answer = Kinda

Using only 8bits on the Data Bus rules out ATAPI Devices (as these are 16bit) i.e. ZIP drives / LS120's and Optical Drives.  However you can use Hard-disk devices, like CF cards and even SD cards via an IDE adapter - the only drawback is that you only get to access half of the capacity of the disk device - thus a 512MB Disk would yield 256MB of Data Store on the 8bit Device.

256MB is massive for these little 8bit Micro's, I have over 100 games (including 128k games) in a little under 5MB! so its a bit of a trade off - the adapter is simpler and cheaper to build, but there is a loss in capacity.  Now, there are some other things to consider - with Compact Flash as a medium, these devices can be placed into 8bit Memory Mode - so you get ALL the capacity of the card - its very easy to do, and when I re-design the Spectrum adapter it will have a CF port already wired as such.

Another thing is, as there is no byte handling - 8bit data is FAST (well fast for a 3.5Mhz Zilog) with speeds of 145KB a second, sadly with the byte cache and swapping of the 16bit interface its around half that speed (80KB per second)


2. Is it possible to buffer 2x8bit words before sending 16bits to the device
QuoteYes, it most certainly is, here is my 16bit IDE adaptation of a very clever fellow (Pera Putnik) *see his website projects here*



Please forgive the crudeness of it, Its based on two 2x HC573's to collect / hold the Lower 8bits For (or from) the IDE Bus, and 1 HCT254 to pick up the upper 8bits (from the CPU or the IDE Bus).  the GAL20VB handles the full IDE addressing and R/W status from the CPU outpit.

In my adaptation IC3 and IC4 are HC573's with IC2 a HCT245.  IC1 is the GAL20VB and IC5 is a HC32 which handles the call to reset the IDE device.  you may of noticed that I give the chips names, this is so I don't get lost when I have written this on paper ;)

Again, I have to state that Pera Putnik is an amazingly clever fellow and his project site is a wealth of inspiration!

Now, while this grants the full use of capacity, it also allows for some ATAPI devices like LS120 / 240 disk drives, IDE based ZIP drives (100MB/250MB),  it would also allow for a CDROM with a correctly partitioned CD (it wouldn't be ISO standard lol)

However its drawback is speed,  due to the CPU Driving this adapter, it has to shift the bytes about, and this slows down access time to about 80KB a second that I have discovered with my tests.

i.e. a 128K Snapshot (space crusade 128)

8bit IDE Adapter - Load time 4.3 Seconds
16bit IDE Adapter - Load time 8.4 Seconds

Same file and same storage medium (64MB IOMega CF Card) just different devices.  There is also a program called IDESPEED that also proves this point a little more eloquently as well =)

3. it's really common to add 2.5" CF adapter or Disk-On-Module directly to the auto-powered 44-pins connector and save space inside the computer
QuoteYes, this is a very good point and there are other advantages to using CF cards as they are low-power and can take their power from the CPU socket - save having to make a wire loom for powering the device.

If I had a hammer.....

Zetr0

Quote from: Bryce on 11:02, 05 September 12
According to your schematic above, the HDD (CS0) is selected when:

A4=1 OR /IORQ=1 OR  /M1=0 Correct?

I think his would cause hardware/firmware chaos on the CPC (and although I know very little about the Spectrums expansion specs) I can't understand how this would work on the Spectrum either.

Can you explain what addresses and signal states are required to read and write to the HDD.

Thanks,
Bryce.


thanks for looking =)

lets just bring these bits up

74LS/HC10 (triple 3-input NAND Gate)


and




With this hook up CS0 is selected (high) when A4, /M1 and /IORQ are not selected, CS1 is always high however CS0 takes precedence on the device chain.  When CS0 output logic drops the second device (on CS1) will respond....

to do this A4, /M1 and /IORQ would need to be asserted.

Thats how I understand it (lets hope its not totally fundamentally wrong lol!) its a dirty way of doing it but it does work.
If I had a hammer.....

Zetr0

- looks like I forgot the third NAND gate - sorry about that.

with A4, /M1 and /IORQ not selected this output would be HIGH, as a consequence the output of the third gate would be LOW and CS0 not selected.

Thus to assert CS0 (high) - A4, /M1 and /IORQ would require to be asserted.... hmmmmmm
If I had a hammer.....

Bryce

Well it being a NAND gate, if any of the three inputs (inverted A4, inverted /IORQ or /M1) isn't = 1 then the output of the last NAND gate (going to CS0) is going to go high and enable the drive. So it's A4=1 OR /IORQ=1 OR  /M1=0

Bryce.

Zetr0

LOL I am having a slow day today!

I was saying to myself.... draw a truth table Keith.... don't rely on notepad.... do a truth table..... did I listen to myself..... did I chuff!


it seems that rational inner-voice is only heard when it demands coffee or cake!!
If I had a hammer.....

Bryce

:D Ha, I was going to upload my scribbled truth table, but then I thought:

A) Zetro will have already done this
B) That would let the world see how random and scribbled my designs are sometimes :)

As I mentioned above, this would probably clash with many things on the CPC, so a fixed address range would need to be chosen and fully hardware decoded to ensure that the IDE interface didn't interfere with other devices and more importantly, other devices wouldn't cause writes to the HDD!

Bryce.

Zetr0

LOL, oh the irony on both A and B!

Yes, indeed a proper address range would be better way to go.  Sadly I am so green when it comes to the CPC that I make grass envious!

Although, I am also currently I implementing an SD card interface based on a Xillinx XC9572XL VQ44, it has the potential to achieve about 245KB a sec, provide a 115,000 bps Serial interface and theres enough room for a PS2 mouse input ;) =)

but I am thinking that this type of CPLD could used and do a little bit of off-loading as well =)
If I had a hammer.....

TotO

2 times faster by using 8bit IDE (145KB/s) than 16bit IDE (80KB/s), but you lose the half capacity.
Then, why not using the full capacity too ? :D

Each IDE unit come splitted in ODD and EVEN, and you can access both with 2x 8bit data bus, like 2 differents units ?
So, you get the speed and the capacity. (et le cul de la crémière)
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

TFM

Hmmm... With Yareks 8255IDE the FAT system can be used at 180 KB/s. What I want to say is that, 8 bit or 16 bit are not making the difference. It's all about I/O addresses and routines.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Zetr0

Hello TFM/FS

Quote from: TFM/FS on 23:05, 05 September 12
Hmmm... With Yareks 8255IDE the FAT system can be used at 180 KB/s. What I want to say is that, 8 bit or 16 bit are not making the difference. It's all about I/O addresses and routines.

would you have a link to the ide8255-003.zip file ? the on one Yarek's site is down =(
If I had a hammer.....

Gryzor

It's only here in this forum that I drool over things I don't understand. But I do hope for an end result... Oh my!


Are you planning any production, or just the design of the thing?

Zetr0

Production for sure!

My want is to ensure that every CPC user that wants Mass Storage should have the opportunity for it, and have it at pocket money prices - under £30!

With this it is my hope to really help the scene flourish more, with lots of people to do that bit more on the machines - from demo's to possibly larger adventure RPG's with lots of graphical data and I am really excited with Future OS and the possibilities of streaming movies, like we do on the spectrum but with much better output from the CPC for sure.

The Spectrum adapter pictured here was made with a slight more expensive PCB fabrication company than last time (hence them being sold at £19.99 ea), however the company (http://www.sitopway.com) have excellent communication and a 5 day turn-round service - its amazingly fast!

Interestingly a fellow WoS'er put me onto a company ITEAD Studio - Make innovation easier whom offer a 10 unit four layer 100mm x 100mm * PCB's - electrically tested for $99!!! - I have not used them yet.... but at that price its amazingly cheap!!!

(MMmmmmm - just thinking off all the mischief I can get into four layers!!!)

I am not to worried about the solution - either if an SD variant is developed as opposed to an IDE solution - the important thing is fast mass storage that can be accessed by the PC to put software on it as well as used under emulation  =)

Thats my hope atleast.... currently I am researching the way the CPC address structure - this site is an amazing help!
If I had a hammer.....

Gryzor

Wow. Put me down for a couple, will you? :D Seriously, thanks so much for your esprit de corps and your effort. Can't wait!!!

TotO

Quote from: Zetr0 on 15:12, 07 September 12Interestingly a fellow WoS'er put me onto a company ITEAD Studio - Make innovation easier whom offer a 10 unit four layer 100mm x 100mm * PCB's - electrically tested for $99!!! - I have not used them yet.... but at that price its amazingly cheap!!!
I have a link for ten 10x10mm PCB 2 (or 4 ?) layers for 25$.
A friend order here. I'll post it when I will be at home.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

McKlain


TotO

"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Bryce

I hate to rain on the party, this is a really great piece of hardware, but it depends heavily on firmware that doesn't exist yet for the CPC. If this project is going to be a success, we need some serious firmware programmers that know their stuff when it comes to IDE control. Who's willing to look at editing the CPC firmare to handle this? The firmware for the Spectrum +3 (known as 3e) does this on the Spectrum, so it might be a good starting point?

Bryce.

arnoldemu

I am interested in making a filesystem rom.

But then rpalmer has HDOS which can do this?

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MacDeath

#21
I recently got my hands on a pair of IDE compact flash card readers... I guess it can qualify for CPC/PLUS uses.


what do we have already ?




CPC-IDE - CPCWiki
IDE/8255 - CPCWiki




SYMBiFACE II - CPCWiki


SYMBiFACE II:IDE registers - CPCWiki
SYMBiFACE II:IDE routines - CPCWiki




Sadly, no old games could manage this... are SymbOS and FuturOS (and apps) the only offical things managing IDE mass data storage ?




Is it actually faster to have Flash memory or is it still limited by the CPC and the IDE technologie ?
On the other hand while handling less MegBytes, those flash use far less space on the table and less mecanical part, perhaps also less power concumption, less magnetic fields too.*




As we know, many commercial games were quite small... using far less than even a whole Disk side (=178K sort of) and even often loading wholly once on a 464...
This enabled many of them to be put in compilations so "they sold a million"...


Is it easy to get those many games loading from such IDE device ?


What about multiloading/bigger games ?

Bryce

Flash wouldn't have any speed advantages, because as you guessed, the CPC is the slowest part. But it does have the advantage that it needs much less power and only 5V.

Bryce.

MacDeath

Also takes less physical space, no dead cluster fragility, and so on.


Good point to is that having shitons of gigas (as in quite modern HDD) is certainly too much for a CPC... unless you go for long videos full movies in CPC format of course... :D

Bryce


Powered by SMFPacks Menu Editor Mod