ard at p850ug1.demon.co.uk wrote:
It sounds like what you need is a 6820 PIA data sheet (a 6821 one would do
as well). This shouldn't be hard to find.
These are actually in Vol. 2 of the service manual, at the back :).
From what I
remember, the PIA occupies 4 bytes of the memory map, selected by
a pair of address
inputs on the PIA chip called RS0 and RS1 (Register Select).
These are normally linked to CPU address lines A0 and A1 (and I think that's
the case in the 4051) so each PIA takes up 4 contiguous bytes.
Each PIA has 2 ports (Port A and Port B), each consisting of 8 data lines
(which can be inputs or outputs) and 2 control lines (CA1, CA2, CB1, CB2). The
data sheet will show you how you read/write the port lines, select their
direction (in or out), control/read the control lines, etc.
There seem to be some useful tables at the start of the second volume of the
service manual saying what each of the port lines is linked to. Given that,
<slaps forehead> I didn't even see that section of the service
manual... just jumped straight to the schematics. More fool me... this
is quite helpful.
and the schematics it should be very easy to work out
what address does what.
I've just started looking at the scheamtics and I can't see anything difficult
here.
I think I've got most of it worked out now... just not sure how to work
out where the control lines (CA1/2, CB1/2) fit into this whole thing.
Thanks...
Josh
-tony