I want to take on designing an IDE controller for the Apple II but will need help

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
I've been going through the available mass media interfaces for the Apple II. The old stuff consists of SCSI controllers and newer stuff are reimplementations of the SCSI interface or designs using either IDE HDDs or CF/SD cards/USB like CFFA3000, Focus IDE, MicroDrive.

The problem with most of the new implementations is that they're pretty expensive or not available or both. Mostly due to the designers being entrepreneurs that design and manufacture this stuff for their living. I can't complain about that but I'm searching for a community driven project like the XT-IDE and its derivatives that you can assemble yourself and save quite a bit. There is one open source project here: http://s.guillard.free.fr/Apple2IDE/Apple2IDE.htm but it's pretty old and it's a bit unclear if it actually works in a way you'd expect a mass storage in a computer work nowadays.

Other thing about the modern implementations that most of them handle the mass devices virtually, meaning you have several virtual hard drive and floppy drive images that you can switch and that's all fine. I would just like a no frills no thrills interface that would work as it basically does in your bog standard PC. I currently have a couple of devices with basically can store both floppy and hard drive images and you can use those like a regular hard drive or floppy drive. The first is SD Disk II, which uses SD cards. It's pretty straightforward to set up and is pretty much "plug and play" as a hard drive. The thing is that it has not been originally designed to be used with 16-bit OS as GSOS. The developer was kind enough to make support but the OS loads pretty slowly compared to the traditional SCSI. I have also UnisDisk, which connects to the smartport. It can basically do the same things as the SD Disk II and loads GSOS slightly faster but it's still something sticking on the end of a cable. This applies also for SCSI interface. It doesn't officially support internal mass storages.

To my understanding, an interface that will adapt the 16-bit bus of an IDE device to the 8-bit bus of an Apple shouldn't be very complicated to design. The real issue here is the driver firmware that enables the booting and disk operations. On the other hand it has been done on the examples above and some of them are open source, so this shouldn't be an insurmountable issue either.

I would really like to take on the challenge of designing a simple no thrills, no frills, auto booting IDE/CF interface for the Apple II, which would be at least in par with the old SCSI interface performance wise. It should be possible to create the partition with i.e. CiderPress and then write it on the actual hard drive/CF card, after which you can just connect it to the interface card, plug it into the Apple expansion slot and have it then accessible for installing GSOS or just ready to be used if you have done the OS installation in emulator. The end product would be a PCB that anyone with basic soldering skills could assemble and the necessary firmware on ROM.

I have no electronics education. All that I know I've learned myself. I can solder and assemble electronic equipment. I have a basic understanding, what capacitors, resistors, transistors and diodes do. I can read schematics to some extent and with simple cases apply it in practice.

I suppose my starting point is getting familiar with the Apple II bus and how to connect it to the IDE interface. I need to design the discrete logic to translate the 16-bit data to 8-bit and back. A lot of studying is needed and it probably helps to divide the whole task into smaller ones.

Am I in way over my head with this one or is it doable? Needless to say I'd really appreciate all the advice you can give. I can't guarantee I'll be ready with this any time soon, if at all.
 

Pghulme

Active member
VIP
Joined
Nov 12, 2013
Posts
3,251
Country
UK
Region
Manchester
Am not sure how much help anything I may add may be, and I don't own an apple II.....
What sort of interface does the apple 2 have? Do you have a pinout/spec sheet?
you say about converting from 16bit data to 8bit data, but the IDE interface can be driven by 8 bit data and only few address/command lines (a0,a1,a2 or pins 35,33,36 on the IDE side) as well as a few others
if the apple II interface has direct Access to data,address,cs,WR,RD lines as well as a few others then you could build a non bootable IDE interface quite easily.
For a more advanced version you could try some simple logic with a XC9572XL

but good luck with your project
 

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
Thanks!

The link to similar project by Stephane Guillard, containing some schematics and the pinout of the Apple II slots, can be found from my initial posting.

A simple 8-bit interface would probably be fine also as halving the capacity isn't really an issue. Not sure though how it affects the performance. Mine will probably be much like Stephane has made. I'll probably just stick to flash media, hoping to eliminate the need for an external power source. Have to study the existing projects and datasheets and especially how you can write device drivers to an Apple II. I'm assuming that I should be able to utilize the code used in projects that emulate hard disks in making the driver.

As I said, I'm learning this as I'm doing it. By the way, can this kind of project be done without a proper logic analyzer? I don't own one and have not planned to get one at this point. Also, I have a memory that Eagle Lite may not be the best freeware electronic design program available. What alternatives do I have?
 

Olav_nordmann

New member
Joined
Oct 11, 2011
Posts
30
Country
Norway
Region
Hordaland
With the XT-IDE project, one of the goals was to use FAT-formatted IDE harddrives inerchangeably between modern machines and the old machines, which is why it was nessecary to have the 16-bit/8-bit interface converter. If the intention is just to get data on and off the disk, then only using the low 8 bits with the upper 8 bits constantly pulled high will be sufficient.

The way it works is that when you read data off the disk, you latch the upper byte on the card as the lower byte is read, and then the upper byte is read out on a special I/O port afterwards. For writes it's opposite, then you first latch the upper 8 bits by writing to the special I/O port, and as you afterwards write the low byte the whole 16-bit will be sendt to the drive. This was designed solely with I/O Polling mode in mind, and as such DMA modes were never supported with the full 16-bits on this interface. If you want that, you'll need a sector-buffer and smarter logic on the card, something alike the old WD1010 MFM-based interfaces combined with some DMA controller.

