the code for the RFID PIC16F88 chip

Code:
'*  Author  : LEONARDO BILALIS                                  *
'*  Notice  : Copyright (c) 2017 [LEONARDOS BILALIS]            *
'*          : All Rights Reserved                               *
'*  Date    : 19/3/2017                                         *
'*  Version : 1.3                                               *
'*  Notes   : This is an RFID ACCESS control with ulcd          * 
'*          : and an interrupt LED on portb.3                   *
'****************************************************************
@ ERRORLEVEL -306 ; this command prevents the compiler to give you a notice of
                  ; crossing page boundary - make sure bits are set 
Include "MODEDEFS.BAS"
INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
DEFINE OSC 8	
OSCCON=%01111000	 '8 Mhz
CMCON = 7	         'turn comparators off
ANSEL = 0                'All digital

;wsave   VAR BYTE    $20     SYSTEM      ' location for W if in bank0
wsave   VAR BYTE    $70     SYSTEM      ' alternate save location for W 
                                         ' if using $70, comment wsave1-3

' --- IF any of these three lines cause an error ?? ------------------------
'       Comment them out to fix the problem ----
' -- Which variables are needed, depends on the Chip you are using -- 
wsave1  VAR BYTE    $A0     SYSTEM      ' location for W if in bank1
wsave2  VAR BYTE    $120    SYSTEM      ' location for W if in bank2
wsave3  VAR BYTE    $1A0    SYSTEM      ' location for W if in bank3

;-----------------------------------------------------------------
LED   VAR  PORTb.3   ; this is the operation led
  
ASM
INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
        INT_Handler   TMR1_INT,  _ToggleLED1,   PBP,  yes
    endm
    INT_CREATE               ; Creates the interrupt processor
ENDASM

T1CON = $31              ; Prescaler = 8, TMR1ON
@ INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts
;-----------------------------------------------------------------
' -----[ Variables ]-------------------------------------------------------

buf	        VAR	byte [10]' RFID bytes buffer
tagNum	    VAR	Byte	 ' from EEPROM table
idx	        VAR	Byte	 ' tag byte index
char	    VAR	Byte	 ' character from table
x           var byte
Symbol PWRLED  = PORTB.1   ; this shows that the initialization is finished and is ready for the RFID tag
symbol LCD     = PORTB.5   ; to LCD operation
Symbol rfidin  = PORTB.2   ; from RFID 
Symbol GROAN   = PORTB.7   ; goes to groan when the rfid is denied
Symbol TXRXIN  = PORTB.0   ; this is the RX input signal from the other circuit
pause 2000

serout2 LCD,32,[$55]      ' uOLED Initialize
pause 2000
serout2 lcd,32,[$56,$01]
pause 1000
serout2 lcd,32,[$45]
pause 500
serout2 lcd,32,[$55]
pause 500
serout2 lcd,32,[$45]
pause 500
serout2 lcd,32,[$73,$00,$03,$11,$ff,$ff," Leonardo Bilalis",$00]
pause 200
serout2 lcd,32,[$73,$02,$06,$10,$ff,"     Copyright 2017",$00]
pause 3000
serout2 lcd,32,[$45]
pause 1000
high pwrled                  'Software controlled Power LED (if this LED is not on at load check your code)
' -----[ EEPROM Data ]-----------------------------------------------------

Tag1	DATA  "xxxxxxxxxx"
Tag2	DATA  "xxxxxxxxxx"
Tag3    data  "xxxxxxxxxx"
Tag4    data  "xxxxxxxxxx"
Tag5    data  "xxxxxxxxxx"
Tag6    Data  "xxxxxxxxxx"
Tag7    data  "xxxxxxxxxx"
Tag8    data  "xxxxxxxxxx"
Tag9    data  "xxxxxxxxxx"
Tag10   data  "xxxxxxxxxx"

' -----[ Initialization ]--------------------------------------------------
LOW portb.4	    ' lock the door!

'----- [ LOGO ] ---------------------------------------------------------------
logo:
serout2 LCD,32,[$55]      ' uOLED Initialize
pause 500 
gosub Logo_png

