;------------------------------------------------------------------------------
;  MICROCHIP KEELOQ CODE HOPPING SIMPLE DECODER
;
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
;  LEGAL NOTICE
;
;  The information contained in this document is proprietary and
;  confidential information of Microchip Technology Inc.  Therefore all
;  parties are required to sign a non-disclosure agreement before
;  receiving this document.
;
;  The information contained in this Application Note is for suggestion
;  only.  It is your responsibility to ensure that your application meets
;  with your specifications.  No representation or warranty is given and
;  no liability is assumed by Microchip Technology Incorporated with
;  respect to the accuracy or use of such information or infringement of
;  patents or other intellectual property arising from such use or
;  otherwise.
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
; SIMPLE DECODER WITH ONE STEP LEARN AND SINGLE KEY
;------------------------------------------------------------------------------
;
;PROGRAM INFORMATION:    FILE:    SIMDEC11.ASM   
;            DATE:    8 SEPTEMBER 1998
;            VER.:    1.1
;            CKSM:    XXXXH - FUSES:RC,WDT=ON,CP=ON
;            ASM.:    MPASM VERSION 2.13 USED
;            INCL:    NONE
;            TABS:  8
;------------------------------------------------------------------------------
; CONFIGURATION CONTROL:
;
;  -VERSION 1.1  S. DAWSON
;
;          FILE:    SIMDEC11.ASM.   
;          DATE:    8 SEPTEMBER 1998
;          VER.:    1.1
;        FUSES:    RC,WDT=ON,CP=ON.
;          ASM.:    MPASM VERSION 2.13 USED.
;        INCL:    NONE
;
; CHANGES:
;    1.  CODE HAS BECOME A RESERVED WORD IN MPASM - CHANGED IT TO DISC
;    2.  ADDED DISCLAIMER
;
;
; DATE        VERSION    LINE    CHANGES
; 08/14/96    1.0        FIRST VERSION
;------------------------------------------------------------------------------
    LIST P=16C54,R=DEC
;------------------------------------------------------------------------------
;******USER DEFINITIONS******
MAX_USERS    EQU    15
; This is the maximum number of transmitters that the system is able to
; learn (1 to 15). 
;------------------------------------------------------------------------------
; GENERAL PURPOSE REGISTERS
IND    EQU    00H        ; INDIRECT ADDRESS REGISTER
RTCC    EQU    01H        ; REAL TIME COUNTER CLOCK
PC    EQU    02H        ; PROGRAM COUNTER
STATUS    EQU    03H            ; STATUS REGISTER
FSR    EQU    04H        ; FILE SELECT REGISTER
PORTA  EQU    05H        ; PORT A
PORTB  EQU    06H        ; PORT B
; USER DEFINED REGISTER
FLAGS    EQU    07H        ; USER FLAG REGISTER
ADDRESS    EQU    08H        ; ADDRESS REGISTER
TXNUM    EQU    09H        ; CURRENT TX
OUTBYT    EQU    0AH        ; GENERAL DATA REGISTER
MASK    EQU    OUTBYT        ; MASK REGISTER USED IN DECRYPTION
TMP_CNT    EQU    OUTBYT        ; TEMPORARY COUNTER
; COUNTER REGISTERS
CNT0    EQU    0BH        ; LOOP COUNTERS
CNT1    EQU    0CH       
CNT2    EQU    0DH       
timeout on t2 timer
CNT_HI    EQU    0EH        ; 16 BIT CLOCK COUNTER
CNT_LW    EQU    0FH       
; CIRCULAR BUFFER REGISTER
CSR0    EQU    10H                ; 64 BIT RECEIVE SHIFT REGISTER
CSR1    EQU    11H           
CSR2    EQU    12H           
CSR3    EQU    13H           
CSR4    EQU    14H               
CSR5    EQU    15H           
CSR6    EQU    16H           
CSR7    EQU    17H           
; TEMP REGISTERS
TMP1    EQU    18H        ; TEMP REGISTER FOR READ AND WRITE
TMP2    EQU    19H        ; TEMP REGISTER FOR READ AND WRITE
REG    EQU    1AH        ; NOT USED
REG1    EQU    1BH        ; NOT USED
KEY0    EQU    1CH        ; 64 BIT KEY SHIFT REGISTER
KEY1    EQU    1DH
KEY2    EQU    1EH
KEY3    EQU    1FH
KEY4    EQU    CNT2
KEY5    EQU    CSR5
KEY6    EQU    CSR6
KEY7    EQU    CSR7
; ***** USER REGISTER RE-MAPPINGS ***************
HOP1    EQU    CSR0        ; 32 BIT HOPCODE REGISTER
HOP2    EQU    CSR1
HOP3    EQU    CSR2
HOP4    EQU    CSR3
; RECEIVED TRANSMISSION OPEN 32 BITS
SER_0    EQU    CSR7        ; 28 BIT SERIAL NUMBER
SER_1    EQU    CSR6
SER_2    EQU    CSR5
SER_3    EQU    CSR4
; RECEIVED TRANSMISSION ENCRYPTED 32 BITS
FUNC    EQU    CSR3        ; BUTTON CODE & USER BIT FUNCTION BYTE
DISC    EQU    CSR2        ; DISCRIMINATION VALUE
CNTR_HI    EQU    CSR1        ; 16 BIT RX COUNTER HIGH BYTE
CNTR_LW    EQU    CSR0        ; 16 BIT RX COUNTER LOW BYTE
; ********* EEPROM MEMORY *******
LRNPTR    EQU    01H        ; LEARN POINTER
; ********* PORTA BIT DEFINITIONS *******
RES0    EQU    0H        ; RESERVED PIN
RFIN    EQU    1H        ; RF INPUT
LRN    EQU    2H        ; LEARN BUTTON
LED    EQU    3H        ; LEARN INDICATOR LED OUTPUT - VALID SIGNAL

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。