This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2c problem

Hello,
I'd like to ask a little bit help.
I downloaded the mcb517_i2c aplication note.
I try to read the LM75 tempereture sensor with the bit_bang i2c routines.
The problem is...
There is a 16 bit temperature register and I can read only the high byte .
I use the following program
.
.
unsigned char data_in;
i2c_start();
i2c_write(0x91);
data_in=i2c_read();
i2c_stop();

I try to use the unsigned int instead unsigned char and modified the i2c_read routin to read 16 bit but no succes.

Any advice?
Cheer George



Parents
  • I looked at the documentation for the device. You have to implement a read I2C with ack function, followed by a read I2C without ack function, then a Stop function to read this part correctly.

    If that does not work, can you post the I2C functions code (i.e. what makes up the I2C_read, stop, etc) so we can take a look. Please review the Tips for posting Messages before posting code.

Reply
  • I looked at the documentation for the device. You have to implement a read I2C with ack function, followed by a read I2C without ack function, then a Stop function to read this part correctly.

    If that does not work, can you post the I2C functions code (i.e. what makes up the I2C_read, stop, etc) so we can take a look. Please review the Tips for posting Messages before posting code.

Children