I'm having a problem making LPC2148 work with SRF10 sensor. LPC is 3.3v device with 5v compatible i2c (at least user docu claims that). On the other side there is SRF10 device which is 5v. I have tried with both levels as pull-up lvl connected with 4.7k resistor (i have 3 devices on same line so i used higher value resistor).
Strange thing is that it sometimes read the value correctly but it fails to read values from 2 registers... Basically, it doesnt work.
Now, what is strange on this picture, is that logic lvl on SDA is 0 by default and it should be 1. That means that pull-up is not doing the job well ? Could that be related to logic lvl differences between uc and slave ?
EDIT:01.03
Here is my implementation of state 0x50, a_chn is i2c0 or i2c1
void slaveDataReceived (uint8_t a_chn)
{
uint8_t k;
volatile unsigned char *i2cConClear;
volatile unsigned char *i2cConSet;
volatile unsigned char *i2cData;
if (a_chn == 1) {
i2cData = (volatile unsigned char *)(0xE005C008);
i2cConClear = (volatile unsigned char *)(0xE005C018);
i2cConSet = (volatile unsigned char *)(0xE005C000);
}
else {
i2cData = (volatile unsigned char *)(0xE001C008);
i2cConClear = (volatile unsigned char *)(0xE001C018);
i2cConSet = (volatile unsigned char *)(0xE001C000);
}
k = *i2cData;
appendToDataBuffer (a_chn, k);
if (i2cDataRcv[a_chn] == i2cDataHead[a_chn]){
I2CMasterState[a_chn] = I2C_IDLE;
*i2cConSet = I2CON_SET_STO;
*i2cConClear = I2CON_CLR_AAC;
}
else {
*i2cConSet = I2CON_SET_AA;
}
*i2cConClear = I2CON_CLR_SIC;
}