这样出来的结果不对,我用Page_Write这种写法一次写入8个字符也是不对,,结果如图所示,求解答
[code]int main(void)
{
uint8_t i;
/*初始化USART 配置模式为 115200 8-N-1,中断接收*/
USART_Config();
/* 发送一个字符串 */
printf("这是一个IIC通讯实验\n");
//初始化I2C
I2C_EE_Config();
//写入一个字节
EEPROM_Byte_Write(0,0);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(1,1);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(2,2);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(3,3);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(4,4);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(5,5);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(6,6);
EEPROM_WaitForWriteEnd();
EEPROM_Byte_Write(7,7);
EEPROM_WaitForWriteEnd();
//addr%8==0,即为地址对齐
// EEPROM_Page_Write(0,writeData,8);
// //等待写入操作完成
// EEPROM_WaitForWriteEnd();
//读取数据
EEPROM_Read(0,readData,8);
for(i=0;i<8;i++)
{
printf(&quot;%d &quot;,readData);
}
// printf(&quot;%d %d&quot;,readData[0],readData[1]);
printf(&quot;\n&quot;);
while(1)
{
}
} |