- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
单片机C语言_1602液晶显示器上显示24c02储存数据(国外英文资料)
单片机C语言_1602液晶显示器上显示24c02储存数据(国外英文资料)
/ * * * * * * * * * * * * * * * * * * * * * include the header file * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
# include reg52. H
# include intrins. H
# define uchar unsigned char
# define uint unsigned int
/ * * * * * * * * * * * * * * * * * * * * * definition LCD port * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * LCD RS, RW, EN are P2.6, P2.5, P2.7 port * /
/ * P0.0 - port D0 - D7 * /
The sda and SCL terminals of / * 24c02 are followed by P2.0 and P2.1 * /
/ * 24c02 VCC terminal + 5V, GND, A0, A1, A2, and WP are all GND * /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
Sbit LCD_RS = P2 ^ 6;
Sbit LCD_RW = P2 ^ 5;
Sbit LCD_EN = P2 ^ 7;
Sbit sda = P2 ^ 0;
Sbit SCL = P2 ^ 1;
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * * /
/ * delay subroutine * /
/ * * /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
# define delayNOP (); {_nop_ (); _nop_ (); _nop_ (); _nop_ (); };
Void delay2 ()
{; }
Void delay (uchar x)
{uchar j;
While (x -)! = 0)
{for (j = 0; j 125; j + +)
{; }
}
}
Void delay1 (uchar x)
{
Uchar a, b;
For (a = x; a ; a --)
B is equal to 100.
}
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/ * * /
24 our fleet set * / / * memory chips
/ * * /
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
Void start () / / start signal
{
Sda = 1;
Delay2 ();
SCL = 1;
Delay2 ();
Sda = 0;
Delay2 ();
}
Void stop () / / stop signal
{
Sda = 0;
Delay2 ();
SCL = 1;
Delay2 ();
Sda = 1;
Delay2 ();
}
Void respons () / / reply signal
{
Uchar I;
SCL = 1;
Delay2 ();
While (sda = = 1) (I 250)) / / sda is the default reply aft
文档评论(0)