FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Keyboard scanning profiler

     

    PIC keyboard scan assembler ;;............................... Keyboard scanning subroutine -- key 16, low four digit output and high four digit input of port D JIANPAN MOVLW 00H MOVWF PORTD MOVLW 0F0H ANDWF PORTD,W SUBLW 0F0H BTFSC STATUS,Z; Judge whether the top four digits of port D are all "1" RETURN ; Yes, keyless input, return CALL DELAY10MS; No, there is a key input, with a delay of 20ms CALL DELAY10MS CALL DELAY10MS MOVLW 00H ; Judge again MOVWF PORTD MOVLW 0F0H ANDWF PORTD,W SUBLW 0F0H BTFSC STATUS,Z; Judge whether the top four digits of port D are all "1" RETURN ; False input, return MOVLW 0FEH ; Confirm that there is key input and judge line by line. First, rd0 = 0 MOVWF PORTD BTFSS PORTD,4 ; Key "0" GOTO JIAN0 BTFSS PORTD,5 ; Key "1" GOTO JIAN1 BTFSS PORTD,6 ; Key "2" GOTO JIAN2 BTFSS PORTD,7 ; Key "3" GOTO JIAN3 MOVLW 0FDH ; Confirm that there is key input and judge line by line. First, RD1 = 0 MOVWF PORTD BTFSS PORTD,4 ; Key "4" GOTO JIAN4 BTFSS PORTD,5 ; Key "5" GOTO JIAN5 BTFSS PORTD,6 ; Key "6" GOTO JIAN6 BTFSS PORTD,7 ; Key "7" GOTO JIAN7 MOVLW 0FBH ; Confirm that there is key input and judge line by line. First, rd0 = 2 MOVWF PORTD BTFSS PORTD,4 ; Key "8" GOTO JIAN8 BTFSS PORTD,5 ; Key "9" GOTO JIAN9 BTFSS PORTD,6 ; Key "a" GOTO JIANA BTFSS PORTD,7 ; Key "B" GOTO JIANB MOVLW 0F7H ; Confirm that there is key input and judge line by line. First, rd0 = 3 MOVWF PORTD BTFSS PORTD,4 ; Key "C" GOTO JIANC BTFSS PORTD,5 ; Key "d" GOTO JIAND BTFSS PORTD,6 ; Key "e" GOTO JIANE BTFSS PORTD,7 ; Key "F" GOTO JIANF RETURN;.................; 10 ms delay subroutine DELAY10MS MOVLW 0FH MOVFW 20HLP2 MOVLW 0FFH MOVWF 21HLP1 DECFSZ 21H,F GOTO LP1 DECFSZ 22H,F GOTO LP2 RETURN;........................; Key '0' subroutine, customizable JIAN0 CALL SFANG; Call keyboard release subroutine . . . RETURN;...................; Keyboard release waiting subroutine SFANG MOVLW 00H MOVWF PORTD MOVLW 0F0H ANDWF PORTD,W SUBLW 0F0H BTFSS STATUS,Z GOTO SFANG; Key not released CALL DELAY10MS; Released, delayed CALL DELAY10MS CALL DELAY10MS MOVLW 0F0H; Judge again ANDWF PORTD,W SUBLW 0F0H BTFSS STATUS,Z GOTO SFANG; It was a false release just now, waiting for further judgment RETURN The above are all program codes Another assembly language source code: My keyboard scanner: key equ p2disp equ p0 ; 7------+--+--+--+; 6------+--+--+--+; 5------+--+--+--+; 4------+--+--+--+; 3______| | | |; 2_________| | |; 1____________| |; 0_______________| org 0000h ajmp start org 0100hstart: mov disp,#0 mov dptr,#tabloopscan:acall keyin acall keyoff mov a,r0 movc a,@a+dptr mov disp,a ajmp loopscan keyin: mov key,#0fh mov a,key cjne a,#0fh,select sjmp keyinselect: mov a,key cjne a,#0eh,next1 ajmp row1next1: cjne a,#0dh,next2 ajmp row2next2: cjne a,#0bh,next3 ajmp row3next3: ajmp row4 row1: mov key,#0feh mov a,key cjne a,#0feh,row1scan ajmp row2row1scan:cjne a,#0eeh,row11 mov r0,#12 acall delay20ms ajmp scanendrow11: cjne a,#0deh,row12 mov r0,#13 acall delay20ms ajmp scanend row12: cjne a,#0beh,row13 mov r0,#14 acall delay20ms ajmp scanendrow13: mov r0,#15 acall delay20ms ajmp scanend row2: mov key,#0fdh mov a,key cjne a,#0fdh,row2scan ajmp row3row2scan:cjne a,#0edh,row21 acall delay20ms mov r0,#8 ajmp scanendrow21: cjne a,#0ddh,row22 mov r0,#9 acall delay20ms ajmp scanend row22: cjne a,#0bdh,row23 mov r0,#10 acall delay20ms ajmp scanendrow23: mov r0,#11 acall delay20ms ajmp scanend row3: mov key,#0fbh mov a,key cjne a,#0fbh,row3scan ajmp row4row3scan:cjne a,#0ebh,row31 mov r0,#4 acall delay20ms ajmp scanendrow31: cjne a,#0dbh,row32 mov r0,#5 acall delay20ms ajmp scanend row32: cjne a,#0bbh,row33 mov r0,#6 acall delay20ms ajmp scanendrow33: mov r0,#7 acall delay20ms ajmp scanend row4: mov key,#0f7h mov a,key cjne a,#0e7h,row41 mov r0,#0 acall delay20ms ajmp scanendrow41: cjne a,#0d7h,row42 mov r0,#1 acall delay20ms ajmp scanend row42: cjne a,#0b7h,row43 mov r0,#2 acall delay20ms ajmp scanendrow43: mov r0,#3 acall delay20ms ajmp scanend scanend:ret ; Judge whether to release keyoff: mov key,#0fh mov a,key cjne a,#0fh,keyret sjmp keyoffkeyret: acall delay20ms ret;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!; 12Mhz Crystal!!!!!!!!!!!!!!!!!!!!!!! 12 cycle MCU delay20ms: mov R7, #250delay20msd0: mov R6, #60delay20msd1: djnz R6$ djnz r7,delay20msd0 ret tab:db 11100111b,10000100b,11010011b,11010110b,10110100b, 01110110b,01110111b,11000100b,11110111b,11110110b db 11110101b,00110111b,01100011b,10010111b,01110011b, 01110001b,01100111b,10110101b,00100001b,10000111bdb 00100011b,00010101b,00010111b,11110001b,11110100b,10110110b End, technology zone Ruisaide technology moved to a new site, and RT thread entered a new stage of accelerated development High reliability, flexible control, low power consumption, adjustable speed fan cooling system LED driving solution of security surveillance camera

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us