Design and Analysis of Intelligent Clock Using AT89C2051

Publisher:boczsy2018Latest update time:2017-12-30 Source: eefocusKeywords:AT89C2051 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Functions of the smart electronic clock:

1. Full calendar timing.
2. 12/24 hour conversion.
3. 8-way timing output (can be turned on/off)
4. Error: 15S+1uS
5. Automatic tracking of large and small months, leap years, weeks 2.

Adjustment:

After power on, the electronic clock displays "1:00".

1. 8-way timing time query

Press K1 key to display 8-way timing time in turn. Week position display: "H" means: turn on the current timing output; "L" means: turn off the current timing output. At this time, press K2 key to switch between "H" and "L". All outputs are output by the buzzer!

2. Display status control

Press K2 key to enter the following working states:
1) 12 hours/sun and moon alternate display.
2) 12 hours fixed display.
3) 24 hours/sun and moon alternate display
. 4) 24 hours fixed display.

3. Time adjustment

    Press K2 key for 3S to enter the time adjustment menu. Press K1 to enter the time calibration state in sequence: minute, hour, day, month, year, fine-tuning coefficient. Press K2 at this time to complete +1. When "d" is displayed, it means that the fine-tuning coefficient (0-99) needs to be adjusted. The smaller the value, the slower the clock runs. When the 6MHz crystal oscillator used has a large deviation, the fine-tuning coefficient should be carefully adjusted! When "out" is displayed, press K2 to exit! After exiting, press any key to start the clock.

4. Set the timing time

    . Press K1 for 3S to enter the setting menu. Press K1 to enter the 8-way timing adjustment state in sequence: hour, minute. Press K2 at this time to complete +1. When "out" is displayed, press K2 to exit!

;2001.5.24
;***************
;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

;********************************************************
t_h_100ms equ 05dh ;100 ms for 6MHz
t_l_100ms equ 07fh ;c6 for 100ms
timer_no equ 8d ;3c90+30d=3cb0h
w_adj_dat equ 50d
key_da equ 00000110b

;*********************************************************
blk_led equ 20d
dot_led equ 21d
f_led equ 22d
n_led equ 23d
u_led equ 24d
t_led equ 25d
b_led equ 26d
d_led equ 27d


oRG 0000H; ;
sJMP start
ORG 0003H; ;
reti;
ORG 000BH ;
;ajmp t0
reti ;
ORG 0013H
reti ;
ORG 001BH ;
aJMP T1 ;
ORG 0023H ;
RETI; AJMP RS_485 ;

;**************************************
start:
call clr_ram
MOV SP,#sp_data ;
call int_t0
call timer_int
call timer_20ms
STAR_BI:
call cLOCk
call week_auto
call al_out
CALL KEY_bord
call key_del
call set_clk_al
call key_jmp
call reback
call led_jmp
sjmp star_bi


Keywords:AT89C2051 Reference address:Design and Analysis of Intelligent Clock Using AT89C2051

Previous article:Design and Analysis of 6-bit Digital Clock Circuit for Single Chip Microcomputer
Next article:Design and production of multifunctional AT89C2051 countdown timer circuit

Recommended ReadingLatest update time:2024-11-15 14:31

Design and production of infrared remote control LED electronic clock circuit based on clock chip DS1302+AT89C2051
Homemade LED electronic clocks can be seen in many electronic newspapers and magazines, but most of them need to reset the time and other parameters after power failure, which brings a lot of inconvenience to use. There are also backup batteries as backup power sources, but they are often large in size. The LED electr
[Microcontroller]
Design and production of infrared remote control LED electronic clock circuit based on clock chip DS1302+AT89C2051
AT89S51 and AT89C2051 microcontroller pin introduction
AT89C2051 is a simplified version of the 51 microcontroller. It has removed the P0 and P2 ports and has only 20 pins. However, it integrates a very practical analog comparator, which is particularly suitable for developing simplified 51 application systems. After all, many times when we develop simple products, we cann
[Microcontroller]
AT89S51 and AT89C2051 microcontroller pin introduction
Dual audio communication solution based on FM
  The basic working principle of dual-audio communication is explained. Combined with the specific application in FM wired/wireless remote control broadcasting system, a dual-audio communication solution suitable for single-chip microcomputer system is introduced, and a specific hardware interface circuit is designed
[Microcontroller]
Dual audio communication solution based on FM
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号