Hello everybody,
JM60 I2C module connected to TMP100 I2C Temperature sensor.
Problem is that process EI2C1_RecvBlock(data,2,Rcv); disable my Port A when is excecuted.
All other comunication process with TMP100 temperature sensor work perfectly.
Part of code:
int Read_Temp (){
int Tph,Tpl;
error=EI2C1_SelectSlave(0x48);
Pointer=0x00;
error=EI2C1_SendChar(Pointer);
error=EI2C1_RecvBlock(data,2,Rcv); // Here disable Port A (in *Rcv0=
Temph=*data;
Templ=*(data+1);
Tph=(int)Temph;
Tpl=(int)Templ;
Tph <<= 4;
Tpl >>= 4;
Temp=Tph|Tpl;
PTADD=0x18; //Enable PTAD because
PTAD=0x18; // RecvBlock disable this
return (Temp);
}
Thank you very much for suggestions.
Best Regards
Eduardo.
Solved! Go to Solution.
Hi Compilerguru,
I was defined:
byte Datos[128];
and
data=&Datos[0]; // in main
Then
int leo_Temp { ...}
Thank you
Eduardo
What is data? Is it a NULL pointer?
The reason I ask is that PTAD/PTADD happen to be at address 0/1, so could it be that you are using the port registers as data buffer?
Hi Compilerguru,
I was defined:
byte Datos[128];
and
data=&Datos[0]; // in main
Then
int leo_Temp { ...}
Thank you
Eduardo