Spartan 3 ata interface

I'm working on a simple ide interface to a spartan 3 fpga.

I've gone over the ata specs and online projects and I keep getting stuck.

All I am trying to do right now is read the status register and I can't get back anything that makes sense.

All the fpga does is set the CS and address lines, pulse the Dior and before the pulse drops copies what is on the data line to a register.

I have 4 older drives I'm working with, an old 730mb, a 650mb, a 4.3 gb which are not compatible with anything more than ata-3, and a 6.4gb which is ata-5 compatible. The outputs from the fpga are wired directly to the hard drive, i figured this was okay because I saw a few projects do it but my data lines would always seem on so I terminated them with a 10k ohm resistor to ground.

The smallest drives give me back nothing, the 6.4gb gives back 0111

1110 and 0000 0000 on the error register. The spartan 3 is outputting 3.3v, so are the other drives needing 5v even though specs only say it needs greater than 2.4v on the lines, or is the 6.4gb drive broken. I keep testing all drives in my desktop and they seem fine.

I know its hard to go on what I just explained, and I've been over time stuff on the ata specs a lot and they seem to fall into spec so Is this likely a voltage problem?

I would apperciate any help anyone could give me. Thank you in advance

Reply to
Terradestroyer
Loading thread data ...

The problem is not really feeding the drive with 3.3V, it is more th

5V that's comming back from the drive that can cause problem. Yo should use level converters

I did desing an ATA interface in the past, but not with an FPGA,

used a micro-controller (ATMEL). Make sure you set correct CS Address, and pulse DIOR. Also, take note that some of those signal are inverted, make sure you use correct polarity, using inverter i needed

Reply to
Big Boy

I'm not sure about the 5v stuff because I have tested the fpga with a

5volt source and it hasn't harmed it yet, it could in the future and I believe it will if i keep doing it for a while but don't think that is the big thing.

My program is designed to loop and continually update and display the status register via led's. As soon as I inverted the cs lines the 6.4 gb outputs started to make a whole lot more sense

1000 0000 -> 0101 0000 -> 0101 1000 -> 0101 0000 and after a while it then gives 0101 0001. So the error bit activates after I continually read the register. This sounds to me like its working now, and I have yet to test this drive again in the computer.

Still the other drives w> The problem is not really feeding the drive with 3.3V, it is more the

Reply to
Terradestroyer
5v inputs apparently can cause damage over time. I used series resistors to get a simple IDE interface up and running on the digilent S3 kit a while back... don't remember the particulars, other than that it was a couple days of frustration before I learned to talk to the drive, but after that it went quite well. Unless you are doing one of the really high speed modes, small resistors should not cause you signal integrity problems. Be carefull of the polarity of some of the control signals - some of the various writeups online can imply misleading things. But the various microncontroller projects are good examples for how to initialize the drive (strongly suggest LBA mode).
Reply to
cs_posting

I feel that I'm having some luck and can read from just about any register now, but can't get it to write to any. This is seeming like a voltage problem to me but I can't be sure. I've tried directly connecting 3.3 and 5v to the drives data lines and having the fpga pulse the diow while pointing to a register but no luck even with that when I tried to read back from the register I tried writing to. Any reason that shouldn't work? It complies with all the minimum timings, no max timings are listed for some stuff so I figured there are no real maximum.

cs snipped-for-privacy@hotmail.com wrote:

Reply to
Terradestroyer

Are you sure the register you are writing to is readable? I don't have the spec in front of me, but in some devices write register are not readable, or return other information when read than what was written to them.

If you want to see if the drive is hearing you, try sending the spin-down command ;-) Of course, that's not reliable as older drives might not support it.

Reply to
cs_posting

I actually have the spin down and spin up commands working perfectly on most of my test drives here, so that should be a pretty good indication I hope. Only one of the drives don't seem reliable and that is when it is told to spin up, just keeps giving me an abort error unless I send the command about 10 times, but the other 2 drives I have here do it flawlessly, only ever have to send the command once.

I figured that the LBA low/mid/high and sectors could be read back when written too, But as of right know I have only tested reading back after writing on the one that won't spin back up without 10 or 15 commands. The only reason that is is because it was the first drive I got working, and then I found out that the DIOR and DIOW lines are also inverted and that was why the other drives didn't respond. (doesn't really explain why that one did... hmm).

Again thanx for your help, Its the little things that are hanging me up and for me its just a really big learning experience.

Reply to
Terradestroyer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.