导航:首页 > 操作系统 > 单片机的数字万年历系统设计摘要

单片机的数字万年历系统设计摘要

发布时间:2022-07-22 04:25:22

❶ C51单片机的万年历程序设计

我这有个数码管显示的程序
以前做的,。。
你可以在我这个程序上修改修改
包括键盘扫描,还有动态显示



【。。。】
#include
//常量参数
#define TMODW 0x01;
#define SCONW 0x00;
#define xplay 0x04;//显示分频系数
//显示位选
unsigned char data stb;
//键值缓存,0xFF无键命令
unsigned char data keynum;
//显示字型变量
unsigned char data play[8];
//工作参数
unsigned char data l,m;
//字型码
unsigned char code BCDPC[10]=
{0x3F,0x06,0x5B,0x4F,0x66,
0x6D,0x7D,0x07,0x7F,0x6F};
//字位码
unsigned char code STBCODE[8]=
{0x01,0x02,0x04,0x08,
0x10,0x20,0x40,0x80 };
//400Hz xplay分频计数
unsigned char data cttime;
//时钟参数
unsigned char data hr,min,sec,sec100;
//调整时钟参数(时钟“走”)
void ct1()
{sec100++;
if (sec100==100)
{sec100=0;sec++;
if (sec==60)
{sec=0;min++;
if (min==60)
{min=0;hr++;
if (hr==24) hr=0;
}
}
}
}
//时钟参数→LED 显示缓存7段参数转换函数;
void xcplay()
{play[0]=BCDPC[hr/10];
play[1]=BCDPC[hr%10];
play[2]=BCDPC[min/10];
play[3]=BCDPC[min%10];
play[4]=BCDPC[sec/10];
play[5]=BCDPC[sec%10];
play[6]=BCDPC[sec100/10];
play[7]=BCDPC[sec100%10];
}
//显示扫描
void cplay()
{T0=1;//T0-高电平消隐
T1=0;//T1-低电平准备发脉冲前沿
TI=0;//?
P1=0;//?
SBUF=STBCODE[stb];
while (TI==0)
{
};
TI=0;
SBUF=play[stb];
while (TI==0)
{
};
T1=1;
T0=0;
stb=++stb&0x07;
}

extern void cthl0();
//定时器0中断处理程序
void ct0(void) interrupt 1 using 1
{cthl0();
cttime--;
if (cttime==0)
{cttime=xplay;
ct1();//调用时钟“走”函数
xcplay();//调用时钟参数→Led显示缓存转换函数
};
cplay();
}
void w20ms()
{for (l=0;l<41;l++)
{for (m=0;m<81;m++)
{
}
}
}
void tkey()
{P1=0xF0;
keynum=0xFF;
if (P1!=0xF0)
{w20ms();
P1=0xF0;
if (P1!=0xF0)
{P1=0xFE;
switch (P1)
{case 0xEE:keynum=0;break;
case 0xDE:keynum=1;break;
case 0xBE:keynum=2;break;
case 0x7E:keynum=3;break;
}
P1=0xFD;
switch (P1)
{case 0xED:keynum=4;break;
case 0xDD:keynum=5;break;
case 0xBD:keynum=6;break;
case 0x7B:keynum=7;break;
}
P1=0xFB;
switch (P1)
{
case 0xEB:keynum=8;break;
}
};
};
P1=0x00;
}
void command()
{switch (keynum)
{
case 0:{hr=hr+1;
if (hr==24)
hr=0;
}
break;

case 1:{min=min+1;
if (min==60)
min=0;
}
break;

case 2:{sec=sec+1;
if (sec==60)
sec=0;
}
break;

case 3:{sec100=0;
}
break;

case 4:{
while(!(P1=0xED))
{
hr=0;
min=0;
sec=0;
}
}
break;

case 5:{hr=hr-1;
if (hr==00)
hr=24;
}
break;
case 6:{min=min-1;
if (min==00)
min=59;
}
break;

case 7:{sec=sec-1;
if (sec==00)
sec=0;
}
break;

case 0xFF:break;
}
keynum=0xFF;
}
main ()
{ hr=8;
min=5;
sec=8;
sec100=0;
TMOD=TMODW;
SCON=SCONW;
ET0=1;
TR0=1;
EA=1;
cttime=xplay;
while (1)
{w20ms();
tkey();
command();

};
}

