Read/Write from TMP468 on on M4 running Freertos on iMX7D via I2C

Hello,
I am trying to write a code that reads temperature from a sensor TMP468 on colibri imx7d running freertos on M4 through I2C.
I tried changing some addresses in the already written examples of the colibri imx7d freertos driver examples but I am not getting the desired output.
Could you please give an example code for this.
Here is a link for the data sheet of the sensor.

Thanks

Dear @Samir

Please understand that we cannot write supporting code for every i2c device on the market.

Please send me:

  1. Your source code
  2. A precise description of what you expected to see on the i2c bus
  3. A precise description what you actually measured on the i2c bus

Based on these facts I can try to analyze what went wrong.

Regards, Andy

Dear andy.tx

Here you canfind my source code.
It is actually the i2c_polling_sensor_imx7d example from the driver examples of the freertos_colibri_imx which I found on the toradex page of running freertos on colibri imx7.
I changed some addresses but I think the same applies on my example.

As for what I am trying to read is just the first byte from the manufacturer’s ID just to wring out my code and see if it works perfectly because the register I am trying to read from is read only and always has the same value.

After that I am going to read the temperature from anotherregister butif the first one works perfectly, then it is not a problem to proceed.

Thanks

main.c

Dear @Samir

Thank you for answering my question 1.
Can you please give me the details for questions 2. and 3, byte-by-byte. I don’t have a TMP468 here to try running your code, so I need these details to help you.

Regards, Andy

Dear Andy,

  1. I expected to receive a message saying true (which means that the imx7d read from the manufacturer’s ID register the first Byte which the MSB 0x54)

3.the third question is pretty much what I said in the 2. I tried to read the 0xFE register which is the manufacturer’s ID register.

I have put the link for the datasheet of the sensor in my Question if something is left unclear.

The slave address is 0x48.
I have wrote to two different registers before trying to read.
The first oneis the Lock register 0xC4
The second one is the configuration register 0x30.
The register that I am trying to read from is 0xFE.

All of the headers and the hardware init remain the same as from the toradex site for the imx7_colibri_m4 examples.

Thanks

Dear @andy.tx ,

I think the program doesn’t display the desired output because the i2c flag shows that it’s busy.
I have done a print check and ist shows that the i2c bus is busy that’s why (I think)

Thanks

Dear @Samir

It is hard to debug a problem without facts.
To me it looks like a hardware setup problem, but also this is just an educated guess.
You have the hardware, I don’t . So please go back to my initial feedback and measure the SDA and SCL signals.

Regards, Andy