6800/6820 Address decoding help...

ard at p850ug1.demon.co.uk ard at p850ug1.demon.co.uk
Sat Mar 7 02:53:56 CST 2009


derschjo at mail.msu.edu wrote:
> So I've given myself yet another project to fill my ever-lessening free 
> time with: to write a Tek 4051 emulator.  I have the ROMs (thanks again, 
> Axel) and I've coded up a nice quick 'n dirty 6800 emulation.  Now I'm 
> working on figuring out how the CPU talks to the hardware... I have at 
> my disposal the service manuals and a disassembly of the aforementioned 
> ROMs.  I also have a physical Tek 4051, but I'm loathe to start poking 
> the PIAs without knowing what I'm doing, given that the screen's 
> electron beam is directly controlled by the software, it's more than 
> possible to burn a nice hole in the phosphor if I screw up :).
> 
> The CPU talks to a set of 6820 PIAs, and from there it's fairly easy to 
> figure out what bits hook up to what devices, given the schematics (and 
> only slightly harder to work out how they need to be manipulated, by 
> reverse-engineering the disassembly) but I'm having a heck of a time 
> working out what addresses the PIAs' inputs & outputs are mapped to in 
> the CPU's address space.

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.

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

-tony



More information about the cctech mailing list