logo

Select Sidearea

Populate the sidearea with useful widgets. Itโ€™s simple to add images, categories, latest post, social media icon links, tag clouds, and more.
[email protected]
+1234567890
 

Tutorial Microcontroller MCS-51 ATMEL ISP

Tutorial Microcontroller MCS-51 ATMEL ISP

image

Microcontroller Kits
Programmer and Target 89s51
image

Simple Mikrokontroller 89s51 Trainer
image

Standart
Mikrokontroller 89s51 Trainer
image

Super Mikrokontroller Trainer 89s51
image

All Item Include

Programmer
Via USB

image

ย 

BACK

Interfacing Keyboard to Microcontroller 8051

ย 

Figure 2. Interafacing Connection Keyboard and Microcontroller

ย 

( Download File asm : keyboard.zip , Download Circuit: Keyboard.zip

dispclr  equ 00000001bfuncset  equ 00111000bentrmod  equ 00000110bdispon   equ 00001100bKbdData  bit P3.3KbdClock bit INT0;P3.2DataKeyboard equ 30h;        org 0h        nopcall init_LCD;Forever:        JB KbdClock,$        call GetDataKeyboard        jnc Forever        acall LCD_Out        clr C        sjmp Forever;;==================================;Subroutine Get Data From Keyboard;================================== GetDataKeyboard:         call Get_scancode         cjne a,#0F0h,kybd_pressed         JB KbdClock,$          call Get_Scancode         Setb C         call Convert_Scancode         ret;Kybd_pressed:         Clr C         ret;;===============================;Subroutine Convert Scan Data;Using Look Up Table;===============================Convert_ScanCode:         Mov DPTR,#TableKeyboard         movc A,@A+DPTR         mov DataKeyboard,A         ret;LCD_Out:         mov R7, #80h         acall write_inst         mov R7,DataKeyboard         acall write_data         ret;init_lcd:         mov R7,#dispclr         acall write_inst         mov R7,#funcset         acall write_inst         mov R7,#dispon         acall write_inst         mov R7,#entrmod         acall write_inst         ret;Get_scanCode:         clr A         Jnb KbdClock,$         mov R0,#08hGet_ScanCode2:         Jb KbdClock,$         Mov C,KbdData         Rr A         mov acc.7,C         Jnb KbdClock,$         Djnz R0,Get_ScanCode2         Jb KbdClock,$         Jnb KbdClock,$         Jb KbdClock,$         Jnb KbdClock,$         ret;Write_inst:         Clr P3.6  ; RS = 0,          Mov P0,R7 ; D7 s/d D0 = P0 = R1         Setb P3.7 ; EN = 1          call delay; call delay time         Clr P3.7  ; EN = 0          ret;Write_data:         Setb P3.6 ; RS = 1,          Mov P0,R7 ; D7 s/d D0 = P0 = R1         Setb P3.7 ; EN = 1         call delay; call delay time         Clr p3.7  ; EN = 0         ret;delay:   mov R5,#0         delay1:mov R4,#02fh         djnz R4,$         djnz R5,delay1         ret;TableKeyboard:DB 00DB 0F9HDB 00DB 0F5H,0F3H,0F1H,0F2H,0FCHDB 00HDB 0FAH,0F8H,0F6H,0F4HDB 0C0HDB '~'DB 00HDB 00HDB 0C1HDB 0C2HDB 00HDB 0C3HDB 'Q1'DB 00H,00H,00HDB 'ZSAW2'DB 00H,00HDB 'CXDE43'DB 00H,00HDB ' VFTR5'DB 00H,00HDB 'NBHGY6'DB 00H,00H,00HDB 'MJU78'DB 00H,00HDB ',KIO09'DB 00H,00HDB './L;P-'DB 00H,00H,00HDB 27HDB 00HDB '[='DB 00H,00HDB 0C5HDB 0C6HDB 0AHDB ']'DB 00HDB ''DB 00H,00H,00H,00H,00H,00H,00H,00HDB 08HDB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00H,00HDB 00H,00HDB 0DHDB 00HDB 0FBHDB 00H,00H,00H,00H,00H,00H,00H,00H,00H,00HDB 0F7Hend

ย 

Comments, questions and discussion about this topic

BACK

ย 

ย 

ย imageimageimageimage