PDA

View Full Version : uIDE-8 and uIDE-16 general purpose Z80 IDE interfaces fro CP/M machines



JonB
February 8th, 2017, 08:44 AM
Hi

Following on from this thread (http://www.vcfed.org/forum/showthread.php?55909-Amstrad-Schneider-PCW-IDE-drivers-an-interface), I would like to say that the IDE board discussed is universal and will connect to any Z80 computer via a shim card interposed between the Z80 and its socket (assuming it is socketed).

There are two variants:

uIDE-8, which uses A7-A3 of the Z80 address bus to decode the base adress of the IDE registers, and
uIDE-16, which uses A15-A3 (for use on machines that use OUT (C),A and expect a device to decode all address lines, for example the Amstrad CPC6128 )



Also, I have produced left and right handed Z80 shim cards which should be chosen according to the space and/or orientation around your computer's Z80 socket. As you probably know, I wrote a CP/M 2.2 driver suite for the TRS-80 Model II running under Lifeboat CP/M, and this could easily be modified to run on any other vanilla CP/M 2.2 machine. This supports up to 32 8MB partitions across two IDE devices (master/slave) with mapping between CP/M drive letters A: to P:. The driver doesn't support warm boot as yet but will at some point. Cold booting is out for obvious reasons.

The boards are "universal" because they have a set of jumpers that is used to set the decoder base address. uIDE-16 has an additional jumper to disable A15-A8 decoding (effectively, it becomes a uIDE-8), so perhaps we could say it is the more "universal" of the two. This means that you are free to reconfigure it as your machine requires (choice of base address is determined by what I/O addresses are already in use).

Anyway, I will be making these boards available for anyone who would like to add a hard disk to their CP/M machine, but does not want all the pain and cost of sourcing a "genuine retro hard disk and interface".

For more details, see the uIDE Wiki page (http://www.cpcwiki.eu/index.php/UIDE_Universal_IDE_adapter_cards_for_Z-80_computers) on CPCWiki (an Amstrad / Schneider CPC site). I will extend this with more information as it becomes available.

Cheers
JonB

Oscar
February 8th, 2017, 10:10 AM
Brilliant! So many CP/M machines I need this for. Keep us posted!

Oscar.

WSM
February 8th, 2017, 12:16 PM
While I congratulate you on your project, I'd also like to respectfully add my thought that this board might not be quite as "universal" as it initially appears.

The potential problem as I see it is that faster Z80s will violate the ATA timing specifications for PIO mode 0 during the initial IDENTIFY before switching to PIO mode 3 or higher, *IF* the device supports it. The PIO mode 0 register access specifies a 70ns address setup with a 290ns pulse width and a 30ns write hold. Data access only requires a 165ns width. Modes 1 & 2 also have the 290ns register access pulse width requirement. On first glance, I would think that a Z80 at more than about 8MHz would violate this, even though they're available at up to 20MHz.

FYI: I went through the school of hard knocks developing a 16-bit CPLD-based PIO+DMA ATA interface to the Z180 at 33MHz. Wait state logic was absolutely required for various PIO mode reads while writes could be latched and processed asynchronously. Although some ATA devices could initially respond to faster PIO rates, it was a bit of a crap shoot with older devices.

JonB
February 9th, 2017, 10:25 AM
Hi Oscar

uIDE-8 prototypes and shim cards are on order. There are 10 of them, because I need to ensure they are good enough quality before offering them to people. There is an active discussion ( of uIDE-8 ) on the CPCWiki forum here: http://www.cpcwiki.eu/forum/nc100-nc200-pcw-pda600/who-wants-ide-drives-on-the-pcw/ and uIDE-16 here: http://www.cpcwiki.eu/forum/amstrad-cpc-hardware/cpc-ide-adapter-anyone/

You can keep tabs on the project by lurking on those two threads. People are already putting in provisional orders. For most Z80 machines you need uIDE-8 and a Z80 shim card. Only odd machines like the Amstrad CPC will require uIDE-16 because these use a full 16 bit I/O address (via OUT (c),n which places BC on the address bus).

For CP/M 2.2 driver support, I have written a suite of programs called xdriver : http://www.vcfed.org/forum/showthread.php?55487-TRS-80-Model-II-Lifeboat-CP-M-LoTech-IDE-Adapter-Extended-Driver-v1-9

You can see in the readme file what the xdriver can do:

- Supports up to 32 x 8mb drives (16, master, 16 slave).
- Uses IDE LBA, 8-bit transfer modes.
- Uses up to 5k of CP/M RAM (minimum 2k).
- Flexible upper memory usage options.
- Drive mapping capability (access all drives with limited memory by remapping physical drives to logical drive letters). Drives can be mapped in real time without rebooting, temporarily (in memory map update) or permanently (patches the driver loader executable).
- Auto-detects and supports IDE Master and Slave drive configurations.
- Test utility that interrogates and reports on connected IDE device capabilities.
- Formatter for 128mb devices.

It currently runs on the Tandy Model II with Lifeboat CP/M, which is a vanilla CP/M implementation, so it shouldn't be difficult to port to other CP/Ms on demand. I will need you to find some things out, such as where the CP/M jump table resides, the location of the end of the BIOS, what the Z80 I/O base address should be (choose a range of 8 consecutive addresses that do not conflict with other devices in the system, or common external peripherals) and a few other bits like that, then I can compile it and send to you for testing. Take a look at the installation instructions to see how to build it into your CP/M.

Testing of the driver has been extensive, and it seems to be very reliable, so I think we are 80% there. Which machines do you have in mind?

Regards
JonB

commodorejohn
February 9th, 2017, 11:00 AM
Just out of curiousity, what's the maximum speed Z80 that would be supported? I'm thinking specifically of the Zeta SBC which can run at up to 20 MHz.

JonB
February 9th, 2017, 01:27 PM
No idea, but it would be fun to find out.

However, bearing in mind the following:


uIDE-8 uses 2 7400 series ICs and a single transistor to handle address decoding. uIDE-16 has four ICs but the signals run in parallel so it perform like uIDE-8. Short signal path = lower propagation times.
A modern CF card or DOM (DOMs are definitely recommended here, they are smaller and more compatible) should have the chops to keep up.



..then I would say you would have no problems, but that is untested opinion as I don't have a fast Z80 to try it on.

pearce_jj
February 9th, 2017, 01:48 PM
Good luck with this board, it's a really neat solution.

JonB
February 9th, 2017, 10:21 PM
Thanks, Pierce.

It's similar to the early TRS-80 design documented here http://www.qsl.net/zl1wjq/trside1.htm but with more complete decode logic so I can claim it as my own design, just about - although that might be going a bit too far as it has been done before and there are only so many ways to connect a device to a bus. It uses an 8 bit comparator and 4 NOR gates, which allowed me to reduce the chip count to 2. A transistor implements an inverter that was going to drive the activity light, until I found that the DOM didn't have enough oomph for the job. So I used a proper NOR for the LED and the transistorised inverter to replace the NOR (if you get my drift). I could have used one of those single gate SMD parts for this, and probably will in a future iteration, but for now I wanted to keep it simple and easy to assemble.

Of course, in the "El Cheapo" tradition, I priced the boards low. 7.50 for the uIDE-8 and 2.50 for the Z-80 shims, plus PayPal fees and P&P. I would like to have a nice web site like yours to sell them on, but I have no time to create / administer it.

Now the Z80 shim presents what we might refer to as a "Z-80 bus", which is just the signals on every leg of the CPU on a 40 way IDC connector. So I think it should be workable to design a 40 pin backplane and hang uIDE (and future cards) from it. This I have proposed on the CPC forum for the Amstrad PCW machine, which has no connectivity other than a 50 way expansion port and a proprietary printer port. I'm going to clone Amstrad's serial / parallel interface (the CPS8256 device) which is a bit hard to come by in the wild and I will also design other extensions. A cute little hand made rack will complete the picture. All cards will feature the same sort of user settable decode logic, so they can be put on other Z80 machines (like uIDE).

So far I have designed and laid out seven boards that are shown on the CPCWiki page I linked to, but I have yet to receive any of them from the fabricator. And I have already made the typical rookie mistake of sending the wrong Gerbers and ending up with an unusable board (in this instance, with no holes for the pads or vias). I suppose this is how one learns..

Cheers
JonB

pearce_jj
February 9th, 2017, 10:25 PM
Oops! Well I still seem to make plenty of mistakes so I would worry too much about that.

Amazon with Amazon fulfill,ent might be worth a look. You will need to register a bar code for them.

JonB
February 9th, 2017, 10:37 PM
Oops! Well I still seem to make plenty of mistakes so I would worry too much about that.

Amazon with Amazon fulfill,ent might be worth a look. You will need to register a bar code for them.

Interesting idea, but do I have the volume of orders to do it, I wonder? So far I have about 20 orders, so still within the capability of a hobbyist. I've offered assembly but it is not cheap and I encourage self build.

JonB
February 11th, 2017, 01:02 PM
While I congratulate you on your project, I'd also like to respectfully add my thought that this board might not be quite as "universal" as it initially appears.

The potential problem as I see it is that faster Z80s will violate the ATA timing specifications for PIO mode 0 during the initial IDENTIFY before switching to PIO mode 3 or higher, *IF* the device supports it. The PIO mode 0 register access specifies a 70ns address setup with a 290ns pulse width and a 30ns write hold. Data access only requires a 165ns width. Modes 1 & 2 also have the 290ns register access pulse width requirement. On first glance, I would think that a Z80 at more than about 8MHz would violate this, even though they're available at up to 20MHz.

FYI: I went through the school of hard knocks developing a 16-bit CPLD-based PIO+DMA ATA interface to the Z180 at 33MHz. Wait state logic was absolutely required for various PIO mode reads while writes could be latched and processed asynchronously. Although some ATA devices could initially respond to faster PIO rates, it was a bit of a crap shoot with older devices.

That's a good point and thank you for the timing information. I can only say that, for now, it has been tested on a retro 4Mhz Z80 machine, and it works reliably (so far). Perhaps I should have been more complete in my description. It is universal in the context of the retro computers that we all know and love. I didn't think anyone would want to use it on a more up to date Z80 design because surely there are modern solutions to mass storage on these processors.

I use the word "universal" because it (uIDE-8 ) can be configured for any consecutive 8 i/o ports that are on an 8 byte boundary, so ?0-?7 or ?8-?F. It should therefore be usable on any Z80 computer that does not have a fully used I/O map. The uIDE-16 supports ???0 and ???8 base addresses (I needed this specifically for the CPC machines which rely in the out(c),n instruction dumping all 16 bits of BC on the address bus), but it supports the uIDE 8 bit address mode, too.

As a hobbyist, I have to caveat my design. I'm not a big manufacturing venture with stacks of cash in the bank, liability insurance or anything like that, so I make no guarantee it will work with your computer, because I probably don't own one and therefore cannot test it myself. However, I am greatly encouraged by the results I have achieved with the humble PCW 9512 and 8256, the Amstrad "word processors", and I see no reason why it shouldn't work on other CP/M machines of a similar ilk (and there are many of them which don't have any affordable mass storage options).

So yes, YMMV, but on the other hand it is cheap as chips. You are not remortgaging your house to try it out.

JonB
February 13th, 2017, 04:02 AM
I have just ordered a batch of boards with expedited shipping. Hopefully they will arrive quicker than the first batch (which I am still waiting for).

AndersG
February 13th, 2017, 09:39 AM
Just FYI: I Use PCBWing and they are very good. Attenton to detail and fast shipping. I generally order boards with a 10-day turnaround and shipping by fedex is usually 3-5 days