Daryl's Computer Hobby Page
  Home     SBC Circuit Boards     SBC Software     I/O Devices     Windows 65C02 Simulator     Downloads     News, Events, & History  
  FAT16 IDE Interface     65SPI - SPI Controller Chip     PC keyboard interfaces     2-Way IR Communications     Displays     Device Programmers  
  6522 Interface     AVR Interface  


PC Keyboard -> AVR ATTiny26 Interface

This keyboard decoder takes all of the overhead associated with scancode to ASCII conversion and places it in the interface.   This frees the 6502 to handle more important operations.   The simple circuit consists of an 6-pin PS2 keyboard socket, an Atmel ATTiny26 microcontroller, a 14 pin header, and two optional resistors!

Port A is used as an 8-bit data bus.   PB5 is an data ready output that tells the host a key has been pressed.   PB6 is used as a data acknowlege input to tell the AVR the data was taken.

Here's the schematic:
Male

(Plug)
Female 

(Socket)
5-pin DIN (AT/XT): 
1 - Clock
2 - Data
3 - No Connection
4 - Ground
5 - Vcc (+5V)
Male

(Plug)
Female

(Socket)
6-pin Mini-DIN (PS/2):
1 - Data
2 - No Connection
3 - Ground
4 - Vcc (+5V)
5 - Clock
6 - No Connection

  The 14-pin header is designed to plug into one of my SBC-2's 6522 IO ports.   The 8 data pins provide the ASCII codes and the two handshake lines provide the necessary controls.   Check out the support package located in the Downloads section for complete AVR source code and scan-code conversion tables.

All info provided "as-is" and is Copyright 2001.