Use the Spectrum 128 style menu below to nagivate to the various sections detailing the keypad.

Keypad Main Menu Title
View History Of The Keypad
View Appearance Of The Keypad
View Editing Functions Available Via The Keypad
View Method Of Operation
View Communication Details
View Timing Details
View Hardware Details
View Software Details
View Details About Building A Compatible Keypad


Hardware Details

The keypad circuitry is based around a PIC1652 microcontroller that was manufactured by General Instruments. The PIC1652 is an 8-bit microcontroller with RISC-like features and has a 33 single-word instruction set. It supports direct, indirect and relative addressing modes and features 7 special function hardware registers, 2 level deep stack, 12 I/O ports with individual direction control, an 8-bit real-time clock/counter with 8-bit programmable prescalar, power-on reset, power saving sleep mode and security fuse for code protection. It has 384 x 12 words of ROM and 25 x 8 bytes of RAM. It has a maximum operating frequency of 4MHz.

PIC Microcontroller Pin Layout

The PIC microcontroller continually monitors the keypad matrix via lines RB3 - RB7 and RA0 - RA3. Lines RB3 - RB7 select the row to read and the keys on this row will be read in via RA0 - RA3.

The keypad communicates to the Spectrum 128 via RB0 and RB1. Line RB1 is the input from the Spectrum 128 and the combination of resistor R3 and zener diode D1 converts the input voltages of +12V and -12V to +4.7V and -0.7V so that the PIC microcontroller can safely read in the line level. The output line to the Spectrum 128 (RB0) is either at 0V or +5V and this is sufficient for the Spectrum 128 to read the line levels in as logic 1 and logic 0 respectively.

Although +12V is supplied by the Spectrum 128 to power the keypad, this is cut down to 5.1V via zener diode D2. Resistor R4 and capacitor C1 cause a low pulse to line /MCLR at power up thus resetting the PIC microcontroller. Resistor R1 separates the +12V power line from the 5.1V dropped across zener diode D2. Resistor R3 performs a similar function separating the +12V or -12V from the 4.7V or -0.7V dropped across zener diode D1. Resistor R2 limits the current drawn from the output line in case of a short circuit. Inductor L1 and capacitors C2 and C3 form the oscillator that clocks the microcontroller and have values 68µH, 47pF and 47pF respectively. The keypad circuit diagram is shown below.

Compatible Keypad Circuit Diagram

The keypad matrix connects to connectors J1 and J2 and is arranged as four columns by five rows as shown below.

Keypad Matrix Wiring Diagram

The frequency of the Inductor-Capacitor (LC) oscillator circuit is calculated via the equation:

where C is the series capacitance of the capacitors C2 and C3 plus the parallel capacitances of the OSC1 and OSC2 pins of the PIC. These are 4pF and 4.3pF with a part tolerance of 25%. This yields a nominal frequency of 3.422568MHz but when the tolerances are taken into account this can range from 3.057491MHz to 3.888368MHz.


Construction

The keypad is held together by six screws. Inside the keypad is the printed circuit board (P.C.B.), the keypad matrix and the bubble mat which provides the 'spring' feedback of the keys.

Photo Of The Keypad Front Profile Photo Of The Inside Of The Keypad Photo Of The Keypad PCB And Cable Connection
The cable to the P.C.B. consists of four wires coloured blue, white, red and green, as shown above. The plug pins are coloured as per the socket pins in the Spectrum 128 and these are shown in the section entitled Communication Details.

The matrix is constructed of clear plastic which seems to be typical of the keyboard membranes found in non-UK models of the Spectrum, and these tend to be more robust than the UK versions.

Photo Of The Underside Of The Keypad Front Photo Of The Keypad Bubble Mat Photo Of The Keypad Matrix

The P.C.B. inside the keypad measures 38mm wide x 40mm high and is double sided. The PIC microcontroller is soldered directly onto the printed circuit board. The PIC is labelled 'PIC1652-441 KP27 C85SRL GI 8534 Y TAIWAN'.

Photo Of The Front Of The Keypad PCB Photo Of The Back Of The Keypad PCB

The P.C.B. layout is reproduced below. Click on the check boxes to show / hide individual layers.


PCB Layout Substrate Layer
PCB Layout Bottom Layer
PCB Layout Top Layer
PCB Layout Vias Layer
PCB Layout Silkscreen Layer

Bottom Layer

Top Layer

Pads

Silkscreen

PIC microcontrollers contain a security fuse that can be deliberately blown in order to prevent their program from being read out and hence copied. It is likely that this fuse would have been blown in the keypad's PIC microcontroller, although this has not been confirmed.

The keypad schematic diagram and printed circuit board layout was generated using the Protel 99 SE CAD package. From the P.C.B. layout, Gerber and NC Drill files were generated and all of these files are available for download below. A replacement printed circuit board could be made by sending the Gerber and NC Drill files to a P.C.B. manufacturer.

Click here to download the circuit schematic and P.C.B. layout (in Protel 99 SE format) for the compatible keypad.
Click here to download the Gerber and NC Drill files for the compatible keypad P.C.B. design.