本文分享了AT89C2051的智能时钟的内部程序。
以下为AT89C2051的智能时钟的内部程序
***************
;all_clk1 _program 2000-10-12
;***************
fl_250ms bit 00h
fl_500ms bit fl_250ms+1
set_clk_f bit fl_500ms+1
set_al4_f bit set_clk_f+1
am_f bit set_al4_f+1
fl_3s bit am_f+1
al1_f bit fl_3s+1
al2_f bit fl_3s+2
al3_f bit fl_3s+3
al4_f bit fl_3s+4
set_over bit al4_f+1
ha_f bit set_over+1
ha_over bit ha_f+1
fl_ms_f bit ha_over+1
fl_s_f bit fl_ms_f+1
key_over bit fl_s_f+1
;**************************************************
key_data equ 08h
timers equ key_data+1
t_30ms equ timers+1
t_20ms equ t_30ms+1
t_1s equ t_20ms+1
k1_data equ t_1s+1
k2_data equ k1_data+1
stat_work equ k2_data+1
stat_led equ stat_work+1
t_1ms equ stat_led+1
t_20m equ t_1ms+1
beep equ t_20m
al1 equ beep+1
al2 equ beep+2
al3 equ beep+3
al4 equ beep+4
al5 equ beep+5
al6 equ beep+6
al7 equ beep+7
al8 equ beep+8
ret_timer equ al8+1
;**************************************************
sec equ 23h
min equ sec+1h
hour equ min+1h
day equ hour+1h
mon equ day+1h
year equ mon+1h
w_adj equ year+1h
week equ w_adj+1h
;***************************************
al1_h equ week+1h
al1_m equ al1_h+1h
al2_h equ al1_m+1h
al2_m equ al2_h+1h
al3_h equ al2_m+1h
al3_m equ al3_h+1h
al4_h equ al3_m+1h
al4_m equ al4_h+1h
al5_h equ al4_m+1h
al5_m equ al5_h+1h
al6_h equ al5_m+1h
al6_m equ al6_h+1h
al7_h equ al6_m+1h
al7_m equ al7_h+1h
al8_h equ al7_m+1h
al8_m equ al8_h+1h
beep_t equ al8_m+1
frist equ beep_t+1
;**************************************
led1 equ frist+1
led2 equ led1+1
led3 equ led2+1
led4 equ led3+1
led5 equ led4+1
sp_data equ led5+1
;**************************************
led_1 bit p3.5
led_2 bit p3.4
led_3 bit p3.3
led_4 bit p3.2
led_5 bit p3.1
beep_f BIT P3.7
key_f bit p3.0
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !