Strange 8255 behavior

From: Michał Pleban <lists_at_michau.name>
Date: Sun, 10 Jun 2018 01:58:38 +0200
Message-ID: <5B1C69AE.3040701@michau.name>
Hello!

I know this is only tangentially related to Commodore (since it involves
an Intel chip) but I hope someone could have some pointers for me.

I've been banging my head for several hours over Ruud's clone of 8088
card, where the 6525 is substituted with Intel 8255. I'm rewriting the
firmware to work with the 8255 chip. Basically it is an interface to the
6526 sitting on the 6509 processor side which allows to transfer bytes
between these two CPUs.

The transmission happens in two directions, which basically looks like
this from the 8088 side (handshaking omitted for clarity):

1. Set the port to output.
2. Write the command byte(s) for the 6509
3. Set the port to input
4. Wait till 6509 finishes its job
5. Read response(s) from the 6509

With the 6525 everything works fine in this model (changing between
input/output is done using writes to the Data Direction Register). But
with the 8255 the step #3 (accomplished by writing a value to the
Control register) confuses the 6509 so thoroughly that it doesn't even
start processing the command.

When I move the step #3 to be below step #4, things work much much
better, but still the 6509 hangs at some point. Only when I remove this
step completely, everything works and MS-DOS boots, but of course the
8088 cannot now read anything from the 6509 so it waits forever for a
keypress.

Why something like this would happen? The only explanation I can think
of is that when the Control register of the 8255 is written, _something_
happens for a very short while with the I/O port pins, before the new
state is set, and this something is enough to trigger some signal in the
6526 which is connected to the 8255's ports. My first suspicion was that
a pin connected to FLAG changes its value, causing the 6526 to create a
spurious interrupt which sends the 6509 into neverland. But I cannot
reproduce this with an oscilloscope - I can see only one interrupt
pulse, not two. But nevertheless, writing to the Control reegister of
the 8255 must have some momentary effect on its pins, because I cannot
explain this phenomenon in any other way.

It's 2AM now and I am completely of ideas. Does anyone know about what
exacly happens in the 8255 when its Control register is written into?

Regards,
Michau.
Received on 2018-06-10 03:00:04

Archive generated by hypermail 2.2.0.