How to Read iic for the S12G64?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to Read iic for the S12G64?

1,200 次查看
yanlaidong
Contributor I

I want to read Register of  MAX9288 ,but i face to difficulty. I has been read value success.but the reasult is zero .

please tell me reason,thanks.

add: I was read register  for the  slave address is 0x90.

for example:

byte IIC_9288_RecvBlock_Test(uint8_t addr,void* Ptr,word Siz,word *Rcv)
{
word I;
bool Acknowledge;
word Trial;

*Rcv = 0U;
Trial = TRIALS;
do {
Inhr1_SetDir((bool)INPUT); /* SDA HIGH - START SETUP */
Inhr2_SetDir((bool)INPUT); /* CLOCK HIGH PULSE */
Delay(); /* CLOCK HIGH PULSE + BUS FREE TIME */
Inhr1_SetDir((bool)OUTPUT);
Inhr1_ClrVal(); /* START CONDITION */
Delay(); /* START HOLD TIME */
Inhr2_SetDir((bool)OUTPUT);
Inhr2_ClrVal(); /* CLOCK LOW PULSE */
Delay();
Write((byte)(addr + READ));
Acknowledge = GetAck();
--Trial;
}
while((Trial != 0U) && Acknowledge);

if(Acknowledge)
{
IIC_9288_OnNACK();
Inhr2_SetDir((bool)OUTPUT);
Inhr2_ClrVal(); /* CLOCK LOW PULSE */
InternalStop();
return ERR_BUSY;
}
else
{
Inhr2_SetDir((bool)OUTPUT);
Inhr2_ClrVal(); /* CLOCK LOW PULSE */
Delay();
}

for (I = 0U; I < Siz; I++)
{
*((byte *) Ptr + I) = Read();
IIC_9288_OnRxChar();
if (I == (Siz - 1U))
{
SetAck((bool)NOACK);
}
else
{
SetAck((bool)ACK);
}
++(*Rcv);
}
return ERR_OK;
}

0 项奖励
回复
1 回复

1,091 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

When you monitor the communication on the SDA, SCL pins, do you get correct response from MAX9288?

 

Regards,

Daniel

0 项奖励
回复