×

时钟芯片ds12c887的C51驱动程序

消耗积分:0 | 格式:rar | 大小:5.69 MB | 2011-06-03

分享资料个

文件名称:ds12c887.c
适用范围:时钟芯片ds12c887的驱动程序
*************************************************************/
#i nclude
/* 命令常量定义*/
#define CMD_START_DS12C887 0x20 /* 开启时钟芯片
*/
#define CMD_START_OSCILLATOR 0x70 /* 开启振荡器,
处于抑制状态*/
#define CMD_CLOSE_DS12C887 0x30 /* 关掉时钟芯片
*/
/* 所有的置位使用或操作,清除使用与操作*/
#define MASK_SETB_SET 0x80 /* 禁止刷新*/
#define MASK_CLR_SET 0x7f /* 使能刷新*/
#define MASK_SETB_DM 0x04 /* 使用HEX格式
*/
#define MASK_CLR_DM 0xfb /* 使
用BCD码格式*/
#define MASK_SETB_2412 0x02 /* 使
用24小时模式*/
#define MASK_CLR_2412 0xfd /* 使用12小时模
式*/
#define MASK_SETB_DSE 0x01 /* 使用夏令时*/
#define MASK_CLR_DSE 0xfe /* 不使用夏令时
*/
/* 寄存器地址通道定义*/
xdata char chSecondsChannel _at_ 0xdf00;
xdata char chMinutesChannel _at_ 0xdf02;
xdata char chHoursChannel _at_ 0xdf04;
xdata char chDofWChannel _at_ 0xdf06;
xdata char chDateChannel _at_ 0xdf07;
xdata char chMonthChannel _at_ 0xdf08;
xdata char chYearChannel _at_ 0xdf09;

 

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(4)
发评论
-sky- 2015-04-15
0 回复 举报
谢谢、 收起回复
zhaoye2 2014-12-10
0 回复 举报
学习。。。。。。。。。 收起回复
全部评论

下载排行榜

全部4条评论

快来发表一下你的评论吧 !