wala kaau ko mkasabot doh..ng.basa2 nman kos data sheet pero mg.libog jpon ko mao needed jud nako ang inyong help... willing ko mkig-kta ug mu.byad para lng jud ani nga program.. i hope mka.tabang moh...
klarohon sa nato..
gikan ni sa imoha teacher.. so working na ni ang code?
nia ang giquire ani ky dapat sabton ninjo ang code ky ijaha mo pangutan-on line-by-line og ipaexplain sa injuha unsa ang flow sa code?
so mao na problema ky wa kaau masabti ag code, so patabang ka paexplain unsa ag dagan sa code line by line?
klarohon sa nato..
gikan ni sa imoha teacher.. so working na ni ang code?
nia ang giquire ani ky dapat sabton ninjo ang code ky ijaha mo pangutan-on line-by-line og ipaexplain sa injuha unsa ang flow sa code?
so mao na problema ky wa kaau masabti ag code, so patabang ka paexplain unsa ag dagan sa code line by line?
working nman dw xa doh...uu, ipa.explain nya ang flow sa amung program ug wala kaau namu masabtan ang code mao mg.patabang mig explain kung unsa jd ang dagan sa amung program... mao na amung problma for now....
ok ra ts kasabot ko nimo ako gani na nag basa ra ko sa thread wala ko kasabot, unsa nakaha ka na kailangan mag tuon sa program. ako nalang ma ishare kay iclear nalang sah imo mind before ka mu dive balik ug tuon sa code gud luck!
ok ra ts kasabot ko nimo ako gani na nag basa ra ko sa thread wala ko kasabot, unsa nakaha ka na kailangan mag tuon sa program. ako nalang ma ishare kay iclear nalang sah imo mind before ka mu dive balik ug tuon sa code gud luck!
mao lgeh bai neo.. libog kaau ang program nya naa pjud EEPROM...
mao lgeh bai neo.. libog kaau ang program nya naa pjud EEPROM...
ayaw kabalaka anang EEPROM. kay mao na'y sudlan sa imung data.
Anyways, asa man jud ani imu wa nasabtan d.i bro? unsa nga line?
Spoiler: Initialization sa PIC
Code:
; F_KEYPAD_84A_1.ASM WITH EEPROM
; TURN ON ALARM IF ACTIVATED BY PIR AND NO PWD INPUT (TIME-OUT)
;====================================================================
; P R O C E S S O R
list p=16F84A
#include <p16F84A.inc>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
;====================================================================
; M A C R O S (SEPARATE FILES)
#include <MOVLF.inc>
#include <MOVFF.inc>
#include <SUBLF.inc>
#include <SUBFF.inc>
;====================================================================
; P R E - L O A D E E P R O M
ORG 0X2100
DE 01H, 02H, 03H, 04H ; DEFINE EEPROM CONTENTS AT BURN TIME
;====================================================================
; R E S E T V E C T O R
ORG 0X000
GOTO SETTING
;====================================================================
; I N T E R R U P T V E C T O R
ORG 0X004
RETFIE
;====================================================================
; M A I N
SETTING
BSF STATUS,RP0
MOVLF 10H,PORTA
BCF PORTB,7
BCF OPTION_REG,7
BCF STATUS,RP0
CLRF PORTA
;--------------------------------------------------------------------
Spoiler: Standby/Option Mode
Code:
TRGR_MAIN
CALL LEDS_TRGR_MAIN
BSF STATUS,RP0
MOVLF 77H,PORTB ; ROW4 OF KEYPAD
BCF STATUS,RP0
CALL TST_MRK_BZR
BCF PORTB,3
TST_TRGR_BZR
BTFSS 1DH,0
GOTO TST_TRGR_RA4 ; ALARM OFF, TEST OTHER TRIGGERS
GOTO TRGR_PND_PWD ; ALARM ON, PRESS # THEN PWD THEN *
TST_TRGR_RA4
BTFSS PORTA,4
GOTO TST_TRGR_PND ; ALARM OFF, NOT TRIGGERED BY PIR
; TRIGGERED BY RA4 (PIR)
CALL LEDS_IN_PWD ; INPUT PWD (3 ATTEMPTS)
MOVLF 3CH,29H ; 3CH = 60 LOOPS BEFORE TIME-OUT
BSF 1FH,7 ; MUST COUNT KEYPAD SCAN
GOTO INPUT_PWD
TST_TRGR_PND
BTFSC PORTB,6
GOTO TST_TRGR_BZR ; # NOT PRESSED, WAIT FOR TRIGGER
GOTO TRGR_PND_OPT ; # PRESSED, WAIT FOR OPTION
;--------------------------------------------------------------------
Spoiler: Entering Password
Code:
INPUT_PWD
MOVFF 12H,PORTA ; LOAD CURRENT STATE OF INDICATORS
INPUT_HERE
CALL ASK_PWD
BTFSC 1FH,7
GOTO INPUT_CONT
BSF 1DH,0 ; ALLOWED LOOPS FINISHED
CALL TST_MRK_BZR
GOTO TRGR_MAIN
INPUT_CONT
BTFSS 1DH,2
GOTO INPUT_HERE ; DID NOT REACH 4 INPUTS YET, WAIT FOR INPUT
CALL VERIFY_PWD ; VERIFY PWD
BTFSS 1DH,3 ; CORRECT PWD MARKER
GOTO INPUT_WRNG ; WRONG PWD, TEST FOR 3RD ATTEMPT
GOTO TRGR_MAIN ; CORRECT PWD, WAIT FOR INPUT
;--------------------------------------------------------------------
INPUT_WRNG
BTFSS 1DH,0
GOTO INPUT_PWD ; ATTEMPTS<3, ASK FOR PWD
GOTO TRGR_MAIN ; ATTEMPTS=3
;--------------------------------------------------------------------
Spoiler: What will happen if you enter the passwrd
Bitaw unsa may problem ana TS.
Tsakto kaau ng gibuhat ni boss stealthghost. Bahinon ang program base sa function.
Pero taas pa jud imo dapat tun-an ani TS.
I used assembly kato first time jud nako gamit ug PIC.
Gipa print nako ang datasheet labi na ang instruction set summary, pin diagrams, SFR's, whole UART and ADC section, example source codes sa net, etc, etc...
I am not surprised ug di pa nimo masabtan ng codes na gihatag sa inyo teacher kay medyo complicated na siya.
Dili lang estudyante ang tapulan karun, hasta na mga teacher. hehe.
Ipa print ng gi post ni boss stealthghost then gam-i ug flowchart. Dili kayo lisud kay naa na mga comments.
Then ug naa ka wa nasabtan, post lang dri. Good luck!