[17] Anon. Embedded systems. Electronic Design,2002, 50(3): 74~75
[18] Iain. Liu, Steve. Real-time embedded systems. Computing and Control Bate, Engineering Journal,2002, 13(4): 154~155
[19] Compatible 8-Bit A/D Converter with 8-Channel Multiplexer Datasheet.
[20] Jerraya,A.A.;Wolf,W. Hardware/software interface code sign for embedded systems. Computer, 2005, 38(2): 9~63. [21] Keil Elektronic GmbH. Keil C51 Manual.
[22] Lei Jian,Luo Kelu.Architecture of embedded system simulation development platform. Journal of Information and Computation Science, 2004,1(3): 129~134. [23] Labcenter Electronics Ltd. Proteus Introduction.
致 谢
附录A
#include
#define NNOP NOP;NOP;NOP;NOP;NOP void I2C_Start(); void I2C_Stop(); void Ack_I2C();
bit ISendB(uchar sla,uchar c); bit IRcvB(uchar sla,uchar *c);
bit ISendStr(uchar sla,uchar sub,uchar *s,uchar n); bit IRcvStr(uchar sla,uchar sub,uchar *s,uchar n);
void Delay(uchar);
uchar code ledcode[] = {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
/* == == == == == == == == == == == == == == == == == == 全局变量定义&位定义
== == == == == == == == == == == == == == == == == == */ #define WaitTime #define state_null #define state_input #define state_find #define state_reset #define state_jingbao
3 //等待时间 3s 0 1 2 3 4
bit ack; sbit SDA=P3^5 ; sbit SCL=P3^4 ;
uchar code table[]={0x3f,0x06,0x5b,0x4f,0x66, //01234 0x6d,0x7d,0x07,0x7f,0x6f, //56789 0x3e,//U -10 0x73,//P -11 0x7c,//b -12 0x40 //-
}; uchar telephone[7]={0,1,2,3,4,5,6}; uchar sec; //定义计数值,每过一秒加1 uint tcnt; //定时中断次数
sbit gewei=P2^0; //个位选通定义 sbit shiwei=P2^1; //十位选通定义
sbit key_input =P1^0; //输号 sbit key_find =P1^1; //查号 sbit key_reset =P1^2; //复位 sbit key_jingbao=P1^6; //警报信号 sbit Led =P1^7; //LED
uint keycount=0; uchar data_tel; //电话数据 uchar addr_tel;
//电话位
/* == == == == == == == == == == == == == == == == == ==
I2C驱动
== == == == == == == == == == == == == == == == == == */ //n=1->10ms void Delay(uchar n) { }
/* == == == == == == == == == == == == == == == == == == 函数功能:开始 入口参数: 说 明 :
== == == == == == == == == == == == == == == == == == =*/ void I2C_Start(void) {
SDA=1; NOP; SCL=1; NNOP; SDA=0; NNOP; SCL=0; NOP;
uchar i,j; i=100; j=100; while(j--) { };
while(i--);
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库基于单片机的防盗报警器的毕业设计(8)在线全文阅读。
相关推荐: