configureI2C(0xa0); //a0,a1,a2 全为0 I2C_DATA[0]=0X0; /* EEPROM第0个地址*/ I2C_DATA[1]=0XAA; /* 要写数据为0xaa*/ EnableInterrupts; /* enable interrupts */
WriteBytesI2C(0xA0,2);// 写一个AA到24c02地址为0里面去. while(I2C_STEP>IIC_READY_STATUS)__RESET_WATCHDOG(); /* wait for memory to be read */ delay_10ms(); WriteBytesI2C(0xA0,1);//定位地址为0. while(I2C_STEP>IIC_READY_STATUS)__RESET_WATCHDOG(); /* wait for memory to be read */ // delay_10ms(); //while (I2C_COUNTER!=1) __RESET_WATCHDOG(); ReadBytesI2C(0XA1,1) ;读1个Byte while(I2C_STEP>IIC_READY_STATUS)__RESET_WATCHDOG(); |