Prop + IDE drives?
Spork Frog
Posts: 212
Has anyone made an IDE drive interface for the Prop yet?
It seems like it wouldn't be terribly hard to do, we certainly have enough I/O lines and I'm pretty sure enough speed to do it.
A project like the one attatched (this is actually an ad from Jaycar) would be nice too, but I've never come across anything specifically having to do with CD drives, just general IDE hard drives and CF cards.
It seems like it wouldn't be terribly hard to do, we certainly have enough I/O lines and I'm pretty sure enough speed to do it.
A project like the one attatched (this is actually an ad from Jaycar) would be nice too, but I've never come across anything specifically having to do with CD drives, just general IDE hard drives and CF cards.
Comments
I'm not exactly going for the practicalities of the whole thing here, just as an experiment to try and do it in the first place.
Although I've not done it, those are my sentiments as well. It's a 16-bit bus, three address lines for the control/data registers plus read, write and power and that's it ... plus the driver software.
CF in IDE mode is AFAIK exactly the same as for HDD.
And I found this -> www.retroleum.co.uk/ide_interface.html
Looks like for the most part IDE is somewhat similar to SPI, but with 16 data lines instead.
It is very possible.. a guy I know has a MP3 player and stores files on a HDD and he used a smallish PIC chip.
Also seen an article in an Elektor magazine a few years ago.. from memory there it was done with a 8051 chip..
cheers Ron mel oz.
I built this one once around the javelin module, but it was very
slow, because of I2C and the javelin interprets bytecodes.
At this link you can find all the java classes required.
http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/memory/compactflash/
regards peter
I've connected a HD to an 8051 variant (been a while though) attached is a picture of the mess I made.
One issue I kept having was the power up time for the HD, I was not giving it enough time to power up and finish its POST.
EDIT: I got it wrong the first time, I just figured out the "Clock" signal was just a reference in the guy's timing diagrams. Whoops.
So... more like this then:
1. Put the data on the data bus, or set the pins as inputs to get ready to read.
2. Set A0-A2.
3. Set CS0 low and CS1 high (can these be held permanently like this?)
4. Pulse either "RD" or "WR" low.
Post Edited (Spork Frog) : 2/3/2008 2:49:48 PM GMT
I'm thinking of using a non-Propeller to start with to avoid any 5V interfacing issues, then I
can wind the PSU down to 3V3, add some current limiting R's and see what happens. I'm
only going to be looking at the low-level stuff, sector read, sector write.
AFAICT, the 16-bit data bus can be just 8-bits ( only needs to be 16-bits for data transfers )
if losing half the disk capacity is acceptable. That would screw drive identification and FAT
but would still work if a new file system were designed. It looks like ATAPI only uses 8-bit
command packets so no problem for controlling CD-Rom for playing music.
8-data plus 8-control is far easier than 16-data plus 8-control with the hardware which I
have.
As an aside; does anyone know if it's possible to burn WAV / CDA / whatever to DVD and
use a DVD drive controlled via ATAPI as a standalone super-sized CD-Rom music player ?
The article describes using a PC motherboard as a microcontroller. They key is that they are using the same IDE bus to do it because of low latency. It has some pretty good descriptions of the IDE bus as well.
Just FYI
I was/am (on hold) working on an IDE object (raw·IDE·interface no·FS support, FS support is something that I wanted in its own object later)·but unfortunately the HW I had tried to use for level shifting did not work as I thought it would.· The sad part is that most of the code has been written, I just have to make the HW to test/debug it.· Currently unemployed so that is very much on hold :P
Attached is a couple of pics from the top of my code that might help someone else.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
But that is just my way of looking at it, the great thing about people is that we can all look at the same thing in different ways.
going to have to double check that. To start with I'd control both just to avoid any problems.
@ simonl : The SD Card FAT code should help, should be possible to hack perhaps so every
16-bit wide sector were split across two 8-bit wide sectors. Not sure what the upper size limit
is for the SD Card - 2GB ( haven't checked it ) ? No problems if there are enough free I/O's
to do a 16-bit bus. With RESET-, CS1- and CS0- hardwired that gets the I/O down to 21 I/O
lines which leaves enough for normal Prop use.
Here is a table that might help:
IDE reg: A0-A2: /CS0: /CS1: Use:
· $0 000··· 0··· 1···· IDE Data Port
· $1 001··· 0··· 1···· Read: Error code
· $2 010··· 0··· 1···· Number Of Sectors To Transfer
· $3 011··· 0··· 1···· Sector address LBA 0 (low byte)
· $4 100··· 0··· 1···· Sector address LBA 1
· $5 101··· 0··· 1···· Sector address LBA 2
· $6 110··· 0··· 1···· Sector address LBA 3 (high nybble in 0:3) **
· $7 111··· 0··· 1···· Read: "Status", Write: Issue command to drive
· $8 000··· 1··· 0···· Not Important
· $9 001··· 1··· 0···· Not Important
· $A 010··· 1··· 0···· Not Important
· $B 011··· 1··· 0···· Not Important
· $C 100··· 1··· 0···· Not Important
· $D 101··· 1··· 0···· Not Important
· $E 110··· 1··· 0···· Not Important
· $F 111··· 1··· 0···· Not Important
It was copied from this page (which was very helpful for me back when I was working with the 8052)
http://www.retroleum.co.uk/z80-ideinterface.html
Since there is nothing of any real importance (verified with the ATA spec) I just tied it high to cut down on the number of pins needed.
Attached is a pic of the connections to the prop I was using (the unmarked lines at connected to the left side are connected to the data lines)
They are techincally all you need to use the drive.
EDIT:
Because I confused myself a bit I've attached the page from the ata spec concerning the CS lines
Post Edited (Matthew Hay) : 5/3/2008 7:33:03 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
except recovering after an error - I'm resetting the IDE devices so something odd / I'm missing
is going on.
For the record CS0- and CS1- can be tied high/low; IDE Pin 37 = 0V, Pin 38 = +5V. However,
if necessary to issue a soft-reset after the errors they'll have to be controlled.
Making the 8-bit wide sectors PC compatible; the best option I can think of is formatting the disk
so it's one ( or more ) files filling the disk then run a virtual file system inside those files, similar
to how Virtual PC etc .VHD files work. Should be fairly easy to write an App which can copy files
into and out of the files.
Obviously 16-bit wide sectors would make everything far easier, but 8-bit wide has far less I/O
line requirements. With likely needing to do level shifting for the Prop it would probably be just
as easy to level-shift and multiplex an 8-bit Prop to 16-bit IDE bus.
AFAIK the upper limit is a function of the FS, and then it's the limit on a partition's size. In the case of rockiki's code; I believe he's written it for FAT16, which limits a partition size to 2GB.
I found this page of FAT & drives which may be of interest.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style
A while back I made an IDE interface board for a HERO 2000 robot. It is based on an 8088 CPU with an 8-bit data bus. The system but isn't quite the same as an IBM PC but I implemented a circuit similar to the one here:
www.mylinuxisp.com/~jdbaker/oldsite/documents/xtide.txt
It will latch the upper 8-bits so that by doing two writes or two reads you can get all 16-bits and easily interface it to an 8-bit port. I'm sure something like this could be used to make the IDE work with the Propeller.
Having all 16-bits available will enable a driver to query the IDE device for the parameters. It will then know what the drive specs are and will be able to use the full capacity of the device.
Robert
Post Edited (RobotWorkshop) : 5/5/2008 3:41:23 PM GMT
Have you considered the 8255PPi chip?
I have collected all the resources to build the circuit, I've just got too many other projects with precidence over this one to have made much head way.
I have thought many times how neat it would be to just use the propeller, but the components involved can't beat the one chip 8255 solution!
Identify Disk command. Although only the LSB of cylinder count comes back, it's easy enough to
keep adding 256 and reading sectors until the drive throws a 'doesn't exist' error. Same can be
done with sector count but I'm not sure if that can go above 256 anyway.
Even without Identify Disk support it would be possible to do that but would take a little longer.
Once determined the data can be stored in Eeprom, at turn on it should be a simple case of
checking the last sector exists and the next doesn't, otherwise one knows the disk has been
swapped and geometry can be determined again.
@ bambino : An 8255 or any register / latch should do the job although direct to I/O pin I find
far more pleasing. To get the level-shifting the Propeller will need something, and the 8255 could
be a single chip solution.
A micro could do the job and a serial ( I2C ? ) interface would minimise the Propeller I/O required
if speed wasn't crucial.
http://www.pjrc.com/tech/8051/ide/#schematic
http://www.pjrc.com/tech/8051/ide/wesley.html
Both however did not use port C for control lines to the hard drive, this would be my suggested improvement as bit minipulation is possible with port C only. Using port A or B only allows for byte manipulation!
PS. I have a book on the 8255, if you get any specific questions I'll try to look them up for you.
·And also the author reccomends one invertor chip as well to keep the Hard drive from resetting when resetting·the 8255 control registry.
Post Edited (bambino) : 5/5/2008 9:25:26 PM GMT