uint16 I2c_Page_Rx_single()
{
int I2Cbuffer;
int num=0;
while(I2C2SR_bit.BB);
I2C2SAR=0x50;
I2C2CNT = 1;
I2C2MDR = 0x2e20;
I2C2DXR = 0x00;
DelayUs(10000);
I2C2SR_bit.SCD &=0x0;
I2C2CNT = 16;
I2C2MDR = 0x2c20;
DelayUs(10000);
for( int i=0;i<16;i++)
{
I2Cbuffer = I2C2DRR;
printf("%d\r\n", I2Cbuffer);
DelayUs(10000);
}
I2C2MDR = 0x00;
}
调试SM470的I2C,读取AT24C04(eeprom)中的数据,但读出来总是不对
这是读一页的数据,我发现I2C2SAR DXR只能一次性赋值,I2C2给了设备地址后,就不知道如何给读地址,而且输出的数据与I2C2DXR有关,你能帮我解答一下吗?