❷ 跪求 基于单片机的万年历的设计与制作

绪 论 1
§第一章 方案论证 3
1.1 单片机芯片的选择方案和论证 3
1.2 显示模块选择方案和论证 3
1.3 时钟芯片的选择方案和论证 4
1.4 闹钟语音方案方案和论证 4
1.5 温度传感器方案和论证 4
1.6 电路设计最终方案决定 5
§第二章 系统的硬件设计与实现 6
2.1 电路设计框图 6
2.2 主要单元电路的设计 6
§第三章 软件设计 18
3.1 主程序模块设计 18
3.2 键盘扫描模块设计 19
3.3 系统设置模块设计 20
3.4 温度采集模块设计 28
3.5 时钟模块设计 28
3.6 星期转换集模块设计 29
3.7 阴历转换模块设计 30
§第四章 测试与结果分析 32
4.1 硬件测试 32
4.2 软件测试 32
4.4 测试结果分析与结论 35
§第五章 使用说明书 37
参考文献 39
谢 辞 40
附录一 英文及译文 41
附录二 系统源程序 62
附录三 系统原理图 122
附录四 系统PCB图 123
附录五 实物图片 124

有原理图,pcb图,设计说明书,仿真图等完整毕业论文资料
需要可以找我

本设计以单片机为核心,实现了2001至2099年的阴(阳)历的年、月、日、时、分、秒、星期、闹钟、天干、地支、生肖、节假日的计算与准确显示。系统设计使用C语言编写源程序,进行了模块化设计;以Keil uVision3 为编译软件,Proteus 7.5为仿真软件 [email protected]

❸ 51单片机设计一个数字万年历电子系统

要实物吗
我做单片机设计的

❹ 急求一片基于单片机的电子钟 或者万年历的英文文献5000字左右的!!!! 急求!!

Design of the digital Perpetual Calendar based on
real-time clock chip
Abstract:This Electronic calendar uses the AT89S52 microcontroller as the core for the control. Time Circuit which is constituted by Dallas's DS1302 real-time clock chip achieved a time and date display, it increased functionality for the temperature display and the whole point timekeeping. This paper discusses the hardware circuit of the system, principle in detail,and gives the flow chart of the software design and the major source code. keywords:microcontroller; real-time clock; Temperature measurement
1 Introction
E-calendar-bedroom at home,schools,stations and more and more extensive use of plaza for people's lives,study,work great convenience. Electronics calendar for the past need to re-adjust after power-off time and date,and time is a big error. Designed the system using real-time clock chip (DS1302) as a timer parts,the chip comes with an internal crystal oscillator,so that effectively guarantee the accuracy of the time and hang own internal battery power makes the situation will continue to update the time information . This design uses AT89S52 as the main controller,in order to improve the practicality of the circuit add temperature measurement circuit,timekeeping and alarm functions.
2 System hardware design
Schematic circuit shown in Figure 2:

System architecture diagram
2.1 Power Supply Circuit
In order to rece circuit costs,the system power supply circuit by the transformer transformer,three-terminal integrated regulator (L7805> circuit 5V, has a simple,reliable, inexpensive and so on.
2.2 Host Controller
Host controller using ATMEL's latest MCU Procts AT89S52. Apart from the single-chip microcomputer has a MCS-51 series single-chip all the benefits of things,also has 8KB of internal in-system programmable FLASH memory,free and low-power brown-out mode, greatly recing the power circuit . In addition,also has a watchdog circuit,a reliable job for the circuit provides greater assurance.
2.3 digital tube display circuit
Show circuit with a high brightness,long life,low cost features such as the LED digital tube. Throughout the show circuit by the digital control and display LED drive circuit and decoding circuit. Because of the system to display the contents of more,a total of 16 digital tube, respectively,with eight shows year,month,day,four show time,show that 22 weeks,2 show the temperature. Controller in order to save resources,between the controller and displays add a decoding circuit 16 so that would have required the line of control into the circuit only 4 control lines,a great save system resources. The decoder by the decoder constitute both 3-8.
2.4 Real-time clock chip
This design uses the United States Dallas company DS1302, the chip can automatically generate century,year,month,day,hour,minute,second,such as time information. Century the use of internal registers with the software will be able to resolve the 'Millennium', the problem. The chip has its own internal battery-keng,external brown-out,the internal time information also be able to maintain for 10 years. Time for a single day record of 12 hours and there is a 24-hour mode. Time Table
Ways that also has two kinds of binary numbers,and the other with BCD code express. The chip with 128 bytes of internal RAM,one of 11 bytes used to store time information,4 bytes of memory chips used to control information,known as the control register,113-byte general-purpose RAM for users to store temporary information. In addition,users can also program the chip to control a variety of square-wave output,and its internal three-way through the software interrupt shielding.
2.5 Buttons and temperature measurements and circuit
The system in order to make the circuit more easy,button circuit design only three keys, which are 'set','+','-', three keys to adjust the calendar and clock. The system in order to improve the practicality of the circuit,an increase of a temperature display. The system temperature measurement circuit using Dallas's DS18B20. The device because of its low price,easy circuits,measurement precision,etc..
2.6 audio signal generator and driver circuit
The circuit's function is to receive control circuit to send to the entire point of time and timing signal,according to system settings proce different frequencies of audio signals,amplification by the drive circuit to drive speakers to voice their opinions in order to realize the whole point timekeeping and alarm functions.

中文译文:
基于实时钟芯片的电子万年历的设计
摘要:电子万年历以AT89S52单片机为控制核心,采用Dallas公司的DS1302实时钟芯片构成计时电路,实现了时间和日期的显示,还增加了温度显示和整点报时的功能。文章对该系统的硬件电路、工作原理做了详细介绍,同时给出了软件设计的流程图及主要程序源代码。
关键词:单片机,实时钟.温度测量
1引言
电子万年历在家庭居室、学校、车站和广场使用越来越广泛,给人们的生活、学习、工作带来极大的方便。针对以往的电子万年历断电后需重新调整时间与日期,且计时误差大的现象。本系统设计采用实时钟芯片(DS1302)作为计时器件,该芯片内部自带晶体振荡器,这样就有效的保证了计时的精确性,并且内部自带铿电池使得在断电情况能继续更新时间信息。本设计采用AT89S52作为主控制器,为了提高电路的实用性加入温度测量电路、报时和闹钟功能。
2系统硬件的设计
电路原理图如图所示:

该系统的结构框图
系统的工作原理是:主控制器每隔一段时间(小于一秒钟)读一次时钟芯片的内部寄存器的值,将读出的日历、时间信息实时的显示在LED数码显示器一上。同时,主控制器不断的扫描按键电路和温度测量电路,当有键按下时,识别出按键的值并调整相应的时间或日历的值再写入时钟芯片内部。温度数据由测量电路(DS18B20)获得的温度值送入显示电路显示。
2. 1电源电路
为了减少电路成本,本系统电源电路由变压器变压、三端集成稳压(L7805>电路产生5V,具有简单、可靠、价格低廉等特点。
2. 2主控制器
主控制器采用ATMEL公司的最新系列单片机产品AT89S52。该单片机除了拥有MCS-51系列单片机的所有优点外,内部还具有8KB的在系统可编程FLASH存储器,低功耗的空闲和掉电模式,极大的降低了电路的功耗。另外,还具有一个看门狗电路,为电路的可靠工作提供了更大的保证。
2. 3数码管显示电路
显示电路采用具有高亮度、使用寿命长、价格低廉等特点的LED数码管。整个显示电路由LED数码管和显示驱动电路和译码电路构成。由于本系统中显示的内容较多,共需要16个数码管,分别用八位显示年、月、日,四位显示时间,二二位显示星期,二位显示温度。为了节省控制器的资源,在控制器和显示器之间加入一个译码电路使本来需要16根控制线的电路变成只需四根控制线,极大的节省了系统资源。该译码器由两个3-8译码器构成。
2. 4实时钟芯片
本设计采用美国Dallas公司的DS12C887A,该芯片能够自动产生世纪、年、月、日、时、分、秒等时间信息。利用内部的世纪寄存器,配合软件就能解决’千年’,的问题。该芯片内部自带有铿电池,外部掉电时,其内部的时间信息还能够保持10年之久。对于一天内的时间记录有 12小时制和24小时制两种模式。时间的表示方法也有两种,一种用二进制数表示,另一种用BCD码表示。该芯片内部带有128字节的RAM,其中11字节用来存储时间信息,4字节用来存储芯片的控制信息,称为控制寄存器,113字节通用RAM可供用户存储临时信息。此外,用户还可以对芯片进行编程控制输出各种方波,并可对其内部的三路中断通过软件进行屏蔽。
2. 5按键与温度测且电路
本系统为了使电路更简单,按键电路只设计了三个按键,分别是’设置’、’+’、’-’,三个键用来调整日历以及时钟。本系统为了提高电路的实用性,增加了一个温度显示功能。该系统的温度测量电路采用Dallas公司的DS1280。该器件由于其具有价格低廉、电路简单、测量精确等优点。
2. 6音频信号产生及驱动电路
本电路的功能是接收控制电路发送来的整点报时及定时信号,根据系统设定产生不同频率的音频信号,由驱动电路加以放大驱动扬声器发出声音,从而实现整点报时及闹钟的功能。

希望可以帮到你!!!

❺ 电子万年历设计

您好,我看到您的问题很久没有人来回答,但是问题过期无人回答会被扣分的并且你的悬赏分也会被没收!所以我给你提几条建议:
一,你可以选择在正确的分类下去提问,这样知道你问题答案的人才会多一些,回答的人也会多些。
二,您可以到与您问题相关专业网站论坛里去看看,那里聚集了许多专业人才,一定可以为你解决问题的。
三,你可以向你的网上好友问友打听,他们会更加真诚热心为你寻找答案的,甚至可以到相关网站直接搜索.
四,网上很多专业论坛以及知识平台,上面也有很多资料,我遇到专业性的问题总是上论坛求解决办法的。
五,将你的问题问的细一些,清楚一些!让人更加容易看懂明白是什么意思!
谢谢采纳我的建议!

❻ 基于stc89c52单片机的万年历的设计

你好!

1、不用 ds1302 ,那么计时精度和年月日的计时就会复杂一些

2、你采用什么显示,LED 还是 液晶呢

3、是采用 c语言 吗

4、具体要求私信说明一下

❼ 单片机万年历设计

#include<reg52.h>#define uint unsigned int#define uchar unsigned charsbit DS1302_CLK = P3^1;sbit DS1302_IO = P3^2;sbit DS1302_RST = P3^0;uchar a,b,c,d,e,f,g,h;uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};uchar wr_data[8]={0x11,0x12,0x06,0x02,0x10,0x53,0x10};uchar readtimeR[8];void delays(uint n){while(n--);}/*****************************************************************************函数功能:写DS1302一个字节子程序入口参数:出口参数:*****************************************************************************/void sendbyte(uchar a){uchar i,temp;temp=a;for(i=8;i>0;i--) { if(temp&0x01) //先发低位DS1302_IO=1;elseDS1302_IO=0;temp=temp>>1;DS1302_CLK=1;delays(5);DS1302_CLK=0;delays(5); }}/*****************************************************************************函数功能:读DS1302一个字节子程序入口参数:出口参数:*****************************************************************************/uchar readbyte(void){uchar i,dat=0;for(i=8;i>0;i--) {DS1302_IO=1;dat>>=1; if(DS1302_IO) dat|=0x80; DS1302_CLK=1;delays(5);DS1302_CLK=0;}return dat;} /*****************************************************************************函数功能:写DS1302地址子程序入口参数:add入口数据:dat*****************************************************************************/void write_DS1302(uchar address,uchar dat){DS1302_RST=0;delays(10);DS1302_CLK=0;delays(10);DS1302_RST=1;delays(5);sendbyte(address);delays(5);sendbyte(dat);DS1302_RST=0;DS1302_CLK=0;}/*****************************************************************************函数功能:读DS1302地址子程序入口参数:add出口参数:readtimeR[]*****************************************************************************/uchar read_DS1302(uchar address){ uchar timer;DS1302_RST=0;delays(2);DS1302_CLK=0;delays(2);DS1302_RST=1;sendbyte(address); timer=readbyte();DS1302_RST=0;DS1302_CLK=0;return timer;}/*****************************************************************************函数功能:初始化DS1302子程序入口参数:wr_data[](全局变量)出口参数:*****************************************************************************/void DS1302_init(){write_DS1302(0xbe,0x00);write_DS1302(0x8e,0x00); //关闭保护,若写0x80,则开启保护write_DS1302(0x8c,wr_data[0]); //年write_DS1302(0x88,wr_data[1]); //月write_DS1302(0x86,wr_data[2]); //日 write_DS1302(0x8A,wr_data[3]); //星期write_DS1302(0x84,wr_data[4]); //时write_DS1302(0x82,wr_data[5]); //分write_DS1302(0x80,wr_data[6]); //秒 write_DS1302(0x8e,0x80);}/*****************************************************************************函数功能:读DS1302时间子程序入口参数:出口参数:全局变量(year,mouth,data,day,hour,minute,second)*****************************************************************************/void read_time(void){readtimeR[0]=read_DS1302(0x8d); //年readtimeR[1]=read_DS1302(0x89); //月readtimeR[2]=read_DS1302(0x87); //日readtimeR[3]=read_DS1302(0x8b); //周readtimeR[4]=read_DS1302(0x85); //时readtimeR[5]=read_DS1302(0x83); //分readtimeR[6]=read_DS1302(0x81); //秒}void ms(){ e=readtimeR[5]>>4;f=readtimeR[5]&0x0f;g=readtimeR[6]>>4;h=readtimeR[6]&0x0f;P2=0xfc;P0=table[e];delays(500);P2=0xfd;P0=table[f];delays(500);P2=0xfB;P0=table[g];delays(500);P2=0xf7;P0=table[h];delays(500);}void hm(){ c=readtimeR[4]>>4;d=readtimeR[4]&0x0f; e=readtimeR[5]>>4;f=readtimeR[5]&0x0f; P2=0xfc;P0=table[c];delays(500);P2=0xfd;P0=table[d];delays(500); P2=0xfb;P0=table[e];delays(500);P2=0xf7;P0=table[f];delays(500);}void main(){DS1302_init();while(1){read_time();// a=readtimeR[3]>>4;// b=readtimeR[3]&0x0f;/* P2=0xf8;P0=table[a];delays(500);P2=0xf9;P0=table[b];delays(500);*/// ms();hm();}}

阅读全文

与单片机的数字万年历系统设计摘要相关的资料

热点内容
国内程序员女高管 浏览:881
程序员会压抑 浏览:682
物探编程 浏览:302
vuepdf预览 浏览:327
迷你世界出编程软件了 浏览:673
res文件夹有哪些 浏览:142
交通信号灯单片机课程设计 浏览:826
如何测试流媒体服务器的并发能力 浏览:161
溯源码有分国家认证的吗 浏览:218
如何通过app查询产检报告 浏览:944
拉结尔安卓手机怎么用 浏览:695
驱动级进程代理源码 浏览:782
androidshape画线 浏览:511
程序员想辞职被拒绝 浏览:101
java面试逻辑 浏览:749
如何下载全英文app 浏览:724
js函数式编程指南 浏览:380
为什么安卓手机相机启动会卡 浏览:341
python中t是什么意思 浏览:765
移动硬盘内存加密 浏览:407