' -----[ Program Code ]----------------------------------------------------

Main:
serin2 portb.2,84,[WAIT($02),str BUF\10]
pause 500
                                
Check_List:
  FOR tagNum = 1 to 10       ' scan through known tags
    FOR idx = 0 TO 9		' scan bytes in tag
    READ (((tagNum-1)*10) + idx), char	' get tag data from table
    IF (char <> buf(idx)) THEN Bad_Char		' compare tag to table
    NEXT
    GOTO Tag_Found			' all bytes match!

Bad_Char:					' try next tag
  NEXT
  
Bad_Tag:
  tagNum = 0
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$40, $49, $00, $00, $80, $80, $10, $00, $00, $C0]
    pause 500
    FREQOUT groan, 1000 */ $100, 115 */ $100	' groan
    pause 500
    serout2 lcd,32,[$45]
    pause 500
    serout2 lcd,32,[$59,$03,$00]
    pause 200
    goto main
   
Tag_Found:
IF tagNum = 1 then Leonardo       

IF tagNum = 2 then ELENI         

if tagnum = 3 then MAMAANNA       

if tagnum = 4 then THEIAMARIA     

if tagnum = 5 then MARIA          

if tagnum = 6 then displayName6

if tagnum = 7 then displayName7

if tagnum = 8 then displayName8

if tagnum = 9 then displayname9

if tagnum = 10 then displayname10

GOTO main

Leonardo:
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$40, $49, $00, $00, $80, $80, $10, $00, $00, $40]
    pause 500       'Pause ,5 sec then clear display
    goto open_door

ELENI:
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$40, $49, $00, $00, $80, $80, $10, $00, $00, $00]
    pause 500    'Pause ,5 sec then clear display
    goto open_door

MAMAANNA:
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$73,$00,$03,$11,$ff,$ff," Thank you ANNA",$00]
    pause 200
    serout2 lcd,32,[$73,$02,$06,$10,$ff,"   Please enter code",$00]
    pause 500
    goto open_door
    
THEIAMARIA:
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$73,$00,$03,$11,$ff,$ff," Thank you MARIA",$00]
    pause 200
    serout2 lcd,32,[$73,$02,$06,$10,$ff,"    Please enter code",$00]
    pause 500
    goto open_door

MARIA:
    serout2 lcd,32,[$59,$03,$01]
    pause 1000
    serout2 lcd,32,[$73,$00,$03,$11,$ff,$ff," Thank you MARIA",$00]
    pause 200
    serout2 lcd,32,[$73,$02,$06,$10,$ff,"    Please enter code",$00]
    pause 500
    goto open_door


displayName6:


displayName7:


displayName8:


displayName9:

displayName10:
'----------------------OPEN THE DOOR------------------------------    
open_door:
    HIGH portb.4          ' remove latch
    pause 5000
    if TXRXIN = 1 then  
    pause 8000
    endif  
    LOW portb.4		' restore latch
    serout2 lcd,32,[$45]
    pause 500
    serout2 lcd,32,[$59,$03,$00] 
    goto main

 ;DOOR:
 ;  serout2 lcd,32,[$45]
 ;  serout2 lcd,32,[$73,$00,$03,$11,$ff,$ff,"DOOR is OPENED",$00]
 ;  return    
'----------------- [ LOGO Routine ] ------------------------------

Logo_png:
serout2 lcd,32,[$40, $49, $00, $00, $80, $80, $10, $00, $00, $00]
pause 3000
serout2 lcd,32,[$59,$03,$00]
pause 200
return         
'-------------------- [ CLEAR ] ----------------------------------
Clearlcd:
serout2 lcd,32,[$45]
pause 500
goto logo

'---[TMR1 - interrupt handler]--------------------------------------------------
ToggleLED1:
TOGGLE led
@ INT_RETURN
and the code for the PIC16F84A

Code:
 '****************************************************************
