/*the header files name is AT24C01-512.h
include AT24C01/01A/02/04/08/16/32/64/128/256/512
*the header files program's function is link exterior extend E2PROM
*the link chip's name is AT24C01A-512
* Debug frequency:22.1184MHz
*the program's synopsis as follows
* Author by:weiyi
* Establish on Date:27-12-2002
* Modified on Date:31-10-2002
* Edition NO.:V1.0
#define Wait_1us {_nop_();_nop_();}
#define Wait_2us {Wait_1us;Wait_1us;}
#define Sla_Wr 0xa0 /*0000 0 0 0 0*/
#define Sla_Rd 0xa1 /*0000 0 0 0 1*/
#define AT24C01 0x01
#define AT24C01A 0x02
#define AT24C02 0x03
#define AT24C04 0x04
#define AT24C08 0x05
#define AT24C16 0x06
#define AT24C32 0x07
#define AT24C64 0x08
#define AT24C128 0x09
#define AT24C256 0x0a
#define AT24C512 0x0b
#define Mem_Size AT24C256 //
01/01A/02/04/08/16/32/64/128/256/512
#define Chip_1 0x00 //本器件的器件地址,可以第一 8 个不同地
址的芯片使之能用同一段程序进行读写
sbit bSda =P3^3;
sbit bScl =P3^4;
bit bScan_Err;
unsigned char idata cShare_Buf[2]; //I2c read and write buffer
void Start_I2c(void);
void End_I2c(void);
unsigned char Scan_I2c();
评论0
最新资源