compactflash interface problem

hello, I design a compactflash interface between pci and a sandisk compactflash with true-ide mode, but I have some problem now. after reset, I try to read the status register of CF, I got 0x58. When I try any ATA commands like read sectors or set features ( set CF to PIO mode), I got 0x59 from status register. What is the matter? I think I make the read/write sequence right. BTW, the timing parameters I used is PIO-0.

Thanks!

Reply to
NoThisRAT
Loading thread data ...

Did you get the polarity of the chip selects right? Have you reset the card? Do you have to do the whole drive select (probably with the LBA bit on) in the head register like for an actual IDE disk? Send any other initialization commands? Have you verified with a scope that the CF card is actually driving the data lines and you aren't just reading phantom values or resistors? Are you waiting for the busy bit to go away, and when apprpriate the data ready to come on, before you try to do things?

One thing to do is slow it all down... I originally tried to hang an IDE interface right off a bus, but switched it to registers for software control of the actual signals in order to debug things more simply; now that it works I'm going to work on switching it back and think about a DMA mode.

Status of 0x59 means the error bit is on, try reading the error register. I usually got this when I read from an illegal location for a disk's geometry... I was first playing with a little old drive that seemed like it claimed to support LBA but in fact didn't.

Chris

Reply to
Chris Stratton

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.