DS12C887.rar

  • PUDN用户
    了解作者
  • Visual C++
    开发工具
  • 72KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 13
    下载次数
  • 2014-07-01 16:08
    上传日期
该程序基于STC89C52的DS12C887时钟程序,测试通过,且能稳定运行,请放心使用。
DS12C887.rar
  • DS12C887
  • real-time clock.uvgui.lenovo
    71.3KB
  • main.c
    1.5KB
  • real-time clock.plg
    190B
  • delay.OBJ
    1.6KB
  • keyscan.LST
    47.8KB
  • lcd12864.c
    2.9KB
  • real-time clock.hex
    10.7KB
  • ds1302.c
    1.5KB
  • real-time clock.lnp
    127B
  • ring.c
    439B
  • delay.LST
    1.5KB
  • lcd12864.LST
    7.1KB
  • real-time clock
    40.9KB
  • keyscan.c
    14KB
  • real-time clock_uvopt.bak
    10.2KB
  • real-time clock.M51
    41.9KB
  • ds18b20.OBJ
    6KB
  • ds1302.LST
    4.1KB
  • define.h
    1.7KB
  • lcd12864.OBJ
    6.8KB
  • ds18b20.LST
    5.2KB
  • delay.c
    447B
  • keyscan.OBJ
    23.3KB
  • ring.LST
    1.5KB
  • real-time clock.uvproj
    13.9KB
  • ring.OBJ
    2.4KB
  • real-time clock.uvopt
    10.2KB
  • ds1302.OBJ
    3.5KB
  • main.LST
    4KB
  • real-time clock_uvproj.bak
    13.9KB
  • real-time clock.uvgui_lenovo.bak
    70.7KB
  • main.OBJ
    3.8KB
  • ds18b20.c
    2.2KB
