Details on keyboard

A project log for nedoPC-85

Started in 2004 as a simple breadboard-friendly computer on Intel 8085 microprocessor...

shaosSHAOS 04/09/2018 at 01:244 Comments

Keyboard is connected similarly to ZX-Spectrum - 8 bits from address bus ( other bits by the way ; ) trough diodes goes to key matrix and come back through data bus (if address space is 0x8000...0x9FFF):

data bus bits ======>
bit 0 from address bus
bit 1 from address busO ;
P ,
bit 2 from address busLANS258/PgUpPgDn
bit 3 from address bus=EE0147AC
bit 4 from address busSTOP
bit 5 from address busQ !
W "
E #
R $
T (
Y )
U ?
I :
bit 6 from address busASDFGHJK
bit 7 from address bus

Scanning is done by reading from memory range 0x8000...0x9FFF and "0" in any address bits 0...7 will be retranslated into data bus if any key in that row is pressed. Recommended way to read from keyboard is reading from 8 address locations - 0x9FFE (bit 0 is zero), 0x9FFD (but 1 is zero), 0x9FFB (bit 2 is zero), 0x9FF7 (bit 3 is zero), 0x9FEF (bit 4 is zero), 0x9FDF (bit 5 is zero), 0x9FBF (bit 6 is zero) and 0x9F7F (bit 7 is zero). If nothing is pressed byte FF will be read. Otherwise proper bit will be reset to indicate which particular key was pressed. For example:

LDA 9F7F ; read 7th row (bit 7 is zero) to A
ANI 80H ; mask 7th bit in response
JZ SPACE ; jump if zero - SPACE pressed 


Yann Guidon / YGDES wrote 04/09/2018 at 06:07 point

Why dedicate such a large memory range ? I thought 256 addresses would be enough...

Add a 74LS138 for extension and this is reduced to 8 addresses :-)

  Are you sure? yes | no

SHAOS wrote 04/09/2018 at 14:08 point

May be I'll add more keys and then it will require 9th zero (+8 keys) and even 10th zero (+16 keys) - then it will take 1K ;)

Also I don't have kilobytes of software to fill all memory, so current memory map is more than sufficient :)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 04/09/2018 at 06:05 point

Nice trick to know :-)

  Are you sure? yes | no

SHAOS wrote 04/09/2018 at 02:29 point

The circuit successfully detects a single keypress and 2 simultaneous keypresses, but starting with 3 it may have a "phantom" 4th keypress wrongly detected if 3rd key is in one row or one column with first two...

  Are you sure? yes | no