Hi,
I'm interfacing TMP112 with PIC16F690 but all I can get from byte 1 and 2 of temperature register is 0b111111111111.
Does someone have any guess about where the problem is?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I'm interfacing TMP112 with PIC16F690 but all I can get from byte 1 and 2 of temperature register is 0b111111111111.
Does someone have any guess about where the problem is?
Hello Natailia,
You mentioned '0b' , does that mean binary representation? If so, are you getting 12 bits of 1's followed by 4bits of 0's when you read byte 1 & 2? or are you receiving all 16 bits of 1's.
Are you getting an ACKnowledge when you send the I2C slave address?
Please explain what you are experiencing in detail, if possible.
Best Regards,
Abhi
Yes, It is binary. I'm getting all 16 bits of 1's.
This is the main code of my software:
start();
write(0b10011010);
write(0x00);
start();
write(0b10011011);
temper=read(1); // drive SDA low, waiting for next byte
temper2=read(0);
stop();
What do you mean by getting an ACK? I get the SDA bit every time I send the slave adress, but I'm not really sure what am I suposed to do with that bit.
When I watch SDA and SCL trough the oscope I can see the byte that I send to slave, but when the slave should send me the data the SDA line it's always high.
Hello Natailia,
It looks like TMP112 does not acknowledge the host device. Unless the TMP112 acknowledges to the I2C slave address sent by the host you will not be able to access the temperature registers.
Please make sure your waveform matches the above diagram. The best way to go about is by hooking up SCL and SDA lines to a an oscilloscope. Notice that marked Red is what you send via host processor and blue is what you need to expect from the TMP112. Also please don't forget the start and stop conditions specified in the above picture.
Can you please provide me some information on your intended application and the host processor that is communicating with TMP112.
Best Regards,
Abhi
By the 'host' you mean the master? I'm using PIC16F690 to interface with the sensor and I want to measure body temperature.
Do you think the 12C slave address may be the problem? I'm using 0x9A and 0x9B, is it right?