https://github.com/hungtcs/8052-clock
使用STC89C52和DS1302芯片做的数码管显示时钟程序
https://github.com/hungtcs/8052-clock
8051 clock ds1302
Last synced: over 1 year ago
JSON representation
使用STC89C52和DS1302芯片做的数码管显示时钟程序
- Host: GitHub
- URL: https://github.com/hungtcs/8052-clock
- Owner: hungtcs
- License: gpl-3.0
- Created: 2018-03-04T04:20:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-17T05:28:02.000Z (about 6 years ago)
- Last Synced: 2025-01-26T04:41:50.321Z (over 1 year ago)
- Topics: 8051, clock, ds1302
- Language: C
- Size: 188 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
8052 Clock
====
### 介绍
使用8052、ds1302和8位共阴数码管制作的数码管时钟程序。
主控IC为 STC89S52。
数码管驱动为 74HC573。
编译器 sdcc version 3.5.0
### 使用方式
程序有`设置`和`显示`两个模式,另外有`操作`和`设置`两个按键。
在非设置模式下,操作按钮的功能为切换显示模式,即切换日期显示和时间显示。
按下并松开一次设置按钮可以切换到设置模式,每按一次设置按钮切换一次设置的项目,
在时间显示模式对应时分秒、日期显示模式对应年月日,
在设置日或者秒的时候再按一次设置按钮则退出到显示模式。
### 修改引脚
DS1302引脚:
>```c
> // file: DS1302.h
> #define DS1302_SCK P1_7
> #define DS1302_IO P2_7
> #define DS1302_RST P1_2
> ```
数码管引脚:
>```c
> // DS1302.c
> #define DT_SS P2_0 // 段选
> #define DT_BS P2_1 // 位选
> #define DT_DATA P0
> ```
键盘引脚(低电平触发):
> ```c
> // DS1302.c
> #define SETTING_KEY P3_7
> #define OPERATION_KEY P3_6
> ```