user's manual · 2020-01-13 · ppi 8255-1. this keyboard interface is non-encode type. i.e .....
TRANSCRIPT
If
Users Manual FOR
IJ
ET -KB KEYBOARD INTERFACE
t
~
middotr
4I
ampw17~ C-92 Sector - 63 Noida UP 201309 India
Ph0120-431857208860106750
wwwexceltechnologiesonlinein
Email exceltechnologiespiplanigmailcom
I
KEYBOARD INTERFACE
KEYBOARD INTERFACING MODULE (ET-KB)
The keyboard interfacing Module (ET-KB) vill demonstrate to the students as to how a keyboard can be connected to a microprocessor based system through 10 lines The other techniques which can be used for Interfacing the keyboard module are also discussed in brief
General Description
The keyboard and displays are required in the instruments for the man to machine communication The arious types of the switches used in instruments are On IOff Switch PushRelease Switches Band Switches Keyboard Switches etc In microprocessor based equipments normally open type of the switches are used These switches give the change over contact as soon as they are pressed The bouncing time of the key ie unstable state of contact is maximum of 10 ms~c Pressing of the key is monitored by the keyboard controlJerpart and necessary action is taken
-Keyboard can be easily interfaced to microprocessor through programmable 110 lines (the 8255 or 8155) or by 8279 (the Keyboard Display encoder and decoder) There are tVO ways of connecting the keys to lIO lines In the first technique each of the key switches can be attached separately to a bit of an input port This technique is beneficial if the no
key switches are less than eight If the number of key switches are more than eight more number of input lines and multi-byte operation are required The number of input lines can be easily reduced using the second technique where the keys are organized matrix format Each of the keys is connected between a particular roV and a column
While connecting the keyboard through 8279 the four scan lines SLO-SL3 are decoded and used with retum lines RLO-RL 7 into a matrix form any of the keys is pressed an interrupt is generated which is given to microprocessor to service the keyboard routine
PAO PAl PA2 PA3 PA4 PAS PA6 PA7
PCO
08 PCI
PC2
00
gt1gt02
1gt03 04
1gt1gt1gt06
1gt1gt gt gt gt Y gt gt gt gt
lOgtgtgty OF
ampud7~ Page 1
--
KEYBOARD INTERFACE
The diagram above shOvs a keyboard of 20 keys connected in the matrix of 8 x 3 through PPI 8255-1 This keyboard interface is non-encode type ie hardware recognizes the key closure and encode it The row of the matrix is connected through Port C (bit 012) and columns are returned to Port A (bit 0-7) All the 8-bits of the input Port A are pulled down by 5K6 resistance to avoid any noise interference When no key is pressed the microprocessor reads the input port as 00 The keyboard scanning starts by giving high signal at PCO and low at PC 1 and PC2 If any of the key connected to PCO through Port A is pressed the corresponding column bit will be also made to high and will be detected by the software Similarly the rest of the keys are scanned in the same fashion
LAYOUT OF KEYBOARD INTERFACING MODULE
KEYBOARD MODULE (ET-KB)
0GJcJQ0 200000
00[2]00 2600000 25
EXCEL TECHNOLOGIES
LIST QFEXPER1MENTS
1 Write program to display a code of the key pressed in the data field The code remain5 in the display till the activation of tbe next key The code assigned to each key I~
given in the circuit diagram
2 Write a program to jump at particular location to execute another program as soon as a particular key is pressed
3 Write a program to perform DecimalHex arithmetic as operated in the calculatorcomputer
Experiment 1
ampuee7~ Page 2
KEYBOARD INTERFACE
The 15 of the three experiments listed above is solved here The program given below displays the code of the key which is pressed on the keyboard pad The code is displayed in the data field and remains unchanged till the next key is pressed
SETUP FOR THE EXPERIMENT
This explanation as well as the explanation of the Program under the heading Description of the Program is for 8085 LED Kit Howenr if you are interfacing the Keyboard Module to other Kits then also refer to the specific instruction before the program listing for that particular Kit also
1) Connect the ET -KB interfacing module to the 8255-1 port connector of the kit using 26-pin flat FRC cable The pin No1 of the connector on the module as vell as the kit is marked Please ensure that the pin no 1 of the connector js~connected to Din no I of the module
2) Connect the +5V to the Module through the connector provided
3) Enter the program given below from the memory location mentioned in the program
4) Execute the Program from starting address Press any key on the Module Its corresponding code will be displayed in the data field of the LED DisplayiLCD Display of the Kit
DESCRIPTIONS OF THE PROGRAM
The port of 8255-1 ie PPI-I is initialized to make port A as Input port and port C as output port The three Rows of the keys are scanned one by one and process is repeated till the key is pressed in the routine code and F code (Final Code) The information of code is then displayed and the m)nitor jumps back again to see if any other key is pressed
The codes will be displayed on the LEDLCD Display of kit as per the following table
KEY PRESSED -shy 0
DISPLAY KEY PRESSED DISPLAY I ~-~~~ ~ ~ - ~
A A0 1 I B B 2 2 C C
~ ----------- shy4
~ ) D D
~--~ t- ~ -~-~- shy
E i E4 5 5 F F
ampuee7~ Page 3
I
KEYBOARD INTERFACE
NOTE - Listing of program for various models of Microprocessor and Micro controller kits is given below piease select the model of kit being used before entering the program into the kit
I~ISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LED DISPLAY
Connect the Jl of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the Jl at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
~ADDRESS Or-CODE MNEMONICS Remarkst
2000 90 MVI A 90 Initialize 8255-1
2002 -i031)3 ---1 lOUT OJ Port ~-Input amp f---~~o~- -r~6~~-__- 1 MYI B ~-middot-fr~~~~~~~~u~~al key co~_I NIT
2006 I OE 01 I MYI C 01 -1 P~t Bll-pattem In regISter C LSB
f---20~-- 9 +SCmiddotAN -~M-OY Ac-iwJlhonel1 position
2009 D3 02 OUT 02
200B I DB 00 IN 00 [ Read Port A
Encode the 8-bit word into ~I~DJ82~ CALL 2038 8- bits
CPI08
I
Any key closure 2010 _F_E_0_8---t-----t-- shy
2012 I FA 24 20 JM 2024~ If Yes Go to display it
I If No Move partial result in 2015 78 MOV AB L __________________--shy I Reg A
1------- shy
amprut7~ Page 4
-
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE
KEYBOARD INTERFACING MODULE (ET-KB)
The keyboard interfacing Module (ET-KB) vill demonstrate to the students as to how a keyboard can be connected to a microprocessor based system through 10 lines The other techniques which can be used for Interfacing the keyboard module are also discussed in brief
General Description
The keyboard and displays are required in the instruments for the man to machine communication The arious types of the switches used in instruments are On IOff Switch PushRelease Switches Band Switches Keyboard Switches etc In microprocessor based equipments normally open type of the switches are used These switches give the change over contact as soon as they are pressed The bouncing time of the key ie unstable state of contact is maximum of 10 ms~c Pressing of the key is monitored by the keyboard controlJerpart and necessary action is taken
-Keyboard can be easily interfaced to microprocessor through programmable 110 lines (the 8255 or 8155) or by 8279 (the Keyboard Display encoder and decoder) There are tVO ways of connecting the keys to lIO lines In the first technique each of the key switches can be attached separately to a bit of an input port This technique is beneficial if the no
key switches are less than eight If the number of key switches are more than eight more number of input lines and multi-byte operation are required The number of input lines can be easily reduced using the second technique where the keys are organized matrix format Each of the keys is connected between a particular roV and a column
While connecting the keyboard through 8279 the four scan lines SLO-SL3 are decoded and used with retum lines RLO-RL 7 into a matrix form any of the keys is pressed an interrupt is generated which is given to microprocessor to service the keyboard routine
PAO PAl PA2 PA3 PA4 PAS PA6 PA7
PCO
08 PCI
PC2
00
gt1gt02
1gt03 04
1gt1gt1gt06
1gt1gt gt gt gt Y gt gt gt gt
lOgtgtgty OF
ampud7~ Page 1
--
KEYBOARD INTERFACE
The diagram above shOvs a keyboard of 20 keys connected in the matrix of 8 x 3 through PPI 8255-1 This keyboard interface is non-encode type ie hardware recognizes the key closure and encode it The row of the matrix is connected through Port C (bit 012) and columns are returned to Port A (bit 0-7) All the 8-bits of the input Port A are pulled down by 5K6 resistance to avoid any noise interference When no key is pressed the microprocessor reads the input port as 00 The keyboard scanning starts by giving high signal at PCO and low at PC 1 and PC2 If any of the key connected to PCO through Port A is pressed the corresponding column bit will be also made to high and will be detected by the software Similarly the rest of the keys are scanned in the same fashion
LAYOUT OF KEYBOARD INTERFACING MODULE
KEYBOARD MODULE (ET-KB)
0GJcJQ0 200000
00[2]00 2600000 25
EXCEL TECHNOLOGIES
LIST QFEXPER1MENTS
1 Write program to display a code of the key pressed in the data field The code remain5 in the display till the activation of tbe next key The code assigned to each key I~
given in the circuit diagram
2 Write a program to jump at particular location to execute another program as soon as a particular key is pressed
3 Write a program to perform DecimalHex arithmetic as operated in the calculatorcomputer
Experiment 1
ampuee7~ Page 2
KEYBOARD INTERFACE
The 15 of the three experiments listed above is solved here The program given below displays the code of the key which is pressed on the keyboard pad The code is displayed in the data field and remains unchanged till the next key is pressed
SETUP FOR THE EXPERIMENT
This explanation as well as the explanation of the Program under the heading Description of the Program is for 8085 LED Kit Howenr if you are interfacing the Keyboard Module to other Kits then also refer to the specific instruction before the program listing for that particular Kit also
1) Connect the ET -KB interfacing module to the 8255-1 port connector of the kit using 26-pin flat FRC cable The pin No1 of the connector on the module as vell as the kit is marked Please ensure that the pin no 1 of the connector js~connected to Din no I of the module
2) Connect the +5V to the Module through the connector provided
3) Enter the program given below from the memory location mentioned in the program
4) Execute the Program from starting address Press any key on the Module Its corresponding code will be displayed in the data field of the LED DisplayiLCD Display of the Kit
DESCRIPTIONS OF THE PROGRAM
The port of 8255-1 ie PPI-I is initialized to make port A as Input port and port C as output port The three Rows of the keys are scanned one by one and process is repeated till the key is pressed in the routine code and F code (Final Code) The information of code is then displayed and the m)nitor jumps back again to see if any other key is pressed
The codes will be displayed on the LEDLCD Display of kit as per the following table
KEY PRESSED -shy 0
DISPLAY KEY PRESSED DISPLAY I ~-~~~ ~ ~ - ~
A A0 1 I B B 2 2 C C
~ ----------- shy4
~ ) D D
~--~ t- ~ -~-~- shy
E i E4 5 5 F F
ampuee7~ Page 3
I
KEYBOARD INTERFACE
NOTE - Listing of program for various models of Microprocessor and Micro controller kits is given below piease select the model of kit being used before entering the program into the kit
I~ISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LED DISPLAY
Connect the Jl of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the Jl at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
~ADDRESS Or-CODE MNEMONICS Remarkst
2000 90 MVI A 90 Initialize 8255-1
2002 -i031)3 ---1 lOUT OJ Port ~-Input amp f---~~o~- -r~6~~-__- 1 MYI B ~-middot-fr~~~~~~~~u~~al key co~_I NIT
2006 I OE 01 I MYI C 01 -1 P~t Bll-pattem In regISter C LSB
f---20~-- 9 +SCmiddotAN -~M-OY Ac-iwJlhonel1 position
2009 D3 02 OUT 02
200B I DB 00 IN 00 [ Read Port A
Encode the 8-bit word into ~I~DJ82~ CALL 2038 8- bits
CPI08
I
Any key closure 2010 _F_E_0_8---t-----t-- shy
2012 I FA 24 20 JM 2024~ If Yes Go to display it
I If No Move partial result in 2015 78 MOV AB L __________________--shy I Reg A
1------- shy
amprut7~ Page 4
-
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
--
KEYBOARD INTERFACE
The diagram above shOvs a keyboard of 20 keys connected in the matrix of 8 x 3 through PPI 8255-1 This keyboard interface is non-encode type ie hardware recognizes the key closure and encode it The row of the matrix is connected through Port C (bit 012) and columns are returned to Port A (bit 0-7) All the 8-bits of the input Port A are pulled down by 5K6 resistance to avoid any noise interference When no key is pressed the microprocessor reads the input port as 00 The keyboard scanning starts by giving high signal at PCO and low at PC 1 and PC2 If any of the key connected to PCO through Port A is pressed the corresponding column bit will be also made to high and will be detected by the software Similarly the rest of the keys are scanned in the same fashion
LAYOUT OF KEYBOARD INTERFACING MODULE
KEYBOARD MODULE (ET-KB)
0GJcJQ0 200000
00[2]00 2600000 25
EXCEL TECHNOLOGIES
LIST QFEXPER1MENTS
1 Write program to display a code of the key pressed in the data field The code remain5 in the display till the activation of tbe next key The code assigned to each key I~
given in the circuit diagram
2 Write a program to jump at particular location to execute another program as soon as a particular key is pressed
3 Write a program to perform DecimalHex arithmetic as operated in the calculatorcomputer
Experiment 1
ampuee7~ Page 2
KEYBOARD INTERFACE
The 15 of the three experiments listed above is solved here The program given below displays the code of the key which is pressed on the keyboard pad The code is displayed in the data field and remains unchanged till the next key is pressed
SETUP FOR THE EXPERIMENT
This explanation as well as the explanation of the Program under the heading Description of the Program is for 8085 LED Kit Howenr if you are interfacing the Keyboard Module to other Kits then also refer to the specific instruction before the program listing for that particular Kit also
1) Connect the ET -KB interfacing module to the 8255-1 port connector of the kit using 26-pin flat FRC cable The pin No1 of the connector on the module as vell as the kit is marked Please ensure that the pin no 1 of the connector js~connected to Din no I of the module
2) Connect the +5V to the Module through the connector provided
3) Enter the program given below from the memory location mentioned in the program
4) Execute the Program from starting address Press any key on the Module Its corresponding code will be displayed in the data field of the LED DisplayiLCD Display of the Kit
DESCRIPTIONS OF THE PROGRAM
The port of 8255-1 ie PPI-I is initialized to make port A as Input port and port C as output port The three Rows of the keys are scanned one by one and process is repeated till the key is pressed in the routine code and F code (Final Code) The information of code is then displayed and the m)nitor jumps back again to see if any other key is pressed
The codes will be displayed on the LEDLCD Display of kit as per the following table
KEY PRESSED -shy 0
DISPLAY KEY PRESSED DISPLAY I ~-~~~ ~ ~ - ~
A A0 1 I B B 2 2 C C
~ ----------- shy4
~ ) D D
~--~ t- ~ -~-~- shy
E i E4 5 5 F F
ampuee7~ Page 3
I
KEYBOARD INTERFACE
NOTE - Listing of program for various models of Microprocessor and Micro controller kits is given below piease select the model of kit being used before entering the program into the kit
I~ISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LED DISPLAY
Connect the Jl of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the Jl at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
~ADDRESS Or-CODE MNEMONICS Remarkst
2000 90 MVI A 90 Initialize 8255-1
2002 -i031)3 ---1 lOUT OJ Port ~-Input amp f---~~o~- -r~6~~-__- 1 MYI B ~-middot-fr~~~~~~~~u~~al key co~_I NIT
2006 I OE 01 I MYI C 01 -1 P~t Bll-pattem In regISter C LSB
f---20~-- 9 +SCmiddotAN -~M-OY Ac-iwJlhonel1 position
2009 D3 02 OUT 02
200B I DB 00 IN 00 [ Read Port A
Encode the 8-bit word into ~I~DJ82~ CALL 2038 8- bits
CPI08
I
Any key closure 2010 _F_E_0_8---t-----t-- shy
2012 I FA 24 20 JM 2024~ If Yes Go to display it
I If No Move partial result in 2015 78 MOV AB L __________________--shy I Reg A
1------- shy
amprut7~ Page 4
-
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE
The 15 of the three experiments listed above is solved here The program given below displays the code of the key which is pressed on the keyboard pad The code is displayed in the data field and remains unchanged till the next key is pressed
SETUP FOR THE EXPERIMENT
This explanation as well as the explanation of the Program under the heading Description of the Program is for 8085 LED Kit Howenr if you are interfacing the Keyboard Module to other Kits then also refer to the specific instruction before the program listing for that particular Kit also
1) Connect the ET -KB interfacing module to the 8255-1 port connector of the kit using 26-pin flat FRC cable The pin No1 of the connector on the module as vell as the kit is marked Please ensure that the pin no 1 of the connector js~connected to Din no I of the module
2) Connect the +5V to the Module through the connector provided
3) Enter the program given below from the memory location mentioned in the program
4) Execute the Program from starting address Press any key on the Module Its corresponding code will be displayed in the data field of the LED DisplayiLCD Display of the Kit
DESCRIPTIONS OF THE PROGRAM
The port of 8255-1 ie PPI-I is initialized to make port A as Input port and port C as output port The three Rows of the keys are scanned one by one and process is repeated till the key is pressed in the routine code and F code (Final Code) The information of code is then displayed and the m)nitor jumps back again to see if any other key is pressed
The codes will be displayed on the LEDLCD Display of kit as per the following table
KEY PRESSED -shy 0
DISPLAY KEY PRESSED DISPLAY I ~-~~~ ~ ~ - ~
A A0 1 I B B 2 2 C C
~ ----------- shy4
~ ) D D
~--~ t- ~ -~-~- shy
E i E4 5 5 F F
ampuee7~ Page 3
I
KEYBOARD INTERFACE
NOTE - Listing of program for various models of Microprocessor and Micro controller kits is given below piease select the model of kit being used before entering the program into the kit
I~ISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LED DISPLAY
Connect the Jl of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the Jl at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
~ADDRESS Or-CODE MNEMONICS Remarkst
2000 90 MVI A 90 Initialize 8255-1
2002 -i031)3 ---1 lOUT OJ Port ~-Input amp f---~~o~- -r~6~~-__- 1 MYI B ~-middot-fr~~~~~~~~u~~al key co~_I NIT
2006 I OE 01 I MYI C 01 -1 P~t Bll-pattem In regISter C LSB
f---20~-- 9 +SCmiddotAN -~M-OY Ac-iwJlhonel1 position
2009 D3 02 OUT 02
200B I DB 00 IN 00 [ Read Port A
Encode the 8-bit word into ~I~DJ82~ CALL 2038 8- bits
CPI08
I
Any key closure 2010 _F_E_0_8---t-----t-- shy
2012 I FA 24 20 JM 2024~ If Yes Go to display it
I If No Move partial result in 2015 78 MOV AB L __________________--shy I Reg A
1------- shy
amprut7~ Page 4
-
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE
NOTE - Listing of program for various models of Microprocessor and Micro controller kits is given below piease select the model of kit being used before entering the program into the kit
I~ISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LED DISPLAY
Connect the Jl of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the Jl at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
~ADDRESS Or-CODE MNEMONICS Remarkst
2000 90 MVI A 90 Initialize 8255-1
2002 -i031)3 ---1 lOUT OJ Port ~-Input amp f---~~o~- -r~6~~-__- 1 MYI B ~-middot-fr~~~~~~~~u~~al key co~_I NIT
2006 I OE 01 I MYI C 01 -1 P~t Bll-pattem In regISter C LSB
f---20~-- 9 +SCmiddotAN -~M-OY Ac-iwJlhonel1 position
2009 D3 02 OUT 02
200B I DB 00 IN 00 [ Read Port A
Encode the 8-bit word into ~I~DJ82~ CALL 2038 8- bits
CPI08
I
Any key closure 2010 _F_E_0_8---t-----t-- shy
2012 I FA 24 20 JM 2024~ If Yes Go to display it
I If No Move partial result in 2015 78 MOV AB L __________________--shy I Reg A
1------- shy
amprut7~ Page 4
-
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE ~~~ ~~~ -- shy ~~~ ~ ~~~-~~
2016 08 ADl08 the Port C Code
2018 47 MOYRA middotIn the partial result ~ ~~~_~~~ ~ i_~~~~ ~ ~ ~ ~~~_~~~~
~~~- ---------- shy
2019 FE 18 CPI 18 Does Port C Code Become 11
201B F2 04 20 JP 2004 1f Yes Go start scanning
from Rov 0 ~-
MOY AC
j RAL If No Moe the Bit- pattern to scan the next line shy
i--~- _ - shy ~
MOY A ---------shy ---- shy -
2021 C3 0820 JMP 2008 Continue scanning
2024 BO DISP ORAB Logical OR Port A Code with Port C Colt1e
2025 32 F6 27 STA 27F6 Let it be current data
2028 00 MYI A 00 Arg No dot ------shy
I isplay it in data field 202A 1 CD FA 06 CALL 06FA ~~~- ~~~----- shy
JMP 2004 Go to scan the KB again ~ ~ ~~~-~~~ ~ ~
2030 ---------shy
2032 C3 JMP 202D - f- ~~~ -~~~--~ ------- shy ------------ shy
2035 78 MOY A B
2036 I 81 ~~~_~~~ ~~~~L_ ~~~~~~
FUNCTION TCoDE This routine encodes 8 bit data to J bits I
INPUT A 8 bit decoded data OUTPUT A 3 bits encoded data
--------shy ~ ~~~~
2038 B7 CODE ORA A I I 3039 C2 3F 20 JNZ 203F
----- _----shy
203C 3E 08 MYI A 08 -----shy
203pound C9 RET
203F 1600 CODE-l MY D 00 I I
ampud7~ Page 5
lta
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
--
------ --
---
KEYBOARD INTERFACE
Let LSB in Ago to carry CODE-2 RRCOF2041
Go to return if this bitmiddotJC 2049 DA 49 20 2042 vas one
Increment Counter JNRO142045 ---shy
Check the next bit 1-------- shy
JMP 204141 202046
COOE-3 MOV AD2049
RET ----shy
C9204A
LISTING OF THE PROGRAM FOR KEYBOARD MODlJLE (ET-KB)
TO INTERFACE WITH 8085 KIT HAVING LCD DISPLAY
Connect the] 1 of the Kit to the l10dule through 26 Pin PRe Cable Ensure that the pin-l of the ] 1 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Execute the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
ADDRESsect_ OP-CODE MNEMONIcsl Remarks 2000 3pound 90 MYI A 90 Initialize 8255-1
Port A- Input amp 2002 03 03 OUT 03 Port C - Output
2004 0600 INIT MYI B 00 ~nitialize the final key code _________----+_m_~e~ B
bullbull ___ -_ ~ ~o
Read Port A
Encode the 8-bit word into 8- bits
Any key closure
2006 OE 01 MYI C 01
OUT 02
200B DB 00
CD 39 20 CALL 2038
2010 FE a8 CPI08
ampud7~ Page 6
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
------ ----
-----------
---- ----- -
---- -----
----
------
---- --
----
------
--- ----
---- ---
KEYBOARD INTERFACE --- ---_ _shy
JM 2024 2420 If Yes Go to display it
If No Move partial result in 2012
MOV AB782015 Reg A
iC608 ADI08 Increment the Port C Code2016
1- 2018 MOVEA47 In the partial result r------ shy
Does Port C Code BecomeFE 18 CPI182019
11 c--shy --r--shy
If Yes Go start scanningF2 04 20 JP 2004201B
from Row O 1--------------- shy
79 I MOV AC20lE
)1 No Move the Bit- pattern RALmiddot201
to scan the next line
MOV A
2021 C3 0820 JMP 2008 Continue scanning -- shy
Logical OR Port A CodeBO OISP IORAB2024 with Port C Code
2025 - 32 STA 27F6 Let it be current data
2028 Arg - No dot
2029
F5 PUSH PSW
PUSHBC5 _---- shy------------ shy 1
CALL OF4D Display it in data field iCD202A 1---shy
POPB
POP PSW
F5
Cl2020
PUSH PSW [--shy
PUSHB
CD 33 11 CALL 1133
CI bull i POP B
2035 FI POP PSW -~
0420 JMP 2004 JUMP INIT2036 --~------
r ---middot--~-middot-~M r ---- ---~-----
I~J2NCTIQ~_1 C()~This r_outine encod~~ 8 bit data to 3 bitsJ INPUT _ [A I 8 bit decoded data__________-J
ampud7~ Page 7
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
------------1
I
KEYBOARD INTERFACE ~rmiddotmiddot---- --
----~---
P)UTPlTT-u--r-~-A----1 3 bits encoded data I
I MVI A 08
2039 B7~ ~CODE ORA A
303A C2 40 20 i JNZ
2030 3E 08
203F I C9 1 IRET[ ~_~6 00 _-J-_~-O~D~E--I----j-M-Y-I-D-O-O--+---shy
Let LSB in Ago to carry COOE-2 I RRC -gt
Go to return if this bitJC 204A 2043 IDA4A 20 was one
~n~1 Increment Counter JNR 02046 I 14 ~--------- __j----- -------~--+-
Check the next bit JMP 2042 2047 C3 42 20
r- 204A _ 7 A -- CODS] MOY A D
204B 1 C9 I ~ RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LED DISPLAY
FOR ET-8086 Connect the J3 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J3 at the Kit end is connected to the pin-l of the I10dule connector Enter the program from address 00000200 Press any Key on the kcyboard and observe that its code is displayed on the Kit Display shy
FOR ET-8086All Connect the J 1 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J I at the Kit end is coimected to the pin-l of the Module connector Enter the prog-ram from address 00000200 Press any Kcy on the keyboard and observe that its code is displayed on the Kit Display
_= _~I_ b~~_iIill Mlm_~ -r ~I n
ampCd7~ Page 8
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
---
--
__
---- -------------- -----
l
KEYBOARD INTERFACE
I ADDRESS _t-_QECODJ~-u_luLAIEL IUMNEMONICSj 00000400 BA FE FF KBO MOY OX FFFE i
403 BO 90 MOY AL 90 -----------t__ -j------- ----I-----~----j
405 EE OUT AL OX 406 B700 INlT MOY BH 00
r--- --- ----- shy408 B301 MOY BL 01
l_~9_ 88 08 SCAN MOY AL BL 40C BA FC FF MOY OX FFFC --------l--- ------ -------
REMARKS _~ Initializ~ the 8255~ I Port A - Input amp Port C - Output Initialize the final key code in ReQ BH
~
Put Bit--Pattern in Register C with one LSB position f1()ve_ the P~t~~rn T~or~ __
I- shy ___ 40F EE ___ _____+--=O----=U----=T----=A=L----=O=-X----_l_____________----I
410 i BA F8 FF MOV DX FFF8 R d P A 413 EC IN AL OX ea ort ~--- --------~
414 pound82700 CALL 043E Eb~code the 8-bit word into 8 ItS
1--------- --- -- --- ---- ----------+----------------------1 417 3( 08 CMP AL 08 ______+_
419 78 10 IS 042B--- _--_shy
41 B 80 C7 08 i ADD BH 08 I-------------+--------- -------- ----~--__+
41 E 80 FF 18 CMP BH 13 c------- ----- shy
E3 JNS 0406
423 8808 MOV AL BL -- ------ --------4---------1
___ 425 DO QQ_ ~u____ IRCL ALO
AnyTey closure-L________~
Yes - Go to displav it -Increment the PC cod partial result L=~~=---_____---I
7~es Port C code become
~~o~~~ ~~art scanning
If No Moe the bit pattern --shyspoundal~tl~e_n~~_Uine __
427 88C3 I 429 EB DF
I 42B 08 F8 DISP 1-------+---- shy
420 B4 00 42F 50
1--------- shy430 BO 00 _
f 432 - 50 ~__4)Ju LBO 01 ____ 1 I435 50 I------~-
436 50 ---------
437 9A 10 OB 00 FF
43C EB C8
j- ------4-3E-shy 08 CO CODE
r----- shy 440 - - 7503 _c____ rshy -shy -
1---__4_4_2+_BO 08 444 C3
ampud~
M_O_Y__B_L~_A_L_+--------------~ JMP 040A
OR AL BH
MOY AH 00 PUSH AX shyMOY AL 00 PUSH AX MOV AL 0 I PUSH AX PUSH AX CALL OOFFOBEO
IMP 0406
OR A AC AC
JNZ 0445 MOV AC 08 RET
Continue Scanning
Or the PA code with PC code
Display code in data tield
bull shy
---------------- shy~~ ~o scan the keyboard a~alll
Page 9
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
-----------
------
KEYBOARD INTERFACE -
445 B500 CODE 1 MOY CHOO 447 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry
I ----- shy
r------ --shy
449
44B 44D 44F
7204
~~--LmiddotODEJ JC 044F
INC CH JMP 0447 MOY ALCH
Go to return jf this bit was one Increment counter Check the next bit
45] C3 I RET
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 80868088 KIT HAVING LCD DISPLAY
FOR - ET-8086LCD Connect the 12 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin- of the J2 at the Kit end is connected to the pin- of the Module connector Enter the program from address 10000100 Execute the Program from address 10000200 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
FOR - ET -8OB6 -AD-LCD
Connect the J I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J1 at the Kit end is connected to the pin- of the Module connector Enter the program from address 1OOOO 00 Execute the Program iiom address 10000200 Press any Key on the keyboard and observe that its code is displaved on the Kit Display
--ADDRESS OPCODEmiddot LABEL -1 MNEMONICS REMARKS 10000200 BA 0788 KBD I MOY Ox 8807 Initialize the 8255-1
---C-o
Port A - Input ampBO 90 MOY AL 90203 shy ----------- --------------------
EE I Port C - Output
206 OUT DXAL205 MOYBHOOB700 Initialize the final key code INn
iB-eg BH 208 MOY BL 01 Put Bit-Pattern in Register C
___________________ _ with one LSB Qosition B301 I
1---shyMOY AL BL Move the Pattern To Port C20A 8808 I SCAN
I MOY OX 8805 OUT OX AL
i______ __ 20C 1 BA 0588 + ~---~~~ ~~ 0188shy MOY OX 8801
Read Port - AI IN AL DXI 213 I EC
ampud7~e4 Page 10
I
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE - --- ____- __
----- shy ~-------- --- -shy -- shy --~------
214 E8 27 00 CALL 023E Encode the 8-bit word into 8 bits
217 3C 08 CMP AL 08 Any key closure 219 78 10
~-
JS 022B Yes - Go to display it Increment the PC code in the
21B 80 C7 08 ADD BH 08 pal1ial result - shy
21 E I 80 FF 18 CMP BH 13 I Does Port C code become
18 shy
221 79 E3 JNS 0206 ] f Yes Go st3l1 scanning from Rovv O
223 88 D8 MOY AL BL If No Move the bit pattern to 225 DODO RCL AL 01 scan the next line
rmiddot-----~---- ------shy ~----------
MOYBL AL227 88 C3 -------22-9- -_ ---~-
____-shy-~------- - shy
EBDF JMP 020A Continue Scanning -- shy08 F8 DISP ORAL BH I
Or the P A code with PC I code
22D B400 MOY AH 00 22F - CDAC INTAC --------shy ---- shy -- shy --shy
231 8804 MOY [SI]AL 8B 14 MOY DX[SI] _J)
Display code in data field 235 B002 MOY AL02 237 CDAE INT AE
- --shy ---_--_ -----~--- I ------_ ------shy - shy239 i CD AB INTAB
-shy --shy I 23B 90 NOP
- shy 23C IEB C8 JMP 0206 Go to scan the keyboard agalJ1
__ _23E 08 CO C9DE OR A AL AL bull 240l25-g~- ___c-____~z 0245 ___
I242 I BO 08 i MOY AL 08 Ir shy244 I C3 I RET I
245 B500 CODE MOY CH 00 ---- shy
247 DO C8 CODE 2 ROR AL 01 Let LSB in AL go to carry ~--shy 1shy
Go to return if this bit was 249 I T2 04 JB 024F
one
24~_ FEC5 INC CH Increment counter 240 EBF8 JMP 0247 Check the nex t bitshy
-shy
~8 E8 _ I
24F CODE 3 MOY ALCH I ------shy251 C3 RET -
- shy
i
I
Page 11 ampud7~
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE
PROGRAM FOR KEYBOARD INTERFACE WITH ET-8031 AD LED BASED MICROCONTROLLER KIT
Connect the J4 of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin-l of the J4 at the Kit end is connected to the pin-l of the Module connector Enter the program from address 2000 Press any Key on the keyboard and observe that its code is displayed on the Kit Display
f ADDRE ICODES li I3EL shy
MNEMONICS COMMENTS SS 2000 I 90 FF 03 START MOY DPTR FF03H use 8255-1
2003 7490 MOY A 90H shy _--_shy
2005 FO MOYX DPTR A port A ip C alp
2006 75 81 65 LOOP6 MOY SP 65H
2009 902070 IMOY DPTR 2070H 200C 7B 05 MOY R3 05H -_ ---------1 MOY-A FYi=i-middot_middot---- r-shy
200E 74 FF --_
2010 FO LOOP MOYX raJDPTR A --~
2011 A3 INC DPTR
2012 DB FC DJNZ R3 LOOP I clear displav address area --~----------- ~---
2014 CO 83 PUSH DPH _
2016 CO 82 PUSH DPL save dptr 7A 01
_
-MOY R2 OIH _shy
2018 20lA
I ~~ ~~ 4FshyMOY RO 001-1
--lt-------shy -- - _shy20lC LOOP4 LCALL SCAN scan keys and read status 20lF 13 LOOP3 RRC A
f-
2020 40lC JC LOOP2 if keys is pressed go to loop2
2022 08 INC RO
2023 D9FA DJNZ R I LOOP3 recognize particular key
2025 EA MOYA R2
2026 ~- RL A f---shy _
2027 FA MOY R2 A r--~ --------c-- --- shy -----shy -_bull___- - --- shy --_
2028 BA 04 FI CJNE R2 for next line to scan 04HLOOP4
2028 7800 MOY RO OOH
202D 902074 MOY DPTR 20741-1 for graphical character ------ shy
2030 7491- MOY A9FH
2032 FO MOYX DPTR A
I
- - 2033 12204F LCALL SCAN I scan graphical keys
i 2036 13 LOOPS RRC A -
2037 4005 JC LOOP2 if kev is pressed go to loop2 2039 08 INC RO
i 203A D9FA DJNZ R I LOOPS recognize particular key
203C 80 C8 SJMP LOOP6
i203E DO 82 I LOOP2 POP DPL
ampud7~ Page 12
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
KEYBOARD INTERFACE ------shy I get d(Jtr 2040 DO 83 POP DPH
--shy -- shy
2042 E8 MOV A RO To43
-------- shy ------------ shy -shy ~~-- ------------ shy1207 E2 LC ALL GETCODE find 7-segment code
2046 FO MOVX~DPTR A
U~~_---~~~ ~~ ~ - shy -shy
- MOVDPTR 20701--1shy-----~~
-_ shy
LCALL DISPLA Y displav the ke code 204D 80 B7 SJMP LOOP6
------__---shy ---- shy
204F EA SCAN MOV A R2 2050 90 FF 02 MOV DPTR FF02H
2053 FO MOVXDPTR A scan port C 2054 7908 MOV RI 08H
-2056 90 FF 00 MOV DPTR FpoundOOH read port A EO MOVX A -8gtDPTRI-yeno~~ - fmiddotmiddot _-----shy~ RET
----shy
DISCRIPTION KEYBOARD MODULE HAS TO BE CONNECTED AT 8255-1 THROUGH 26 FRC
9 A
B C
---------t D
~+~-------~ +
LISTING OF THE PROGRAM FOR KEYBOARD MODULE (ET-KB)
TO INTERFACE WITH 803151 KIT HAVING LCD DISPLAY
Connect the] I of the Kit to the Module through 26 Pin FRC Cable Ensure that the pin~ I of the J1 at the Kit end is connected to the pin-l of the
ampud7~ Page 13
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
---------
KEYBOARD INTERFACE ~
Module connector Enter the program from address 6000 Execute the Program from address 6000 Press any Kev on the keyboard and observe that its code is displayed on the Kit Display
LABEL MNEMONICS REMARKS START MOV DPTR 280B Use 8255-1
6003 MOVA 90 Port A - Input amp 6005 MOVX (a)DPTRA Port C shy6006 MOV 81 65 6009 MOV DPTR 6070 600C I 7B 051MOV R3 05 600E 74 FF I I MOV A FF 6010
u
FO --lWop 1 I MOVX DPTRA INC DPTR Clear display address area
~--------+-----------~----+-------~
60] 6 CO 82 PUSH16018 7A 0] MOV ------------------------1
r-601A i 78 00 MOV RO 00 - 601C -ll2-7000- LOOP4 LCALL 700-0-----+-
601 F 13 -- LOOP3 1 RRC A Scan keys and read status 6020 ~-1C---- JC 1 C 1
6022 08 INC RO
~~~~ I ~~ FA -~g$~~~
E~~fl----6028 I BA 04 Fl CJNE R2 04Fl For next line to scan 6028 t 78 10 MOV RO10
[~602D 906074 ___ -MQV DPTR 6074 Fo_r-=------ 6030 74 9F MOV A 9F
--------- shy
6032 FO MOVX DPTRA I 6033 12 7QOO mLm m I LCALL 7000 Scan graphical keys __ I
13 I Ll RRC A ~ f-----------+---------+--------- +-~IC~~0-5------~-+-lf-=--k-e-~--p-re--ssed go to loop2
TNC RO L _e bull
If
IRecogniz~ particular key
~~AV R2A
-------l--------------+---~~=c-DJNZ R1FA --0~C~~-rt~C~-------i
SJMP C8 603pound I DO 82 I LOOP2 I POP 82
-_040==plusmnf0 _83 POP 83 Get DPTR 6042 E8 ------ ---- ---t-----+----=-~__=______c_c__--_+_---------
6043 I FO --------j-------t---------------j ------------------1
6044 FE
ampud7~ Page 14
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15
____
KEYBOARD INTERFACE
6045 1201 DS--nCALL 01D5 ~~6048_ EE~_ _ MOY AR6 6049 54 FO i ANLA FO
i04B C4 - SWAP A____ ~ __ I__~1 shy604C 120589 LCALL 0589
- ~---
604F EE__ _ MOY AR6 6050 t 54 OF ANLA OF
)- 6052 1205-89- - - -~-- LCALL 0589 -~--
~ 79 FF I - --r-fiOY R L FF ~_1 I_~~_J it14 -_~2X~261iI ~- --- _ middotmiddot1 r-(fOJ-C- 80 -t2 u ~~--~ ~ ----J SJMP -Ai -~--~-~--- - t --- -~--- _-- ---- ____ I
bi~ ~~~~ 08 nv - vo ___
IL_______ 700B 22_____________________________~_---
Now Enter the Proeram from Address 7000 onward
7000 E 7001 9
A I SCAN MOYAR2 ~- --- shy shy ----_ shy
0280A MOY DPTR 280A 7004 ---~ TF -~ -
0 MOYX DPTRA C ~() O 1 Af n 1 ~I (0
ampud7~ Page 15