1302时钟显示
单片机源程序如下:
- #include <reg52.h>
- #include <intrins.h>
- #include <string.h>
- #define uint unsigned int
- #define uchar unsigned char
- sbit IO = P1^0;
- sbit SCLK = P1^1;
- sbit RST = P1^2;
- sbit RS = P2^0;
- sbit RW = P2^1;
- sbit EN = P2^2;
- uchar *WEEK[]=
- {
- "SUN","***","MON","TUS","WEN","THU","FRI","SAT"
- };
- uchar LCD_DSY_BUFFER1[]={"DATE 00-00-00 "};
- uchar LCD_DSY_BUFFER2[]={"TIME 00:00:00 "};
- uchar DateTime[7];
- /********************************************************
- 函数名称:void DelayMS(uint ms)
- 功能描述: 可控毫秒延时
- 全局变量:无
- 参数说明:可控延时时间
- 返回说明:无
- 说明 : 毫秒级延时
- ********************************************************/
- void DelayMS(uint ms)
- {
- uchar i;
- while(ms--)
- {
- for(i=0;i<120;i++);
- }
- }
- void Write_A_Byte_TO_DS1302(uchar x)
- …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码
所有资料51hei提供下载:
DS1302.rar
(310.1 KB, 下载次数: 6)
|