51/AVR单片机技术驿站!  <在线翻译>     便利工具    特色网址   无弹窗、无插件的绿色站点...  英才招聘   学历查询  喜欢>>收藏我站 

当前位置:首页 > 单片机技术文章 > 51单片机 > 详细内容
多功能AT89C2051倒计时器
发布时间:2009/7/7  阅读次数:6991  字体大小: 【】 【】【


led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2

led_k0_2: ; nop

ajmp led_jmp_5_end

led_k1_2: ; al1 way off/on

cpl al1_f
jb flash_f ,tw_11

sjmp tw_21
tw_11:
mov c,al1_f
mov a,flash
mov acc.1 ,c
mov flash,a

tw_21:
ajmp led_jmp_5_end

led_k2_2: ;al1 timer

jb flash_f ,set_11
inc al1_min_t
mov a,al1_min_t
cjne a,#60 ,set_12
mov al1_min_t,#00h
set_12:
sjmp set_14

set_11:
inc al1_min
mov a,al1_min
cjne a,#60 ,set_14
mov al1_min,#00h
set_14:

ajmp led_jmp_5_end

led_k3_2: ;al2 way off/on

cpl al2_f
jb flash_f ,tw_12
sjmp tw_22
tw_12:
mov c,al2_f
mov a,flash
mov acc.2 ,c
mov flash,a

tw_22:
ajmp led_jmp_5_end

led_k4_2: ;al2 timer

jb flash_f ,set_21
inc al2_min_t
mov a,al2_min_t
cjne a,#60 ,set_22
mov al2_min_t,#00h
set_22:
sjmp set_24

set_21:
inc al2_min
mov a,al2_min
cjne a,#60 ,set_24
mov al2_min,#00h
set_24:

ajmp led_jmp_5_end

led_k5_2: ; al3 way off/on

cpl al3_f
jb flash_f ,tw_13
sjmp tw_23
tw_13:
mov c,al3_f
mov a,flash
mov acc.3 ,c
mov flash,a

tw_23:
ajmp led_jmp_5_end

led_k6_2: ;al3 timer
jb flash_f ,set_31
inc al3_min_t
mov a,al3_min_t
cjne a,#60 ,set_32
mov al3_min_t,#00h
set_32:
sjmp set_34

set_31:
inc al3_min
mov a,al3_min
cjne a,#60 ,set_34
mov al3_min,#00h
set_34:
ajmp led_jmp_5_end

led_k7_2: ; turn off/on
setb turn_f

led_jmp_5_end:
ret
end
;****************************************
proc key_2
key_2:

mov dptr,#led_ord_3
mov a,key_power ;data
mov b,#02h
mul ab
jmp @a+dptr

led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2

led_k0_2: ; nop

ajmp led_jmp_5_end

led_k1_2: ; al1 way off/on

ajmp led_jmp_5_end

led_k2_2: ;al1 timer
jb flash_f ,set_311
inc al1_hour_t
mov a,al1_hour_t
cjne a,#20d ,set_321
mov al1_hour_t,#00h
set_321:
sjmp set_341

set_311:
inc al1_hour
mov a,al1_hour
cjne a,#20d ,set_341
mov al1_hour,#00h
set_341:

ajmp led_jmp_5_end

led_k3_2: ;al2 way off/on
ajmp led_jmp_5_end

led_k4_2: ;al2 timer
jb flash_f ,set_312
inc al2_hour_t
mov a,al2_hour_t
cjne a,#20d ,set_322
mov al2_hour_t,#00h
set_322:
sjmp set_342

set_312:
inc al2_hour
mov a,al2_hour
cjne a,#20d ,set_342
mov al2_hour,#00h
set_342:

ajmp led_jmp_5_end

led_k5_2: ; al3 way off/on
ajmp led_jmp_5_end

led_k6_2: ;al3 timer
jb flash_f ,set_313
inc al3_hour_t
mov a,al3_hour_t
cjne a,#20d ,set_323
mov al3_hour_t,#00h
set_323:
sjmp set_343

set_313:
inc al3_hour
mov a,al3_hour
cjne a,#20d ,set_343
mov al3_hour,#00h
set_343:

ajmp led_jmp_5_end

led_k7_2: ; turn off/on

led_jmp_5_end:
ret
end

;******************************************** led
proc led_jmp_1
led_jmp_1:

mov dptr,#led_ord_3
mov a,key_power ;data
mov b,#02h
mul ab
jmp @a+dptr

led_ord_3: ajmp led_k0_2
ajmp led_k2_2
ajmp led_k1_2
ajmp led_k4_2
ajmp led_k3_2
ajmp led_k6_2
ajmp led_k5_2
ajmp led_k7_2

led_k0_2: ; nop

setb flash_f
mov a,#89d
mov r7,#18d
acall timer_led1
clr flash_f
ajmp led_jmp_5_end

led_k1_2: ; al1 way off/on

mov led1 ,#0bh

jnb al1_f,aal_1

mov a,#0ch
mov led1,a
aal_1:
mov led3,#1d
mov led2,#led_blk

ajmp led_jmp_5_end

led_k2_2: ;al1 timer

jb flash_f ,led_m11
mov a,al1_min_t
mov r7,al1_hour_t
sjmp led_m21
led_m11:
mov a,al1_min
mov r7,al1_hour
led_m21:
acall timer_led1
ajmp led_jmp_5_end

led_k3_2: ;al2 way off/on
mov led1 ,#0bh

jnb al2_f,aal_2

mov a,#0ch
mov led1 ,a

aal_2:
mov led3,#2d
mov led2,#led_blk

ajmp led_jmp_5_end

led_k4_2: ;al2 timer

jb flash_f ,led_m12
mov a,al2_min_t
mov r7,al2_hour_t
sjmp led_m22
led_m12:
mov a,al2_min
mov r7,al2_hour
led_m22:
acall timer_led1

ajmp led_jmp_5_end

led_k5_2: ; al3 way off/on

mov led1 ,#0bh

jnb al3_f,aal_3

mov a,#0ch
mov led1 ,a

aal_3:
mov led3,#3d
mov led2,#led_blk
ajmp led_jmp_5_end

led_k6_2: ;al3 timer

jb flash_f ,led_m13
mov a,al3_min_t
mov r7,al3_hour_t
sjmp led_m23
led_m13:
mov a,al3_min
mov r7,al3_hour
led_m23:
acall timer_led1
ajmp led_jmp_5_end


led_k7_2: ; turn off/on
mov led3,#00h
mov led2,#0bh;led_b
mov led1,#0bh;led_b

led_jmp_5_end:
acall led
ret
end


timer_led1:

我要评论
  • 匿名发表
  • [添加到收藏夹]
  • 发表评论:(匿名发表无需登录,已登录用户可直接发表。) 登录状态:未登录
最新评论
所有评论[0]
    暂无已审核评论!

网站导航 管理登陆 ┊ 免责声明 问题反馈  友链说明
本站部分内容来自网络共享资源,如有冒犯您的权利请来信告之删除或纠正!
不得对本站进行复制、盗链或镜像,转载内容须获得同意或授权;欢迎友情链接、站务合作!

    我要报警 Alexa
 mcusy_cn#126.com (请把#改成@) 交流:522422171
本站学习交流群:138..158(高级群1-)、77930286(高级群2)、61804809(群3)
Copyright© MCUSY All Rights Reserved
本站网警备案号: WZ36040002485
  ICP备案证书号:粤ICP备09034963号