RS232 - PS/2 Interface

Description

This project is a Microchip PIC microcontroller with an RS232 serial interface on one side and an PS/2 (keyboard or mouse) interface on the other. The PS/2 interface uses bit-banging on a 12F683 device.

Important - All mention of RS232 on this page actually refers to RS232 waveforms operating at 5V TTL levels not +/-12V levels which would destroy the PIC device. An appropriate converter between the two must be used.

The PS/2 interface operates as a host and initialises the keyboard or mouse before going into a never-ending loop of reading the data and sending it to the RS232 interface.

Note: This device does not allow a PS/2 mouse to be used on an computer that only accepts a serial mouse

Pictures

PCB

The circuit is built on stripboard with a DIL packaged IC and conventional through-hole passive components. The PCB is glued into the base of a small box for convenience.

The PIC microcontroller is the only IC and mounted approximately in the centre of the PCB. The RS232 connector is on the right with the PS/2 connector on the left.

PIC Software

The PIC software is written in assembler and this project was the development platform for the PS/2 library functions.

The complete information for this project is available for download. This includes the library functions for the RS232 and PS/2 interfaces as well as the circuit diagram, layout diagram and various C programs. This project is included in the library of PIC code that is available for download.

Circuit Diagram

Circuit Diagram

The circuit diagram is very simple with only the RS232 interface (a connector), PS/2 interface (a connector and 2 pull-up resistors), PIC (IC and decoupling capacitor) and ICSP (socket, 1 diode and 1 resistor).

Circuit Layout

Circuit Layout

This simple PCB layout diagram shows the placement of the components on the stripboard. The view is from the top of the PCB, the same as in the photograph.