Sharp logo

MZ-700 keyboard 

Keyboard ports

The bit definitions of the keyboard ports are as follows:

pin I/O
function name of signal
PA0 - PA3 output
input to keyboard columns
PA4 - PA6
unused / free
PA7 output
reset timer for cursor blink frequency
PB0 - PB7 input
output from keyboard rows bits 0 - 7

Block diagram

See the block diagram of the MZ-700 keyboard:

Block diagram of the 8255 and its peripherals
Block diagram of the 8255 and its peripherals

Port A outputs are connected to the four keyboard columns PA0 - PA3. Port B inputs are connected to the eight keyboard rows. All of the eight row inputs are pulled up to +5 Volts via 10K pull-up resistors. This means, all of the eight row input lines are forced to a logical 1. For further details refer to the software configuration of the 8255 by the monitor 1Z-013A.

Hardware details

8255 and MZ-700 keyboard
Schematic diagram of the 8255 and the MZ-700 keyboard

The four column lines are forced to a logical 0 one at a time by the keyboard search routine and by the hardware IC# AE  ( LS145 ). This chip is a BCD-to-decimal decoder ( BCD = Binary Coded Decimal ). The chip has 4 input lines
P0 - P3 and 10 output lines Q0 - Q9.

Note The four input lines P0 - P3 are called by SHARP A, B, C, and D in the diagrams shown above ( P0 = A, P1 = B, and so on ) and the outputlines Q0 - Q9 are called 0 - 9.

For further details download the datasheet SN74LS154 ( PDF, 53 kb ).

LS145 pinout

Depending on the input value the activated output line ( low active ) will be as follows:

LS145 truth table

input to lineD - A
activated output line

Line D is the most significant line, line A the least significant line. All output lines will be set to a logical 1 if an invalid input is present, for example, input line
D - A = 1110.

Keyboard matrix

keyboard matrix
The keyboard matrix of the MZ-700

The output lines Q0 - Q9 of the chip 74LS145 are physically connected to the keyboard columns 1 - 10.

The associated output line selected by the input value is set to a logical 0 ( low active ). All other lines remain unchanged ( logical 1 ).

After each column line has set to a logical 0 by the keyboard search routine, the input port B is read. If any bit read from the input port B is a logical 0, then a key has been pressed. You can determine which key has been pressed by determining the bit that is a logical 0 and the column line that is active at this time.

The value returned by the keyboard will be $FF if no key was pressed. The hexadecimal values shown in the picture may help to program your own keyboard search routine. The hexadecimal values from $F0 to $F9 at the columns
( port $E000 ) shown in the picture must be used to select a column. The hexadecimal values at the rows
( port $E001 ) shown in the picture will be returned if any key is pressed in that row. The decimal numbers are associated numbers of the keyboard connector.

The value of the upper 4 bits of port A is meaningless except bit PA7, you should set it to a logical 1. If you set it to a logical 0, then the timer for the cursor blink frequency will be reset. When you return to the monitor, the cursor is reactivated. This timer is designed for a frequency of about 1.5 cycles ( Hz ), the duty cycle is 50 %, and the pulse width is about 0.3 seconds. This means, the cursor pulses symmetrically for 0.3 seconds. It is displayed for 0.3 seconds and then pauses for 0.3 seconds.

The bits PA4 - PA6 are unused, no hardware is connected to the physical output lines.

If you want to use these lines for your own purposes, you have to read the contents of the port first and then to select a column by the assembler command OR. Otherwise, if you don't want to use these lines, you can load the value directly by using a simple assembler command LD into that port.

Go to the top of this page Home

last updated August 4, 2002