The problem is
that the 8255 is fundamnetally broken as designed (well,
I'd expect that from Intel, alas). Any write to the mode control register
clears all outputs to 0's. Which means you can't reverse the direstion of
one of the 8 bit ports without mucking up everything else.
Oh really? I've never heard _that_ before about these parts... Do you know
It is mentioned in the Intel 8255 data sheet.
offhand if that's the case for other brands as
well? I believe I have some
NEC parts around somewhere.
It certainly applies to the National Semiconductor version. I used one in
my first Z80 homebrew, and one of the first programs I wrote once I'd
added it simply configured all ports as outputs, wrote a suitable value
to port A, then jumped back to the start. I then found the lines that
should be high were, in fact, pulsing. Reading the data sheet showed why
(I was re-loading the mode control register, thus clearing the output
ports). Of course it was trivial to correct in this program, but it sure
made life difficult later.
-tony