Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hard disk IDE interface problem

22 views
Skip to first unread message

aleksa

unread,
May 27, 2011, 5:44:25 PM5/27/11
to
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?


aleksa

unread,
May 27, 2011, 6:15:13 PM5/27/11
to
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.


"aleksa" <alek...@gmail.com> wrote in message news:irp5vv$cbp$2...@dont-email.me...

Didi

unread,
May 27, 2011, 7:05:28 PM5/27/11
to
On May 28, 1:15 am, "aleksa" <aleks...@gmail.com> wrote:
> 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.
>
> "aleksa" <aleks...@gmail.com> wrote in messagenews:irp5vv$cbp$2...@dont-email.me...

> > 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?
>
>

Oh welcome to the club. A bad decision I took 10+ years ago to
choose the wrong connector (was the only small enough option
back then) has cost me countless hours and probably has shortened
my life with many years while chasing which pin of the cable does
not work this time (which gets active no earlier than closing the
case, of course).
Sounds much like a cable problem. With ATA they come in many
varieties, even without my poorly chosen connector (which works
OK once made to work, it just costs *a lot* to get there).

If you have the option to just test with another cable you
probably want to do that. If you beep the cable and it sounds
OK don't get too happy, it may still stop working after you
bend it in the test setup (most of them have single wires inside).

I know how this sounds but I have had way too many of these
cables and at the moment I am back there replacing a DVD-writer,
that cable cost me a few hours already... I am not always that
furious, you know :-).

Dimiter

------------------------------------------------------
Dimiter Popoff Transgalactic Instruments

http://www.tgi-sci.com
------------------------------------------------------
http://www.flickr.com/photos/didi_tgi/sets/72157600228621276/

Roberto Waltman

unread,
May 28, 2011, 9:53:55 AM5/28/11
to
Didi wrote:

>...


>Sounds much like a cable problem. With ATA they come in many
>varieties, even without my poorly chosen connector (which works
>OK once made to work, it just costs *a lot* to get there).
>
>If you have the option to just test with another cable you
>probably want to do that. If you beep the cable and it sounds
>OK don't get too happy, it may still stop working after you
>bend it in the test setup (most of them have single wires inside).
>

I just went through my own life-shortening connector experience.
Bringing up the hardware in a new design, with an HDMI connector were
one pin was not soldered, but was lying above the PC pad just so that
the pressure from touching it with a scope probe will make a valid
contact. Signal looks OK, but it is not getting through, signal looks
OK, but it is not...
These things are sneaky ...
--
Roberto Waltman

[ Please reply to the group,
return address is invalid ]

aleksa

unread,
May 29, 2011, 2:56:58 AM5/29/11
to
"aleksa" <alek...@gmail.com> wrote in message news:irp7p9$nkg$2...@dont-email.me...

> 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.

Actually, that would be normal, since issuing the
Sleep command requires a RESET.

But, I am actually using the Stand-by command.

I don't think it is the cable - I've tried the same
hard drive and the same cable on my PC and it works.
I have even changed the cable, just to be quite sure...

Is there a specific forum about this kind of stuff?


aleksa

unread,
May 29, 2011, 4:38:01 AM5/29/11
to
It looks like DIOW gets triggered by DIOR,
for reasons not yet known. My scope doesn't see
that, but the problem disappears when I place
a cap on DIOW line.


Rocky

unread,
May 29, 2011, 6:04:45 AM5/29/11
to

It can be because of asymmetrical drive capability on the your driver
chip. It is also possible that the rise/fall times of the drivers are
too fast causing capacitively coupled transients. Series resistors
could also reduce/fix the problem.

aleksa

unread,
May 29, 2011, 6:16:33 AM5/29/11
to

The driver on my side is GAL16V8.
Hard drive has series resistors on its PCB - and none of my
previous versions had them on my PCB.

I can now read the disk only to see that I read
only the high byte... maybe I was drunk ;)

Didi

unread,
May 29, 2011, 8:38:29 AM5/29/11
to

The ATA cable is a complete mess. Unterminated signals etc.
You can try some series resistor (10 Ohm or so) at your
driver outputs, not only on DIOW/DIOR but also on DACK.
How many wires are there in that cable? If it is not
one of the 80-wire ones (on a 40 pin connector, 40 are
just GND) it will be easy, just get an 80 wire cable.
If the 80 wire cable won't work, hmm, look for glitches
on the GAL output, most likely the fault is in its logic
(or in what it gets as input). But the way you describe
it with the cap etc. it sounds just like capacitive
coupling between the lines of a plain ribbon cable,
a standard UDMA capable ATA cable should not have this
problem.

aleksa

unread,
May 29, 2011, 8:51:41 AM5/29/11
to

It is a 40-wires cable. But the pinouts on the IDE cable
were carefully chosen so that DIOR/DIOW *do* have GND around.
(by whoever designed the IDE conn)

aleksa

unread,
May 29, 2011, 8:59:48 AM5/29/11
to
I have the DMACK floating.. (shame)
Will change that. (to VCC)

Didi

unread,
May 29, 2011, 10:50:46 AM5/29/11
to

Indeed. But if you had had *that* floating it would have been
even more nightmarish :-). You may still have it actually, this
would explain the strong capacitive coupling between IOW and IOR.

Dimiter

0 new messages