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.

TMP102 Accessing from User Space in Linux

I am trying to access TMP102 IC from userspace in DRA7xx_EVM, actually when i am writing writing 0x0 address first on the bus and reading 2 bytes of temp register i am getting the same value i.e., byte1 of temp register.. To read the entire temperature register i am writing 0x0 then read byte1,0x1 and then read byte2 of temp register..

But, actually in the data sheet if you see timing diagrams, its different...Am I accessing wrongly ??


2. Also the default values of config register are different from what mentioned in the data sheet..

Thanks & Regards,

Ganesh.

  • Hi,

    Not use if you noticed there is a driver already for that sensor. And also to check data transfer you can use i2c-tools [1] to do read/write of registers of the sensor.

    [1]
    Cheers,
    --Prabhakar Lad
  • Ganesh,

    I suggest you to use omapconf tool. It has simple I2C Register Read/Write Commands
    github.com/.../wiki

    I2C Register Read/Write Commands

    WARNING: use the following commands at your own risk! No address check done, may generate I2C bus error (invalid or not accessible 'physical address' and/or platform crash/hang (bad 'value').

    # ./omapconf read i2c <bus> 0x<chip-addr> 0x<addr>

    Read I2C register at address 'addr' from I2C chip at 'chip-addr' on I2C 'bus'.

    # ./omapconf write i2c <bus> 0x<chip-addr> 0x<addr> 0x<value>

    Write 'value' in I2C register at address 'addr' from I2C chip at 'chip-addr' on I2C 'bus'.

    For example - root@dra7xx-evm:~# omapconf read i2c 0 0x48 0x00

    Best regards,
    Yanko