内容介绍
/*************************************************** 键盘扫描源文件(.C) **************************************************/ #include"define.h" //函数申明头文件包含 #include<reg52.h> //包含52头文件 extern uchar table1[],table2[],table3[],table4[],table8[]; //全局调用变量 sbit key_set_time=P0^7; //设置时间键位定义 sbit key_up=P0^6; //上加键位定义 sbit key_down=P0^3; //下减键位定义 sbit key_back=P0^5; sbit key_set_alarm=P0^4; uchar flag_time,count_time; //申明标志位,计数值变量 uchar flag_alarm,count_alarm,flag_set_alarm,alarm_shi,alarm_fen; /*************************************************** 键盘扫描函数 **************************************************/ void time_keyscan(void) { uchar nian,zhou,yue,ri,shi,fen; if(key_set_time==0) { delay_1ms(5); //消抖 if(key_set_time==0) { display(0x94,"00"); write_lcd_comd(0x0e); //开光标并闪烁 count_time++; //计数 flag_time=1; //标志位置位 while(!key_set_time); //松手检测 write_1302(0x8e,0x00); //关写保护 write_1302(0x80,0x80); //停止时钟 write_1302(0x8e,0x80); //开写保护 } } if(count_time!=0) { switch(count_time) { case 1: display(0x90,""); //光标移至“时”调节位 if(key_up==0) { delay_1ms(5); //消抖 if(key_up==0) { write_1302(0x8e,0x00); //关写保护 shi=read_1302(0x85); //读取此刻“时”时值 shi++; //“时”加一 if(shi==24) //判断是否溢出 shi=0; while(!key_up); //松手检测 write_1302(0x84,shi); table2[0]=read_1302(0x85)/10+0x30; //读取调节后“时”的个位 table2[1]=read_1302(0x85)%10+0x30; //读取调节后“时”的十位 display(0x90,table2); //显示在LCD12864上 display(0x94,"00"); write_1302(0x8e,0x80); //打开写保护 } } if(key_down==0) { delay_1ms(5); //消抖 if(key_down==0) { write_1302(0x8e,0x00); //关写保护 shi=read_1302(0x85); //读取此刻“时”的值 shi--; //“时”减一 if(shi==-1) //判断是否溢出 shi=23; while(!key_down); //松手检测 write_1302(0x84,shi); //“时”调节后送回时钟 table2[0]=read_1302(0x85)/10+0x30; //读取调节后“时”的个位 table2[1]=read_1302(0x85)%10+0x30; //读取调节后“时”的十位 display(0x90,table2); //显示在LCD12864上 display(0x94,"00"); write_1302(0x8e,0x80); //打开写保护 } } if(key_back==0) //调时复位 { delay_1ms(5); if(key_back==0) { count_time=0; flag_time=0; //计数值清零,标志位复位 write_1302(0x8e,0x00); //关写保护 write_1302(0x80,0x00); //开时钟 write_1302(0x8e,0x80); //开写保护 write_lcd_comd(0x0c); //关光标 } } break; //跳出 case 2: /**************以下调节方式同“时”调节*******************/ display(0x92,""); if(key_up==0) { delay_1ms(5); if(key_up==0) { write_1302(0x8e,0x00); fen=read_1302(0x83); fen++; if(fen==60) fen=0; while(!key_up); write_1302(0x82,fen); table2[4]=read_1302(0x83)/10+0x30; table2[5]=read_1302(0x83)%10+0x30; display(0x90,table2); display(0x94,"00"); write_1302(0x8e,0x80); } } if(key_down==0) { delay_1ms(5); if(key_down==0) { write_1302(0x8e,0x00); fen=read_1302(0x83); fen--; if(fen==-1) fen=59; while(!key_down); write_1302(0x82,fen); table2[4]=read_1302(0x83)/10+0x30; table2[5]=read_1302(0x83)%10+0x30; display(0x90,table2); display(0x94,"00"); write_1302(0x8e,0x80); } } if(key_back==0) //调时复位 { delay_1ms(5); if(key_back==0) { count_time=0; flag_time=0; //计数值清零,标志位复位 write_1302(0x8e,0x00); //关写保护 write_1302(0x80,0x00); //开时钟 write_1302(0x8e,0x80); //开写保护 write_lcd_comd(0x0c); //关光标 } } break; case 3: display(0x89,""); if(key_up==0) { delay_1ms(5); if(key_up==0) { write_1302(0x8e,0x00); nian=read_1302(0x8d); nian++; if(nian==100) nian=0; while(!key_up); write_1302(0x8c,nian); table3[2]=read_1302(0x8d)/10+0x30; table3[3]=read_1302(0x8d)%10+0x30; display(0x88,table3); write_1302(0x8e,0x80); } } if(key_down==0) { delay_1ms(5); if(key_down==0) { write_1302(0x8e,0x00); nian=read_1302(0x8d); nian--; if(nian==-1) nian=99; while(!key_down); write_1302(0x8c,nian); table3[2]=read_1302(0x8d)/10+0x30; table3[3]=read_1302(0x8d)%10+0x30; display(0x88,table3); write_1302(0x8e,0x80); } } if(key_back==0) //调时复位 { delay_1ms(5); if(key_back==0) { count_time=0; flag_time=0; //计数值清零,标志位复位 write_1302(0x8e,0x00); //关写保护 write_1302(0x80,0x00); //开时钟 write_1302(0x8e,0x80); //开写保护 write_lcd_comd(0x0c); //关光标 } } break; case 4: display(0x8b,""); if(key_up==0) { delay_1ms(5); if(key_up==0) { write_1302(0x8e,0x00); yue=read_1302(0x89); yue++; if(yue==13) yue=1; while(!key_up); write_1302(0x88,yue); table3[6]=read_1302(0x89)/10+0x30; table3[7]=read_1302(0x89)%10+0x30; display(0x88,table3); write_1302(0x8e,0x80); } } if(key_down==0) { delay_1ms(5); if(key_down==0) { write_1302(0x8e,0x00); yue=read_1302(0x89); yue--; if(yue==0) yue=12; while(!key_down); write_1302(0x88,yue); table3[6]=read_1302(0x89)/10+0x30; table3[7]=read_1302(0x89)%10+0x30; display(0x88,table3); write_1302(0x8e,0x80); } } if(key_back==0) //调时复位 { delay_1ms(5); if(key_back==0) { count_time=0; flag_time=0; //计数值清零,标志位复位 write_1302(0x8e,0x00); //关写保护 write_1302(0x80,0x00); //开时钟 write_1302(0x8e,0x80); //开写保护 write_lcd_comd(0x0c); //关光标 } } break; case 5: display(0x8d,""); if(key_up==0) { delay_1ms(5); if(key_up==0) { write_1302(0x8e,0x00); ri=read_1302(0x87); ri++; if(ri==32) ri=1; while(!key_up); write_1302(0x86,ri); table3[10]=read_1302(0x87)/10+0x30; table3[11]=read_1302(0x87)%10+0x30; display(0x88,table3); write_1302(0x8e,0x80); } } if(key_down==0) { delay_1ms(5); if(key_down==0) { write_1302(0x8e,0x00); ri=read_1302(0x87); ri--; if(ri==0) ri=31;
评论
    相关推荐
    • DS12C887.rar
      ds12cr887源程序,亲测可用。可以实现精确计时,闹钟定时等功能。
    • ds12c887时钟.rar
      51单片机驱动DS12C887时钟芯片制作的LCD时钟,有温湿度,农历显示
    • ds12c887.zip
      实时时钟ds12c887驱动程序,atmega128平台测试通过
    • DS12c887.zip
      C51程序运用stc12c5a系列的单片机即可驱动,DS12c887时钟芯片的正常工作,利用共阴数码管显示。已测试完成。
    • RTC_DS12C887.zip
      使用keil编程,用51单片机和DS12C887芯片实现实时时钟
    • DS12C887.zip
      DS12C887是一款时钟芯片,精度高,误差小。驱动简单。
    • AT89C52+DS12C887
      DS12C887时钟芯片 DS18B20温度传感器 74HC595,UN2803静态驱动 光敏电阻+STC12C2052AD PWM(光耦+P-MOS)自动亮度调节 旋转编码器调节 短按调时,长按(5秒)调参数,调节时长按退出。 参数说明:C1正负校准,C2每天校准...
    • DS12C887程序
      DS12C887程序.可以助你一臂之力。C语言更能懂
    • 仿真 ds12c887时钟芯片
      ds12c887时钟芯片仿真 ,c语言写的,参照郭天详
    • DS12C887时钟51程序
      压缩包包括调好的DS12C887时钟51单片机的C语言程序,以及需要的参考资料。