Close

On I/O

A project log for KZ80

A Z80 laptop

Kyle IsomKyle Isom 10/09/2019 at 20:410 Comments

The biggest challenge right now is I/O into the system. I'd eventually like to support

Last night, I realised I could use a handful of PIO chips to do the bulk of the work. The LCD, which is 8 data pins and 4 control pins, could be controlled by a single PIO; the keyboard probably needs to be connected to a small microcontroller to handle strobing the entire keyboard (which is necessary to pick up modifier keys). Serial I/O is done with a separate chip, the SIO/2 that provides a pair of ports. I think the compact flash could be done with a pair of PIO chips, maybe connected to a microcontroller but maybe not. My compact flash is an IDE <-> dual CF interface with an ATA-44 connector, so that'll need some thinking. The CTC would be used for threading as well as a general counter and timer. Tentatively, I'm designing around the following addressing scheme:

 DEVICE ID   CONTROL
D0 D1 D2 D3   A  B  C  D
A7 A6 A5 A4  A3 A2 A1 A0
 1  0  0  0              | SIO/2 (BASE $80)
 0  1  0  0              | DIRECT INTERFACE (KBD+LCD) (BASE $40)
 0  0  1  0              | CTC (BASE $20)
 0  0  0  1              | ATA (BASE $10)

SIO/2
-----
A: ENABLE ON 0
B: 0
C: C/D (CONTROL=0, DATA=1)
D: A/B (PORT A=0, B=1)

SIO A/C: $80
SIO A/D: $81
SIO B/C: $82
SIO B/D: $83

 
DIRECT INTERFACE
----------------
A: ENABLE ON 0
B: KBD/LCD SELECT (KBD=0, LCD=1)
C: C/D (CONTROL=0, DATA=1)
D: A/B (PORT A=0, B=1)

KBD A/C: $40
KBD A/D: $41
KBD B/C: ---
KBD B/D: ---
LCD A/C: $44
LCD A/D: $45
LCD B/C: $46
LCD B/D: $47

CTC
---
A: 0
B: ENABLE
C: CS0
D: CS1

CTC0: $20
CTC1: $21
CTC2: $22
CTC3: $23

I still need to figure out the addressing and interfacing for the IDE/CF drives (as well as figure out what the file system is going to be).

I think the interrupt priority is going to be:

Discussions