I am not familiar with the disk-formats of the Apple II, so I do not know how it should work out if you intend to keep the filesystem on the drive compatible with modern computers. You will problably need some sort of driver that does all the nessecary file-system translation/emulation. Heck, in that case it should even be possible to just stick a microcontroller on there and call it a day.

With the XT-IDE everything is in the BIOS extension firmware, which is simple enough. The rest of the compatibility is taken care off by DOS since both it and modern Windows (still) understands FAT.
 
Last edited:

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
Hi Olav, and thanks for your insight!

I'm beginning to feel that I really should begin it small and do an 8-bit interface. Did I understand correctly that the latching is needed, if you want to be able to handle all 16 bits through the 8 bit interface? Can you set the upper 8 bits high by simply connecting them to VCC or ground? Sorry, Im quite wet behind the ears regarding circuit design.

I'll probably stick to the Apple native file system. That has the downside of 32 MB limitation. The GSOS can support bigger partitions but as Iwant keep it simple, 32 MB will do. There is software which enables you to do the file management on a PC.

What I'm not quite sure of is how the drivers of i.e. the Apple SCSI cards are programmed. Is it Assembly or C? Are the emulators or emulating devices also using asm or are they written in higher level language?
 

Pghulme

Active member
VIP
Joined
Nov 12, 2013
Posts
3,251
Country
UK
Region
Manchester
It's seems like a great project, but there are baby steps to take first. The link you put on your first post: http://s.guillard.free.fr/Apple2IDE/Apple2IDE.htm
is a good place to start as it already has sample code and the board it demonstrates is very simple.
then you could look at adding things like logic or eprom maybe for bootable device
i use eagle for everything, it's not as powerful as others but just works! If you need any help with the design of the board is be happy to get involved.
 

Olav_nordmann

New member
Joined
Oct 11, 2011
Posts
30
Country
Norway
Region
Hordaland
I will also recomend starting small, untill you got the full understanding on how a data-bus works and how these old CPUs use them.

To handle anything more than 8-bits at a time over an 8-bit bus, latching will be needed. There's only 8 data lines to work with. As for pulling a line high, always use pull-up resistors on bidirectional lines! A line in output mode, outputting a 0 and directly connected to VCC without a pull-up resistor will waste a lot of current. A typical value for a pull-up resistor for TTL 5V logic is 10K.

When it comes to programming, most of the low level code on old machines is done in assembly. At the end of the day it's all machine-code anyways. Many of these low-level firmwares use reserved RAM locations, or no RAM at all, so be aware of that. NEVER use user-RAM for these tasks unless you have some driver in the OS that ensures that RAM is reserved for the task. For the XT-IDE we edited the Memory Size byte in the PC BIOS data area to reserve 1K at the end of RAM.
 
Last edited:

Pghulme

Active member
VIP
Joined
Nov 12, 2013
Posts
3,251
Country
UK
Region
Manchester
The simplest IDE implementation, taken from http://www.worldofspectrum.org/zxplus3e/interface.html#simple

image.jpg
 

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
Last edited:

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
I bought an Apple expansion proto card for my project. Have to continue with the schematic now. Also have to find the datasheets for the 65816 and the Atmega32.

Edited_ImageEasyImageEditor_20150721_1.jpg
 

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
I would need some help getting the Apple 2 expansion bus into my Eagle project. I've tried to look for a suitable connector in the Eagle libraries but haven't been able to find one with the correct pinout.

Would someone more experienced with Eagle be able to help me to create a custom connector?
 

PymerOne

Noob pur sang
AmiBayer
Joined
Jul 16, 2010
Posts
515
Country
Netherlands, Europe
Region
NoordHolland, Far side of civilisation's border.
If need be I can test on AppleII/e, its kinda substandard :)

Grtz, PymerOne.
 

Pghulme

Active member
VIP
Joined
Nov 12, 2013
Posts
3,251
Country
UK
Region
Manchester
Do you have a picture of the connector on the apple?


ignore that, I can see from your photo card the type of connector, the connector looks like a standard card edge connector, there are plenty of library's on www for eagle library's

--------------------------------------------------------------------------------------------------------------------------------
OK, download the following eagle library (its not mine), its for master system cartridge, which matches the apple ii connector (2x25 0.1")
and in that library is ESMS->ESMSM part, just use this as a starter/guide, ignore the values on the part and just use A1-25 and B1-25 as your front and back pins.
if you need any help with this let me know.

https://docs.google....?hl=en_US&pli=1

and the pinouts for the connector so you can matchup a1-25 and b1-25
http://osites.tripod.com/peripheral.html
 
Last edited:

protek

"Takai desu ne." -"Jinsei da."
Joined
Feb 17, 2008
Posts
4,001
Country
Finland
Region
Oulu, Pohjois-Pohjanmaa
Thanks, Pghulme! I installed the library and managed to create a variant that has the pin assignments like in Apple 2.

Here's a screen capture what I've made so far. It's not much but a start.
Capture.PNG
 

Pghulme

Active member
VIP
Joined
Nov 12, 2013
Posts
3,251
Country
UK
Region
Manchester
Looks good :)

we we all got to start somewhere, keep me updated on how you get on and if you need any help feel free to let me know

Thanks, Pghulme! I installed the library and managed to create a variant that has the pin assignments like in Apple 2.

Here's a screen capture what I've made so far. It's not much but a start.
View attachment 92459
 
Top Bottom