this 4x4 matrix keypad circuitry is based on a 4x4 matrix keypad and seven-segment display.
keyboard interfacing
components required :
- 8051
- push button switches(8)
- seven-segment display
- Vcc
- ground
- capacitor
- crystal
and that's all you needed
now go to components of multisim and select all the components listed above. 8 switches will be required for this project.
and select .hex file in 8051
please read all the steps for a better understanding of the project
Now connect the circuit as shown below
- This circuit is made based on code which we will be burning in Arduino
- Now it's time to write the code in Keil. So open the Keil IDE window
if you don't know how to use Keil click here
- write the assembly language code in Keil given below
org 0000h
//P2 row output port low
//P3 coloumn input port high
repeat: mov P2,#00h
mov P3,#0fh
mov r0,#00h
mov r1,#04h
mov r6,#00h
mov dptr,#100h
not_released: mov a,P3
cjne a,#0fh,not_released
call delay
not_pressed: mov a,P3
cjne a,#0fh, key_pressed
sjmp not_pressed
key_pressed: acall delay
clr c
mov P2,#7fh
mov a,P2
find_row: rl a
mov r7,a
acall delay
mov P2,a
mov a,P3
cjne a,#0fh,row_found
mov a,r6
add a,#04h
mov r6,a
mov a,r7
djnz r1,find_row
row_found: mov a,P3
again: rrc a
jnc col_found
inc r0
sjmp again
col_found: mov a,r6
add a,r0
movc a,@a+dptr
mov P1,a
over: sjmp over
delay:
mov tmod,#02h
mov th0,#0eeh
setb tr0
here: jnb tf0,here
clr tf0
clr tr0
ret
ORG 100H
//DB 06H,5BH,4FH,66H,6DH,7DH,07H,7FH,6FH
DB 06h,5bh,4fh,77h,66h,6dh,7dh,7ch,07h,7fh,0bfh,39h,00h,3fh,00h,5eh
end
- know build code or simply please F5.
- know put .hex file in 8051 in multisim
NOW ITS TIME TO SIMULATE THE CIRCUIT IN MULTISIM
points to be noted:
- make sure all switches are off
- all connections are in the same way as shown above circuit
- all connections are proper
now simulate the circuit in multisim
be patient, wait for a while
- the screen should be like below
- now click on any one switch of the keyboard, I am clicking the second switch from the top
- be patient, wait for a while
- now for before the next switch to press turn off the simulation and make sure to turn off all the switches which you have turned on
- and the again start the simulation
- and click another switch, I am clicking the third switch in the second row
now do the same steps all the time when you click a new switch
And that's all😀
for any doubt contact us
Post a Comment