'*  Name    : CodeLock.bas                                      *
'*  Author  : xxxxxx                                            *
'*  Date    : xxxxxxxxxx                                        *
'*  Version : 1.0                                               *
'*  Notes   : Programable Code Lock with the PIC-16F84          *
'****************************************************************
; Change the code from 1234 by typing the code 1234 then * 1961#1961#   

Include "MODEDEFS.BAS"
'**************************************************
RL1_ON_time con 1000 * 5  'sec. Relay ON time
'**************************************************

TrisA = 0  ' PORTA, all outputs
PortA = 16 ' turn off Buzer
OPTION_REG.7 = 0   ' PORTB Pullups.
TrisB = %11110000  ' PORTB.0-3 outputs, 4-7 inputs  
PortB = 0
 
LD1 var PortA.2
RL1 var PortA.3
BUZ var portA.4

cnt var byte

key  var byte
col  var byte
row  var byte
keycnt var byte
pwOK var bit

keybuf var byte[15]
pwbuf var byte[4]

EEPROM 0,[1,2,3,4] 'Default password 1,2,3,4 programmed at EEprom location 0..3
Read 0, pwbuf[0]   'Copy password from EEprom address 0..3 in to pwbuf[0..3]
Read 1, pwbuf[1]
Read 2, pwbuf[2]
Read 3, pwbuf[3]

pwOK = 0
keycnt = 0

Main:
    high ld1
    pause 200
    gosub Chk_KEYPAD
    pause 100
   
goto Main

Chk_KEYPAD:
   for row = 0 to 3 
      PORTB = (dcd row) ^ $f    
      pause 1
      col = PORTB >> 4
      if (col <> $f) then  'key pressed 
         key = (row * 3) + (ncd (col ^ $f))
         gosub Got_KEY
         key = 255
      endif
   next 
return    

Beep:
   low ld1
   low buz 
   pause 40
   high buz
return

Got_KEY:
   gosub Beep
   while (PORTB >> 4) <> $f  
      pause 1
   wend
   if key = 11 then key = 0
   keybuf[keycnt] = key
   gosub Chk_keycnt
return

Chk_PwOK: 
   PwOK = 0
   if (keybuf[0] = pwbuf[0]) and (keybuf[1] = pwbuf[1]) and (keybuf[2] = pwbuf[2]) and (keybuf[3] = pwbuf[3]) then pwok = 1
return 

Chk_NewPwOK: 
   PwOK = 0
   if (keybuf[5] = keybuf[10]) and (keybuf[6] = keybuf[11]) and (keybuf[7] = keybuf[12]) and (keybuf[8] = keybuf[13]) then pwok = 1
return 

Pw_Change:   
   pwbuf[0] =  keybuf[5]
   pwbuf[1] =  keybuf[6]
   pwbuf[2] =  keybuf[7]
   pwbuf[3] =  keybuf[8]
   Write 0, pwbuf[0] 'Store new password to EEprom location 0..3
   Write 1, pwbuf[1]
   Write 2, pwbuf[2]
   Write 3, pwbuf[3]
return

Chk_keycnt:    
   select case keycnt
      case 4
         gosub Chk_PwOK
         if pwOK then 
            if keybuf[keycnt] = 12 then Access_OK
            if keybuf[keycnt] <> 10 then Clr_keybuf
            gosub Beep
         else
            goto Clr_keybuf
         endif
      case 9
         if keybuf[keycnt] <> 12 then Clr_keybuf
         gosub Beep
      case 14
         if keybuf[keycnt] <> 12 then Clr_keybuf
         gosub Beep
         gosub Chk_NewPwOK
         if pwOK then 
            gosub Beep
            gosub Pw_Change
            gosub Beep
            goto Clr_keybuf
         else
            goto Clr_keybuf
         endif
      case else
         if keybuf[keycnt] = 12 then Clr_keybuf
   end select
   keycnt = keycnt + 1    
return

Access_OK:
   High RL1
   pause RL1_ON_time
   low RL1

Clr_keybuf:
   for cnt = 0 to 14 
      keybuf[cnt] = cnt 
   next
   keycnt = 0 
goto Main

end