初中生
最后登录1970-1-1
在线时间 小时
注册时间2014-4-20
|
原程序入下:
void MS561101BA_RESET()
{
/* Send STRAT condition */
I2C_GenerateSTART(I2C1, ENABLE);
I2C_Send7bitAddress(I2C1, PROM_ADDRESS, I2C_Direction_Transmitter);
I2C_SendData(I2C1, Reset);
I2C_GenerateSTOP(I2C1, ENABLE);
printf("\r\n 成功1 \r\n");
}
/**
void MS561101BA_PROM_READ()
{
u16 d1,d2,i;
for(i=0;i<6;i++)
{
I2C_GenerateSTART(I2C1, ENABLE);
I2C_Send7bitAddress(I2C1, PROM_ADDRESS, I2C_Direction_Transmitter);
I2C_SendData(I2C1, PROM_Read+i*2);
I2C_GenerateSTART(I2C1, ENABLE);
I2C_Send7bitAddress(I2C1, PROM_ADDRESS, I2C_Direction_Receiver);
d1=I2C_ReceiveData(I2C1);
I2C_AcknowledgeConfig(I2C1, ENABLE);
d2=I2C_ReceiveData(I2C1);
I2C_AcknowledgeConfig(I2C1, DISABLE);
I2C_GenerateSTOP(I2C1, ENABLE);
Delay_us(50);
d1<<=8;
C[i]=d1|d2;
printf("\r\n 成功2 \r\n");
}
}
用串口调试的时候只能输出成功1,成功2输不出来是什么情况?
|
|