24c16的读写程序.docx
《24c16的读写程序.docx》由会员分享,可在线阅读,更多相关《24c16的读写程序.docx(4页珍藏版)》请在三一办公上搜索。
1、24c16的读写程序/ /24c16读写驱动程序, /=- - /*模块调用: 读数据:read(unsigned int address) 写数据:write(unsigned int address,unsigned char dd) dd为要写的 数据字节*/ /- - sbit sda=P30; sbit scl=P31; sbit a0=ACC0; /定义ACC的位,利用ACC操作 速度最快 sbit a1=ACC1; sbit a2=ACC2; sbit a3=ACC3; sbit a4=ACC4; sbit a5=ACC5; sbit a6=ACC6; sbit a7=ACC7;
2、 /- - #pragma disable void s24(void) /起始函数 _nop_; scl=0; sda=1; scl=1; _nop_; sda=0; _nop_; _nop_; scl=0; _nop_; _nop_; sda=1; /- - #pragma disable void p24(void) /停止函数 sda=0; scl=1; _nop_; _nop_; sda=1; /- - #pragma disable unsigned char rd24(void) /从24c16读一字节数据 ACC=0x00; sda=1; scl=1;a7=sda;_nop_;
3、_nop_;_nop_;_nop_;scl=0; scl=1;a6=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a5=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a4=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a3=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a2=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a1=sda;_nop_;_nop_;_nop_;_nop_;scl=0; scl=1;a0=sd
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 24 c16 读写 程序
链接地址:https://www.31ppt.com/p-3059013.html