Circuito di interfaccia tastiera per microprocessore 8086
Interfaccia hardware: Tastiera PS/2 a 8086
L'8086 non ha un controller tastiera integrato. Un'interfaccia tipica PC/AT-style usa un controller tastiera esterno (8042 / 8742 / 82C50) e un controller di interrupt (8259A).
Componenti del diagramma a blocchi
- Tastiera PS/2 — Invia scan code serialmente (linee clock + dati).
- Controller tastiera (KBC) — microcontrollore 8042/8742
- Riceve il flusso seriale, converte in scan code.
- Gestisce LED tastiera (Num/Caps/Scroll Lock).
- Interfacciato al sistema tramite bus dati a 8 bit (D0–D7) + 2 linee di controllo (RD, WR) + indirizzo (A0) + IRQ1.
- Porta 60h = Dati, Porta 64h = Stato/Comando.
- Controller di interrupt — 8259A PIC
- IRQ1 (tastiera) → richiesta INT a 8086 INTR.
- Cascata se secondo 8259A (AT) per IRQ8–15.
- CPU 8086
- Risponde a INTR, esegue cicli INTA, legge il vettore, salta all'ISR.
- L'ISR legge lo scan code dalla porta KBC 60h.
Connessioni bus
| Segnale | Lato 8086 | KBC (8042) |
|---|---|---|
| Dati | AD0–AD7 (demuxed) | D0–D7 |
| Indirizzo | A0 (tramite latch) | A0 (seleziona Dati vs Stato/Comando) |
| Controllo | IORC, IOWC (da 8288) | RD, WR |
| Interrupt | INTR (tramite 8259A) | IRQ1 (a 8259A) |
Flusso software
- KBC riceve scan code → attiva IRQ1.
- 8259A attiva INTR a 8086.
- 8086 esegue sequenza INTA, ottiene vettore 09h (IRQ1).
- ISR (handler INT 09h) legge Porta 60h → ottiene scan code.
- ISR elabora: imposta flag break/make, gestisce tasti speciali (Ctrl, Alt, Shift), bufferizza ASCII/keycode per BIOS/applicazioni.
- ISR scrive sulla Porta 64h (comando) se necessario (es. imposta LED).
Nota
Nei PC moderni il KBC è integrato in Super I/O (ITE, Nuvoton, ENE) o EC (Embedded Controller). Nei sistemi 8086 si usavano discreti 8042/8259A.