㈠ 电子万年历 毕业设计基于单片机控制的电子万年历 开题报告
直接使用MCU自己做高时钟是不可靠的,建议使用DS1302或者DS12887等专用的时钟芯片来完成时钟部分,MCU用于人机交互就OK了,想再做复杂点的话可以见一片语音合成芯片(例如SN6288)进行语音报时等功能。
㈡ 急需单片机的电子时钟硬件设计及开题报告!十万火急!!!
单片机课程设计(报告):带语音报时功能电子钟系统硬件设计
一、回 设计内容及要求:答
1. 根据设计要求,完成带语音报时功能电子钟系统硬件设计,并用电子CAD软件绘制出原理图,编辑、绘制出PCB印制版。
要求:
(1) 原理图中元件电气图形符号符合国家标准;
(2) 整体布局合理,注标规范、明确、美观,不产生歧义。
(3) 列出完整的元件清单(标号、型号及大小、封装形式、数量)
(4) 图纸幅面为A4。
(4) 布局、布线规范合理,满足电磁兼容性要求。
(5) 在元件面的丝印层上,给出标号、型号或大小。所有注释信息(包括标号、型号及说明性文字)要规范、明确,不产生歧义。
2. 编写并调试驱动程序。
㈢ 哪位有基于单片机的多功能数字电子钟的开题报告
源程序如下:ORG0000H;程序开始入口LJMPSTARTORG0003H;外中断0中断程序入口RETIORG000BH;定时器T0中断程序入口LJMPINTT0;跳至INTTO执行ORG0013H;外中断1中断程序入口RETIORG001BH;定时器T1中断程序入口LJMPINTT1ORG0023H;串行中断程序入口地址RETI;---------------主程序----------------------;START:MOVR0,#70H;70给R0,清70-7FH显示内存MOVR7,#0FHCLEARDISP:MOV@R0,#00H;0给R0中的数为地址的内存中存放(70H)INCR0DJNZR7,CLEARDISPMOV78H,#2;默认时间为12:00,闹钟5:00MOV79H,#1MOV74H,#2;防止上电时数码管显示00小时MOV75H,#1MOV66H,#1;中断退出时66H为1时,分、时计时单元数据移入显存标志MOV68H,#1;上电默认闹钟开状态MOV7DH,#6;闹钟时十位MOV7CH,#3MOV69H,#0MOV7AH,#0AH;放入"熄灭符"数据MOVTMOD,#11H;设T0、T1为16位定时器MOVTL0,#0B0H;50MS定时初值(T0计时用)MOVTH0,#3CHSETBEA;总中断开放SETBET0;允许T0中断SETBTR0;T0定时器开始计时MOVR4,#14H;1秒定时用初值(50MS×20)START1:LCALLDISPLAY;显示子程序LCALLBEEP;闹钟查询JNBP1.7,SETTIME;P1.7口为0时转时间调整程序JMPSTART1;P1.7口为1时跳回START1;-----------------------时间闹钟调整系统--------------------------;NFLAG:MOVA,68H;设置闹钟开关状态CJNEA,#1,BEE68MOV68H,#0JMPE6BEE68:MOV68H,#1E6:MOV66H,#8;中断退出66H不为1时分、时计时单元数据移入显存标志MOV72H,7BHMOV73H,7CHMOV74H,7DHMOV75H,7EHLCALLDDLLCALLDDLMOV72H,68HMOV73H,69HMOV74H,7AHMOV75H,7AHLCALLDDLLCALLDDLMOV66H,#1LJMPSTART1SETTIME:LCALLDDLJBP1.7,NFLAG;键按下时间小于1秒,设置闹钟开关状态并查看闹钟时间,不关走时,确保准确,大于1秒调时MOVTL1,#0B0H;T1闪烁定时初值MOVTH1,#3CHMOVR2,#06H;进入调时状态,赋闪烁定时初值MOV66H,#8;调闹钟时保持走时,关闭时钟显示数据SETBET1;允许T1中断SETBTR1;开启定时器T1SET1:LCALLDISPLAY;调用显示,防止键按下无显示JNBP1.7,SET1;P1.7口为0等待键释放MOVR5,#00H;清设置类型闪烁标志SETN1:INCR5;闹钟分调整SET5:LCALLDISPLAYJBP1.7,SET5SEETN1:LCALLDDL;有键按下大于1秒分时间连续加(0.5秒加1),小于1秒转调时状态JBP1.7,SET6;键释放查询,键释放自动转调时MOVR0,#7CHLCALLADD1MOVA,R3CLRCCJNEA,#60H,HHN1HHN1::INCR5;闹钟时调整SEET6:LCALLDISPLAYJBP1.7,SEET6SEETNH1:LCALLDDLJBP1.7,SETFMOVR0,#7EHLCALLADD1MOVA,R3CLRCCJNEA,#24H,HOUU1HOUU1::LCALLDISPLAYJBP1.7,SETFLCALLDDLJNBP1.7,SETOUT;短按调时,长按退出CLRET0CLRTR0MOV70H,#00H;设定后的时间从00秒开始走时MOV71H,#00HINCR5SET3:LCALLDISPLAYJBP1.7,SET3SETMM:LCALLDDLJBP1.7,SET4MOVR0,#77HLCALLADD1MOVA,R3CLRCCJNEA,#60H,MMHMMH:JCSETMMLCALLCLR0AJMPSETMMSET4:INCR5SEET4:LCALLDISPLAYJBP1.7,SEET4SETHH:LCALLDDLJBP1.7,SETOUT1MOVR0,#79HLCALLADD1MOVA,R3CLRCCJNEA,#24H,HOUUHOUU::SETBET0SETBTR0;计时开始SETOUT:MOVR5,#00H;清设置类型闪烁标志CLRTR1;关闭T1CLRET1;关T1中断MOV66H,#1SETOUT2:LCALLDISPLAYJNBP1.7,SETOUT2LJMPSTART1;--------------------------延时1秒钟-----------------------;DDL:MOV18H,#36DDL0:MOV17H,#239DDL1:LCALLDISPLAYDJNZ17H,DDL1DJNZ18H,DDL0RET;----------------------------T0中断程序------------------------;INTT0:PUSHACC;打包PUSHPSWCLRET0CLRTR0MOVA,#0B7HADDA,TL0MOVTL0,AMOVA,#3CHADDCA,TH0MOVTH0,ASETBTR0DJNZR4,OUTT0;20次中断未到中断退出ADDSS:MOVR4,#14H;20次中断到(1秒)重赋初值MOVR0,#71H;指向秒计时单元(70-71H)ACALLADD1;调用加1程序(加1秒操作)MOVA,R3;秒数据放入A(R3为2位十进制数组合)CLRC;清进位标志CJNEA,#60H,ADDMMADDMM:JCOUTT01;小于60秒退出ACALLCLR0;等于或大于60秒清0MOVR0,#77H;指向分计时单元(76H-77H)ACALLADD1MOVA,R3CLRCCJNEA,#60H,ADDHHADDHH:JCOUTT0ACALLCLR0MOVR0,#79H;指向小时计时单元(78H-79H)ACALLADD1MOVA,R3CLRCCJNEA,#24H,HOURHOUR:JCOUTT0ACALLCLR0OUTT0:MOVA,66H;查询标志CJNEA,#1,OUTT01MOV72H,76H;中断退出时将分、时计时单元数据移入对应显示单元MOV73H,77HMOV74H,78HMOV75H,79HOUTT01:POPPSW;出栈POPACCSETBET0;开放T0RETI;中断返回;---------------------------加1程序--------------------------;ADD1:MOVA,@R0;取当前计时单元数据到ADECR0;指向前一地址SWAPA;A中数据高四位与低四位交换ORLA,@R0;前一地址中数据放入A中低四位ADDA,#01H;A加1操作DAA;十进制调整MOVR3,A;移入R3寄存器ANLA,#0FH;高四位变0MOV@R0,A;放回前一地址单元MOVA,R3;取回R3中暂存数据INCR0;指向当前地址单元SWAPA;A中数据高四位与低四位交换ANLA,#0FH;高四位变0MOV@R0,A;数据放入当削地址单元中RETCLR0:CLRCCLRA;清累加器MOV@R0,A;清当前地址单元DECR0;指向前一地址MOV@R0,A;前一地址单元清0RET;子程序返回;-------------------------调时闪烁程序----------------------;INTT1:PUSHACCPUSHPSWMOVTL1,#0B0HMOVTH1,#3CHDJNZR2,INTT1OUT;0.3秒未到退出中断(50MS中断6次)MOVR2,#06H;重装0.3秒定时用初值CPL02H;0.3秒定时到对闪烁标志取反JB02H,FLASH1;02H位为1时显示单元"熄灭"MOVA,R5CJNEA,#01H,NLJMPNNN1NL:CJNEA,#02H,NL1LJMPNNN1NL1:CJNEA,#03H,NL2LJMPNLLNL2:CJNEA,#04H,INTT1OUTLJMPNLLNLL:MOV72H,76HMOV73H,77HMOV74H,78HMOV75H,79HAJMPINTT1OUTNNN1:MOV72H,7BHMOV73H,7CHMOV74H,7DHMOV75H,7EHINTT1OUT:POPPSW;恢复现场POPACCRETI;中断退出FLASH1:MOVA,R5CJNEA,#01H,MLLJMPMNN1ML:CJNEA,#02H,ML1LJMPMNN2ML1:CJNEA,#03H,MNLJMPMLLMN:CJNEA,#04H,INTT1OUTLJMPMHLMLL:MOV72H,7AHMOV73H,7AH;显示单元(72-73H),将不显示分数据MOV74H,78HMOV75H,79HAJMPINTT1OUTMHL:MOV72H,76HMOV73H,77HMOV74H,7AH;显示单元(74-75H),小时数据将不显示MOV75H,7AHAJMPINTT1OUTMNN1:MOV72H,7AHMOV73H,7AH;显示单元(72-73H),将不显示闹钟分数据MOV74H,7DHMOV75H,7EHAJMPINTT1OUTMNN2:MOV72H,7BHMOV73H,7CHMOV74H,7AHMOV75H,7AH;显示单元(74-75H),闹钟小时数据将不显示AJMPINTT1OUT;-------------------------显示-------------------------------;DISPLAY:MOVDPTR,#DISDATAMOVA,70HMOVCA,@A+DPTRMOVP3,ACLRP1.0NOPNOPNOPSETBP1.0MOVA,71HMOVCA,@A+DPTRMOVP3,ACLRP1.1NOPNOPNOPSETBP1.1MOVA,72HMOVCA,@A+DPTRMOVP3,ACLRP1.2NOPNOPNOPSETBP1.2MOVA,73HMOVCA,@A+DPTRMOVP3,ACLRP1.3NOPNOPNOPSETBP1.3MOVA,74HMOVCA,@A+DPTRMOVP3,ACLRP1.4NOPNOPNOPSETBP1.4MOVA,75HMOVCA,@A+DPTRMOVP3,ACLRP1.5NOPNOPNOPSETBP1.5RETBEEP:MOVA,68H;查询标志CJNEA,#1,BEEREMOVA,78H;查询闹钟时个位CJNEA,7DH,BEEREMOVA,79H;查询闹钟时十位CJNEA,7EH,BEEREMOVA,76H;查询闹钟分个位CJNEA,7BH,BEEREMOVA,77H;查询闹钟分十位CJNEA,7CH,BEEREBB:CLRP1.6LCALLDDLSETBP1.6LCALLDDLJNBP1.7,BEERRBEERE:RETBEERR:SETBP1.6MOV68H,#0LCALLDISPLAYJNBP1.7,BEERRJMPBEEREDISDATA:DB0C0H,0F9H,64H,70H,59H,52H,42H,0F8H,40H,50H,0FFH;0123456789空白END
㈣ 基于MSP430单片机的电子万年历
//==========直接上代码吧
//===============LCD12887_1.C 主文件
/*--------------------------------------------------------------*/
//包含头文件
#include<AT89X52.H>
#include"LCD1602_8.H"
#include"DS12887_1.H"
/*--------------------------------------------------------------*/
unsigned char k; //键值
unsigned char Set; //调整值
/*--------------------------------------------------------------*/
//延时200ms 函数定义
void delay200ms(void)
{
unsigned char i,j,k;
for(i=201;i>0;i--)
for(j=32;j>0;j--)
for(k=14;k>0;k--);
}
/*--------------------------------------------------------------*/
//延时5000+0us 函数定义
void delay5ms(void)
{
unsigned char i,j;
for(i=185;i>0;i--)
for(j=12;j>0;j--);
}
/*--------------------------------------------------------------*/
//键盘扫描
void Keysan(void) //P0_0切换键,P0_1数值加,P0_1数值减
{
if(P0_0 == 0)
{
delay5ms();
if(P0_0 == 0) k++;
if(k == 7) k = 0;
}
if(P0_1 == 0) {delay5ms(); if(P0_1 == 0) Set++;}
if(P0_2 == 0) {delay5ms(); if(P0_2 == 0) Set--;}
switch(k)
{
case 0: DS12887_SetTime(DS12887_Second, Set); if(Set > 59 || Set < 0) Set = 0; break;
case 1: DS12887_SetTime(DS12887_Minute, Set); if(Set > 59 || Set < 0) Set = 0; break;
case 2: DS12887_SetTime(DS12887_Hour , Set); if(Set > 24 || Set < 0) Set = 0; break;
case 3: DS12887_SetTime(DS12887_Day , Set); if(Set > 31 || Set < 0) Set = 0; break;
case 4: DS12887_SetTime(DS12887_Month , Set); if(Set > 12 || Set < 0) Set = 0; break;
case 5: DS12887_SetTime(DS12887_Year , Set);break;
default: break;
}
}
/*--------------------------------------------------------------*/
//主函数
void main(void)
{
SYSTEMTIME CurrentTime;
lcd_init();
DS12887_Init();
lcd_pos(0,0);
prints("Date:");
lcd_pos(0,1);
prints("Time:");
k = 6; //不改变时间
while(1)
{
DS12887_GetTime(&CurrentTime);
DateToStr(&CurrentTime);
TimeToStr(&CurrentTime);
lcd_pos(6,0);
prints(CurrentTime.DateString);
lcd_pos(6,1);
prints(CurrentTime.TimeString);
delay200ms();
Keysan();
}
}
//=======================包含文件1 LCD1602_8.H
/*--------------------------------------------------------------*/
//包含头文件
#include<AT89X52.H>
#include"LCD1602_8.H"
#include"DS12887_1.H"
/*--------------------------------------------------------------*/
unsigned char k; //键值
unsigned char Set; //调整值
/*--------------------------------------------------------------*/
//延时200ms 函数定义
void delay200ms(void)
{
unsigned char i,j,k;
for(i=201;i>0;i--)
for(j=32;j>0;j--)
for(k=14;k>0;k--);
}
/*--------------------------------------------------------------*/
//延时5000+0us 函数定义
void delay5ms(void)
{
unsigned char i,j;
for(i=185;i>0;i--)
for(j=12;j>0;j--);
}
/*--------------------------------------------------------------*/
//键盘扫描
void Keysan(void) //P0_0切换键,P0_1数值加,P0_1数值减
{
if(P0_0 == 0)
{
delay5ms();
if(P0_0 == 0) k++;
if(k == 7) k = 0;
}
if(P0_1 == 0) {delay5ms(); if(P0_1 == 0) Set++;}
if(P0_2 == 0) {delay5ms(); if(P0_2 == 0) Set--;}
switch(k)
{
case 0: DS12887_SetTime(DS12887_Second, Set); if(Set > 59 || Set < 0) Set = 0; break;
case 1: DS12887_SetTime(DS12887_Minute, Set); if(Set > 59 || Set < 0) Set = 0; break;
case 2: DS12887_SetTime(DS12887_Hour , Set); if(Set > 24 || Set < 0) Set = 0; break;
case 3: DS12887_SetTime(DS12887_Day , Set); if(Set > 31 || Set < 0) Set = 0; break;
case 4: DS12887_SetTime(DS12887_Month , Set); if(Set > 12 || Set < 0) Set = 0; break;
case 5: DS12887_SetTime(DS12887_Year , Set);break;
default: break;
}
}
/*--------------------------------------------------------------*/
//主函数
void main(void)
{
SYSTEMTIME CurrentTime;
lcd_init();
DS12887_Init();
lcd_pos(0,0);
prints("Date:");
lcd_pos(0,1);
prints("Time:");
k = 6; //不改变时间
while(1)
{
DS12887_GetTime(&CurrentTime);
DateToStr(&CurrentTime);
TimeToStr(&CurrentTime);
lcd_pos(6,0);
prints(CurrentTime.DateString);
lcd_pos(6,1);
prints(CurrentTime.TimeString);
delay200ms();
Keysan();
}
}
//================================ 包含文件2 DS12887_1.H
/*--------------------------------------------------------------*/
//File: DS12887驱动程序
//Date: 08-10-20 ~ 10-23
//Time: 21:20 ~ 16:53
//Source: Web
/*--------------------------------------------------------------*/
#ifndef __DS12887_1_H__
#define __DS12887_1_H__
/*--------------------------------------------------------------*/
//接口定义
sbit DS_AS = P3^0; //地址选择
sbit DS_RW = P3^1; //读写选择
sbit DS_DS = P3^2; //数据选择
sbit DS_IRQ = P3^3; //中断,低电平有效,通过读出0x0c来清除信号
sfr DS_DAT = 0x90; //8位数据线P1口
/*--------------------------------------------------------------*/
//数据地址定义
#define DS12887_Second 0x00 //秒
#define DS12887_Minute 0x02 //分
#define DS12887_Hour 0x04 //时
#define DS12887_Week 0x06 //星期
#define DS12887_Day 0x07 //日
#define DS12887_Month 0x08 //月
#define DS12887_Year 0x09 //年
/*--------------------------------------------------------------*/
//定义时间类型
typedef struct _SYSTEMTIME_
{
unsigned char Second;
unsigned char Minute;
unsigned char Hour;
unsigned char Week;
unsigned char Day;
unsigned char Month;
unsigned char Year;
unsigned char DateString[9];
unsigned char TimeString[9];
}SYSTEMTIME;
/*--------------------------------------------------------------*/
//函数声明
void DS12887_Init(void); //DS12887初始化
void DS12887_Write(unsigned char Address, unsigned char Value); //DS12887指定地址写入数据
unsigned char DS12887_Read(unsigned char Address); //DS12887指定地址中读出数据
void DS12887_SetTime(unsigned char Address, unsigned char Value); //设置时间函数
void DS12887_GetTime(SYSTEMTIME *Time); //读出时间
void DateToStr(SYSTEMTIME *Time); //日期转化成字符
void TimeToStr(SYSTEMTIME *Time); //时间转化成字符
/*--------------------------------------------------------------*/
//DS12887指定地址写入数据
void DS12887_Write(unsigned char Address, unsigned char Value)
{
DS_AS = 0;
DS_DS = 1;
DS_RW = 1;
DS_AS = 1;
DS_DAT= Address;
DS_AS = 0;
DS_RW = 0;
DS_DAT= Value;
DS_RW = 1;
DS_AS = 1;
}
/*--------------------------------------------------------------*/
//DS12887指定地址中读出数据
unsigned char DS12887_Read(unsigned char Address)
{
unsigned char DS_RDAT;
DS_AS = 0;
DS_DS = 1;
DS_RW = 1;
DS_AS = 1;
DS_DAT= Address;
DS_AS = 0;
DS_DS = 0;
DS_DAT=0xff;
DS_RDAT = DS_DAT;
DS_DS = 1;
DS_AS = 1;
return (DS_RDAT);
}
/*--------------------------------------------------------------*/
//DS12887初始化
void DS12887_Init(void)
{
DS12887_Write(0x0a, 0x20); //启动DS12887
DS12887_Write(0x0b, 0x86); //禁止更新,接下来初始化数据,即写入时间,日期等
DS12887_Write(0x0b, 0x06); //正常更新,二进制格式,24进制小时
}
/*--------------------------------------------------------------*/
//设置时间函数
void DS12887_SetTime(unsigned char Address, unsigned char Value)
{
DS12887_Write(0x0b, 0x86); //禁止更新,接下来初始化数据,即写入时间,日期等
DS12887_Write(Address,Value);
DS12887_Write(0x0b, 0x06); //正常更新,二进制格式,24进制小时
}
/*--------------------------------------------------------------*/
//读出时间
void DS12887_GetTime(SYSTEMTIME *Time)
{
Time->Second = DS12887_Read(DS12887_Second);
Time->Minute = DS12887_Read(DS12887_Minute);
Time->Hour = DS12887_Read(DS12887_Hour );
Time->Day = DS12887_Read(DS12887_Day );
Time->Week = DS12887_Read(DS12887_Week );
Time->Month = DS12887_Read(DS12887_Month );
Time->Year = DS12887_Read(DS12887_Year );
}
/*--------------------------------------------------------------*/
//日期转化成字符
void DateToStr(SYSTEMTIME *Time)
{
Time->DateString[0] = Time->Year/10 + '0';
Time->DateString[1] = Time->Year%10 + '0';
Time->DateString[2] = '-';
Time->DateString[3] = Time->Month/10 + '0';
Time->DateString[4] = Time->Month%10 + '0';
Time->DateString[5] = '-';
Time->DateString[6] = Time->Day/10 + '0';
Time->DateString[7] = Time->Day%10 + '0';
Time->DateString[8] = '\0';
}
/*--------------------------------------------------------------*/
//时间转化成字符
void TimeToStr(SYSTEMTIME *Time)
{
Time->TimeString[0] = Time->Hour/10 + '0';
Time->TimeString[1] = Time->Hour%10 + '0';
Time->TimeString[2] = ':';
Time->TimeString[3] = Time->Minute/10 + '0';
Time->TimeString[4] = Time->Minute%10 + '0';
Time->TimeString[5] = ':';
Time->TimeString[6] = Time->Second/10 + '0';
Time->TimeString[7] = Time->Second%10 + '0';
Time->TimeString[8] = '\0';
}
/*--------------------------------------------------------------*/
#endif
/*--------------------------------------------------------------*/
//File: LCD1602_8.H
//Date: 08-7-29
//Time: 16:09
//Note: LCD1602 Mini Driver.
/*--------------------------------------------------------------*/
#ifndef __LCD1602_8_H__
#define __LCD1602_8_H__
#include <intrins.h>
/*--------------------------------------------------------------*/
//LCD接口定义
sfr io = 0xA0; //P0-0x80,P1-0x90,P2-0xA0,P3-0xB0;
sbit rs = P3^4; //LCD数据/命令选择端(H/L)
sbit rw = P3^5; //LCD读/写选择端(H/L)
sbit ep = P3^6; //LCD使能控制
sbit bz = io^7; //LCD忙标志位
/*--------------------------------------------------------------*/
//函数声明
void lcd_busy(void); //测试LCD忙碌状态程序
void lcd_wcmd(unsigned char cmd); //写入指令到LCD程序
void lcd_wdat(unsigned char dat); //写入数据到LCD程序
void lcd_pos (unsigned char x, bit y); //LCD数据指针位置程序
//void printc(unsigned char CHAR); //显示字符
void prints(unsigned char *string); //显示字符串
void lcd_init(void); //LCD初始化设定程序
/*--------------------------------------------------------------*/
//测试LCD忙碌状态
void lcd_busy(void)
{
do{
ep = 0;
rs = 0; //指令
rw = 1; //读出
io = 0xff;
ep = 1;
_nop_(); //高电平读出 1us
}while(bz); //bz=1表示忙,bz=0表示空闲
ep = 0;
}
/*--------------------------------------------------------------*/
//写入指令到LCD
void lcd_wcmd(unsigned char cmd)
{
lcd_busy(); //检测忙
rs = 0; //指令
rw = 0; //写入
ep = 1;
io = cmd; //指令
ep = 0; //下降沿有效
}
/*--------------------------------------------------------------*/
//写入数据函数
void lcd_wdat(unsigned char Data)
{
lcd_busy(); //检测忙
rs = 1; //数据
rw = 0; //写入
ep = 1;
io = Data; //数据
ep = 0; //下降沿有效
}
/*--------------------------------------------------------------*/
//LCD数据指针位置程序
void lcd_pos(unsigned char x, bit y)
{
if(y)lcd_wcmd(x|0xc0); //y=1,第二行显示;y=0,第一行显示 0<=x<16
else lcd_wcmd(x|0x80); //数据指针=80+地址码(00H~27H,40H~67H)
}
/*--------------------------------------------------------------*/
//显示字符
/*
void printc(unsigned char CHAR)
{
lcd_wdat(CHAR);
}
*/
/*--------------------------------------------------------------*/
//显示字符串
void prints(unsigned char *string)
{
while(*string) {lcd_wdat(*string);string++;}
}
/*--------------------------------------------------------------*/
//LCD初始化设定
void lcd_init()
{
lcd_wcmd(0x38); //设置LCD为16X2显示,5X7点阵,八位数据接口
lcd_wcmd(0x06); //LCD显示光标移动设置(光标地址指针加1,整屏显示不移动)
lcd_wcmd(0x0c); //LCD开显示及光标设置(光标不闪烁,不显示"_")
lcd_wcmd(0x01); //清除LCD的显示内容
}
/*--------------------------------------------------------------*/
#endif
以下是相应的说明:
8根并行数据线+三根控制信号线~就可以咯~
按键接法(按键的另一条腿接到GND上):
P0_0切换键,
P0_1数值加,
P0_1数值减
时钟日历管脚接法:
sbit DS_AS = P3^0; //地址选择
sbit DS_RW = P3^1; //读写选择
sbit DS_DS = P3^2; //数据选择
sbit DS_IRQ = P3^3; //中断,低电平有效,通过读出0x0c来清除信号
sfr DS_DAT = 0x90; //8位数据线P1口
液晶管脚接法:
sfr io = 0xA0; //液晶数据口 P2-0xA0; --D0-D7
sbit rs = P3^4; //LCD数据/命令选择端(H/L) --RS / DI
sbit rw = P3^5; //LCD读/写选择端(H/L) --RW
sbit ep = P3^6; //LCD使能控制 --EN
sbit bz = io^7; //LCD忙标志位(不用再接)
DS12887的RST接在VCC, CS接在GND, IRQ不用管, MOT悬空即可~也即选择默认的Intel 工作方式
㈤ 基于单片机的数字时钟设计开题报告
这么简单的问题还要找人要?自己不能动下脑子?就这样还指望学会单片机呢?要多动手,自己思考这样做出的东西才是自己的。
㈥ 单片机设计多功能电子钟要研究或解决的问题以及拟采用的研究手段(途径)(论文开题报告用)
已经发到你的邮箱 请查阅
㈦ 基于单片机电子时钟设计的开题报告怎样写
电动智能小车(完整论文) 电子时钟 电气工程系06届毕业设计开题报告内 自动容加料机控制系统 门控自动照明电路 电子设计大赛点阵电子显示屏(A题) 目录.txt
http://www..com/s?cl=3&wd=33%B8%F6%B5%A5%C6%AC%BB%FA%C9%E8%BC%C6%20%20%CB%D1%CB%F7
㈧ 单片机制作万年历主要技术和方法
可以自己模拟一个时钟,也可以使用单片机内部的时钟功能寄存器(部分支持),最好的是使用相关时钟芯片,这个时间很准,加上备用电池就是一个时钟了,万年历也同时支持,
再就是硬件制作了,需要很多元器件,