Hard disk IDE interface problem

Thread Starter

aleksazr

Joined May 16, 2010
14
I've built only 2 MCU systems that have an IDE hard disk,
but they both worked fine. My third one is giving me some troubles.

After reset, I read
0x1 from addrs 1-3, and
0x0 from addrs 4-6,
which, I believe, are the correct reset values.

But when I do a second-loop read, all regs show 0xFF.

Status reg (reg 7) always shows 0x0.
That alone should indicate that the device 1 is not present,
and device 0 responds in the place of device 1.
But that happens no mather what value I write in
reg 6, bit 4 (DRV bit).

I've checked with the scope DIOR, DIOW, DA2-DA0, CS0 and data bus,
and I don't see a reason the hole thing fails.
My writes DO reach hard disk, and my reads really show reading
0x0 from the disk.

Why is it sending me 0x0 instead of 0x50 in the status reg?

Also, even though I've checked the lines with the scope and
everything seems fine, a write to reg 2 with 0x55 reads back 0xFF.

Also, I've issued the Sleep command several times, and it worked
only one time. Again, I'm pretty sure the I/O lines are fine.

So I'm clueless now.
 
Last edited:
Top