FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Single-chip learning remote control program detailed (full version)

     

    "STC89C52 learning remote controller can store eight infrared remote control information. It can be used in commercial production as long as the key is interrupted by 2 with a timer. RXIN BIT P2.0 TXZAI BIT P2.2 TXOUT BIT P2.1 KEY_ SIGN BIT 20H ; The key for 0 is wrong, and the key for 1 is correct RXTX_ SIGN BIT 21H ; 0 is the transmitting state and 1 is the receiving state ISP_ DATA DATA 0E2H ; ISP function register definition ISP_ ADDRH DATA 0E3H ISP_ ADDRL DATA 0E4H ISP_ CMD DATA 0E5H ISP_ TRIG DATA 0E6H ISP_ CONTR DATA 0E7H ISP_ CMD_ NO EQU 0 ; Operand ISP_ CMD_ READ EQU 1 ISP_ CMD_ PROGRAM EQU 2 ISP_ CMD_ ERASE EQU 3 WAIT_ TIME EQU 1 ; waiting time ZHIL EQU 30H ZHIH EQU 31H GESHU EQU 32H JISHU EQU 33H KEY_ WORD EQU 34H KEY_ VALUE EQU 35H ADDRH EQU 36H ADDRL EQU 37H TX_ GESHU EQU 38H ORG 0000H LJMP START ORG 000BH LJMP T0IN ORG 001BH LJMP T1IN ORG 0100H START: MOV SP,#10H CLR RXTX_ SIGN LJMP KEY_ MAIN KEY_ MAIN:LCALL SCAN_ KEY ; Check whether a single key is pressed MOV A,KEY_ WORD CJNE A,#00H,NEXT1 LJMP KEY_ MAIN NEXT1: JNB KEY_ SIGN,KEY_ MAIN MOV KEY_ VALUE,A LCALL RE_ DELAY ; Buffeting time 20ms LCALL SCAN_ KEY ; Is it still pressed MOV A,KEY_ WORD CJNE A,#00H,NEXT2 LJMP KEY_ MAIN NEXT2: JNB KEY_ SIGN,KEY_ MAIN CJNE A,KEY_ VALUE,KEY_ MAIN RELEASE: LCALL SCAN_ KEY ; Check whether the key is released MOV A,KEY_ WORD CJNE A,#00H,RELEASE MOV DPTR,#TAB ; Execute the corresponding program CLR C MOV A,KEY_ VALUE ADD A,KEY_ VALUE JMP @A+DPTR TAB: AJMP KEY_ 0 AJMP KEY_ one AJMP KEY_ two AJMP KEY_ three AJMP KEY_ four AJMP KEY_ five AJMP KEY_ six AJMP KEY_ seven AJMP KEY_ eight AJMP KEY_ nine AJMP KEY_ ten AJMP KEY_ eleven AJMP KEY_ twelve AJMP KEY_ thirteen AJMP KEY_ fourteen AJMP KEY_ fifteen AJMP KEY_ sixteen KEY_ 0: LJMP KEY_ MAIN ; Invalid by key value KEY_ 1: JNB RXTX_ SIGN,T1RX ; Receiving and sending key setting key, P1 light is on for receiving and storage status, and the light is off for transmitting status T1TX: CLR RXTX_ SIGN MOV P1,#0FFH LJMP KEY_ MAIN T1RX: SETB RXTX_ SIGN MOV P1,#00H LJMP KEY_ MAIN KEY_ 2: MOV ADDRH,#20H MOV ADDRL,#00H JB RXTX_ SIGN,KEY2_ RX KEY2_ TX:LJMP TX_ START KEY2_ RX:LJMP RX_ START KEY_ 3: MOV ADDRH,#22H MOV ADDRL,#00H JB RXTX_ SIGN,KEY3_ RX KEY3_ TX:LJMP TX_ START KEY3_ RX:LJMP RX_ START KEY_ 4: MOV ADDRH,#24H MOV ADDRL,#00H JB RXTX_ SIGN,KEY4_ RX KEY4_ TX:LJMP TX_ START KEY4_ RX:LJMP RX_ START KEY_ 5: MOV ADDRH,#26H MOV ADDRL,#00H JB RXTX_ SIGN,KEY5_ RX KEY5_ TX:LJMP TX_ START KEY5_ RX:LJMP RX_ START KEY_ 6: MOV ADDRH,#28H MOV ADDRL,#00H JB RXTX_ SIGN,KEY6_ RX KEY6_ TX:LJMP TX_ START KEY6_ RX:LJMP RX_ START KEY_ 7: MOV ADDRH,#2AH MOV ADDRL,#00H JB RXTX_ SIGN,KEY7_ RX KEY7_ TX:LJMP TX_ START KEY7_ RX:LJMP RX_ START KEY_ 8: MOV ADDRH,#2CH MOV ADDRL,#00H JB RXTX_ SIGN,KEY8_ RX KEY8_ TX:LJMP TX_ START KEY8_ RX:LJMP RX_ START KEY_ 9: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY9_ RX KEY9_ TX:LJMP TX_ START KEY9_ RX:LJMP RX_ START KEY_ 10: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY10_ RX KEY10_ TX:LJMP TX_ START KEY10_ RX:LJMP RX_ START KEY_ 11: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY11_ RX KEY11_ TX:LJMP TX_ START KEY11_ RX:LJMP RX_ START KEY_ 12: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY12_ RX KEY12_ TX:LJMP TX_ START KEY12_ RX:LJMP RX_ START KEY_ 13: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY13_ RX KEY13_ TX:LJMP TX_ START KEY13_ RX:LJMP RX_ START KEY_ 14: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY14_ RX KEY14_ TX:LJMP TX_ START KEY14_ RX:LJMP RX_ START KEY_ 15: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY15_ RX KEY15_ TX:LJMP TX_ START KEY15_ RX:LJMP RX_ START KEY_ 16: MOV ADDRH,#2EH MOV ADDRL,#00H JB RXTX_ SIGN,KEY16_ RX KEY16_ TX:LJMP TX_ START KEY16_ RX:LJMP RX_ START SCAN_ KEY:CLR KEY_ SIGN MOV KEY_ WORD,#00H KEY1: MOV P3,#11111110B ; first line JB P3.4,KEY2 JB KEY_ SIGN,KEYWRONG1 MOV KEY_ WORD,#1 SETB KEY_ SIGN KEY2: JB P3.5,KEY3 JB KEY_ SIGN,KEYWRONG1 MOV KEY_ WORD,#2 SETB KEY_ SIGN KEY3: JB P3.6,KEY4 JB KEY_ SIGN,KEYWRONG1 MOV KEY_ WORD,#3 SETB KEY_ SIGN KEY4: JB P3.7,KEY5 JB KEY_ SIGN,KEYWRONG1 MOV KEY_ WORD,#4 SETB KEY_ SIGN LJMP KEY5 KEYWRONG1: LJMP KEYWRONG KEY5: MOV P3,#11111101B ; Second line JB P3.4,KEY6 JB KEY_ SIGN,KEYWRONG2 MOV KEY_ WORD,#5 SETB KEY_ SIGN KEY6: JB P3.5,KEY7 JB KEY_ SIGN,KEYWRONG2 MOV KEY_ WORD,#6 SETB KEY_ SIGN KEY7: JB P3.6,KEY8 JB KEY_ SIGN,KEYWRONG2 MOV KEY_ WORD,#7 SETB KEY_ SIGN KEY8: JB P3.7,KEY9 JB KEY_ SIGN,KEYWRONG2 MOV KEY_ WORD,#8 SETB KEY_ SIGN LJMP KEY9 KEYWRONG2:LJMP KEYWRONG KEY9: MOV P3,#11111011B ; Third line JB P3.4,KEY10 JB KEY_ SIGN,KEYWRONG3 MOV KEY_ WORD,#9 SETB KEY_ SIGN KEY10: JB P3.5,KEY11 JB KEY_ SIGN,KEYWRONG3 MOV KEY_ WORD,#10 SETB KEY_ SIGN KEY11: JB P3.6,KEY12 JB KEY_ SIGN,KEYWRONG3 MOV KEY_ WORD,#11 SETB KEY_ SIGN KEY12: JB P3.7,KEY13 JB KEY_ SIGN,KEYWRONG3 MOV KEY_ WORD,#12 SETB KEY_ SIGN LJMP KEY13 KEYWRONG3:LJMP KEYWRONG KEY13: MOV P3,#11110111B ; Fourth line JB P3.4,KEY14 JB KEY_ SIGN,KEYWRONG4 MOV KEY_ WORD,#13 SETB KEY_ SIGN KEY14: JB P3.5,KEY15 JB KEY_ SIGN,KEYWRONG4 MOV KEY_ WORD,#14 SETB KEY_ SIGN KEY15: JB P3.6,KEY16 JB KEY_ SIGN,KEYWRONG4 MOV KEY_ WORD,#15 SETB KEY_ SIGN KEY16: JB P3.7,SCAN_ END JB KEY_ SIGN,KEYWRONG4 MOV KEY_ WORD,#16 SETB KEY_ SIGN LJMP SCAN_ END KEYWRONG4: LJMP KEYWRONG KEYWRONG:CLR KEY_ SIGN SCAN_ END:RET RE_ DELAY: MOV R7,#5 DE2: MOV R6,#10 DE1

     

     

     

     

    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