- 8
- 0
- 约 22页
- 2017-10-05 发布于河南
- 举报
51单片机时钟(51 singlechip clock)
51单片机时钟(51 singlechip clock)
YEAR_H EQU 30H; high of the year
YEAR_L EQU 31H; low of the year
MONTH, EQU, 32H, month
DAY EQU 33H; date
DAY_MAX EQU 34H; maximum number of days per month
HOUR EQU 35H; clock
MINUTE EQU 36H; minutes
SECOND EQU 37H; seconds
BOTTON EQU 38H; key value
FLAG EQU 39H; mode mark /0, travel time, /1 time, /2 date display and adjustment, /3 alarm clock adjustment and alarm clock switch
BEEPH EQU 40H; alarm clock
BEEPM EQU 41H; alarm clock minutes
ENBEEP EQU 42H; alarm clock switch
ORG 0000H
AJMP MAIN
ORG 001BH
AJMP SERVE
MAIN:, MOV, TMOD, #10H; set mode 1
MOV, YEAR_H, #20H; high priority; initial value 20
MOV, YEAR_L, #10H; low initial value 10
MOV, MONTH, #12H; month 01
MOV, DAY, #24H; date assigned initial value 01
MOV, R2, #14H; load 10 interrupts
CLR A; A cleared
MOV, HOUR, A; hours cleared
MOV, MINUTE, A; minutes cleared
MOV, SECOND, A; seconds cleared
MOV, FLAG, A; initialization mode
CLR P3.7; turn off the buzzer
MOV, ENBEEP, #01H; the alarm clock defaults
MOV, TH1, #4CH; initial value
MOV, TL1, #00H
SETB ET1; open interrupts
SETB EA
SETB TR1; start T1
MOV, DPTR, #TAB; send segment code header
DIS: LCALL DISPLAY; repeated call display subroutine
LCALL KEY; scan button status
LCALL NEXT; query current mode
LCALL BEEP; query alarm clock switch
SJMP DIS
SERVE: PUSH PSW; protect the scene
PUSH ACC
MOV, TH1, #4CH
MOV, TL1, #00H
Re count initial values
DJNZ, R2, BRIDGE; returned at least 10 times
AJMP BREAK1
BRIDGE: LJMP RETURN
BREAK1:, MOV, R2, #14H; reset interrupts
MOV, A, #01H; + 1
ADD, A, SECOND
DA A; converted to BCD code
MOV, SECOND, A
CJNE, A, #60H, BRIDGE; returned under 60 seconds
MOV, SECOND, #00H, seconds cleared
MOV, A, #01H; plus 1
ADD, A, MINUTE
DA A; converted to BCD code
MOV, MINUTE, A
CJNE, A, #60H, RETURN; returned under 60 minutes
MOV, MINUTE, #00H; minutes cleared
MOV, A, #01H; plus 1
ADD, A, HOUR
DA A; converted to BCD code
MOV, HOUR, A
CJNE, A, #24H, RETURN; returned within 24 hours
MOV, HOUR, #00H; hours cleared
MOV, A,
您可能关注的文档
- (java)面相对象程序设计 复习题((Java) face object programming review questions).doc
- (二)统考考务管理系统考点申报使用说明((two) examination, examination and management system, test site declaration, instructions for use).doc
- (二) 变量和常量((two) variables and constants).doc
- (纠正版)怀旧动画金曲夜((correction Edition) nostalgic animation Golden Night).doc
- (八年级数学)图形的全等(二)—全等三角形的识 …((Mathematics of grade eight) the congruence of figures (two) - congruent triangles...).doc
- (转)现在当兵一年能拿多少补贴((transfer) how much subsidy can we get for a year in the army).doc
- (项目管理者联盟专稿)定量分析在it项目管理中的应用研究(Application of quantitative analysis in project management of IT project).doc
- 003操作系统样卷(003 operating system volume).doc
- 005-浅谈医院电子病历系统的发展与应用(广州新海医院)(The development and application of 005- on the hospital electronic medical record system (Guangzhou Xinhai hospital)).doc
- 009中国古代战车(009 ancient Chinese Chariot).doc
- 52个词牌名及由来(The 52 cipai name and origin).doc
- 54全等三角形(54 congruent triangles).doc
- 53-南京航空航天大学文件(53- Nanjing University of Aeronautics & Astronautics papers).doc
- 56-大学计算机基础操作题(56- university computer basic operation question).doc
- 5分数与分数相乘(5 scores multiplied by fractions).doc
- 5年级试卷(Grade 5 test paper).doc
- 5款白领最爱车型口碑盘点(5 white-collar favorite models, reputation inventory).doc
- 6.沃尔特·迪斯尼的管理思想精髓借鸡生蛋(The management of the ideological essence of 6. Walt Disney programs).doc
- 5月有那么几天我在张家界凤凰游荡(In May, a few days, I wandered in Zhangjiajie Phoenix).doc
- 60条令你大吃一惊的小常识92137(60 tips you 92137 be startled at doctrine).doc
原创力文档

文档评论(0)