Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 1583

How to use i2c to read decimal point in TMP112 ?

$
0
0

https://www.ti.com/lit/ds/symlink/tmp112.pdf?ts=1650424734466&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTMP112

I'm use e2studio and GR-MNAGO to run in my project.

I have seen this datasheet a lot,
it say TMP112 will save data tino Temperature Register but in the same address have to bytes of data
Now i just cant read only 8 bit data,Last Bit data i can't read.

    float_parameters.device_address = 0x90u;

    float_parameters.sub_address_type = RIIC_SUB_ADDR_WIDTH_8_BITS;

    float_parameters.sub_address = 0x00u;

    float_parameters.number_of_bytes = 0x02u;

    float_parameters.p_data_buffer = &float_location ;
    /////////////////////////////////////////////////////////////
    ///////// //than i use this code to read////////////////////
    control(gs_riic_handle, CTL_RIIC_READ, &float_parameters);
    printf("temp=%d\n",float_location2);

it only can show the front number(ex:Temp=27.0
Then i use logic analyzer to see what i2c send.


How do I read data from second byte?


Viewing all articles
Browse latest Browse all 1583

Trending Articles