单片机c51读写程序.doc
《单片机c51读写程序.doc》由会员分享,可在线阅读,更多相关《单片机c51读写程序.doc(8页珍藏版)》请在三一办公上搜索。
1、 93c46读写程序:/已验证可行/*-HELLO.CCopyright 1995-1999 Keil Software, Inc.-*/#include /* special function register declarations */ /* for the intended 8051 derivative */#include /* prototype declarations for I/O functions */#ifdef MONITOR51 /* Debugging with Monitor-51 needs */char code reserve 3 _at_ 0x23;
2、 /* space for serial interrupt if */#endif /* Stop Exection with Serial Intr. */ /* is enabled */#define uchar unsigned char#define uint unsigned intunsigned char code num10=0x18,0x7b,0x2c,0x29,0x4b,0x89,0x88,0x3b,0x08,0x09;/ 显示段码值09unsigned char code xuanze4=0x7f,0xbf,0xdf,0xef;sbit dp0= P27;sbit d
3、p1= P26;sbit dp2= P25;sbit dp3= P24;sbit CS=P12;sbit SK=P14;sbit DI=P11;sbit DO=P15;char dpt;unsigned char dpbuf4=0,0,0,0;void delay(void)unsigned int x,y;for (x=0;x200;x+)for (y=0;y200;y+);void shift1(uchar num,uchar sdata) unsigned char i;for(i=0;inum;i+) SK=0;sdata=1;DI=CY;SK=1;void shift2(uchar
4、num,uchar sdata) unsigned char i;sdata=1;for(i=0;inum;i+) SK=0;sdata=1;DI=CY;SK=1;void write_en(void) unsigned char sb_op=0x80,add=0xc0; CS=0; CS=1; shift1(3,sb_op);shift1(7,add);CS=0;CS=1;void erase_all(void) unsigned char sb_op=0x80,add=0x80; CS=0; CS=1;shift1(3,sb_op);shift1(7,add);CS=0;CS=1;whil
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 单片机 c51 读写 程序
链接地址:https://www.31ppt.com/p-4133817.html