|
这个是单片机电子密码锁原理图和程序,谁帮忙检查下哪里出错了.
单片机电子密码锁.rar
(109.39 KB, 下载次数: 24)
ORG 0000H
AJMP START
ORG 0030H
START:ACALL BP
MOV R0, #31H
MOV R2, #8
SET:MOV P1, #0FFH
MOV A, P1
CJNE A, #0FFH, L8
AJMP SET
L8:ACALL DELAY
CJNE A, #0FFH, SAVE
AJMP SET
SAVE:ACALL BP
MOV @R0 A
INC R0
DJNZ R2, SET
MOV R5, #16
D2S:ACALL BP
DJNZ R5, D2S
MOV R0, #31H
MOV R3, #3
AA1:MOV R2, #8
AA2:MOV P1, #0FFH
MOV A, P1
CJNE A, #0FFH, L9
AJMP AA2
L9:ACALL DELAY
CJNE A, #0FFH, AA3
AJMP AA2
AA3:ACALL BP
CLR C
SUBB A, @R0
INC R0
CJNE A, #00H, AA4
AJMP AA5
AA4:SETB 00H
AA5:DJNZ R2, AA2
JB 00H AA6
CLR P3.5
L3:MOV R5, #8
ACALL BP
DJNZ R4, L3
MOV R3, #3
SETB P3.5
AJMP AA1
AA6:DJNZ R3, AA7
MOV R5, #24
L5:MOV R4, L4
L4:ACALL BP
DJNZ R4, L4
DJNZ R5, L5
MOV R3, #3
AA7:MOV R5, #40
ACALL BP
DJNZ R5, AA7
AA8:CLR 00H
AJMP AA1
BP:CLR P3.7
MOV R7, #250
L2:MOV R6, #124
L1:DJNZ R6, L1
CPL P3.7
DJNZ R7, L2
SETB P3.7
RET
DELAY MOV R7, #20
L7:MOV R6, #125
L6:DJNZ R6, L6
DJNZ R7, L7
RET
END
[ 本帖最后由 pawaluodi 于 2009-4-10 07:00 编辑 ]
|
|