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.
Part Number: TMP102
Hi
i would like to know AM5728 processor temperature status of AM572x EVM board, i came to know that there is a on board temperature sensor (TMP102) which is connected through I2C1 bus . Please help me in how can i read that temperature data. i had ti-sdk of that board .
Thanks®ards
-Chinna
Hello Pavel
i tried to use i2ctool: i2cget function , i need help in parameter passing to that function call as below
extern int i2cget_word(
unsigned int i2cbus, unsigned int address, unsigned int daddress,
unsigned int *data);
i checked my kernel /dev i didn't find i2c1(there are i2c0, i2c2, i2c4), what i have to pass as 1st parameter i2cbus number ?
chinna naidu said:i tried to use i2ctool: i2cget function , i need help in parameter passing to that function call as below
extern int i2cget_word(
unsigned int i2cbus, unsigned int address, unsigned int daddress,
unsigned int *data);
i checked my kernel /dev i didn't find i2c1(there are i2c0, i2c2, i2c4), what i have to pass as 1st parameter i2cbus number ?
If you check AM572x documentation, you will find that there is no I2C0 module, the starting one is I2C1. And this I2C1 is mapped as i2c-0 in Linux filesystem. You should use i2c-0
root@am57xx-evm:~# i2cdetect -r -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- UU UU UU 5b -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The temperature sensor is properly detected at 0x48 addr.
UU means the I2C driver claimed ownership for that i2c device (address) so user space access is not granted permission. But when i used the 'force' option on the tool. It will perform the i2c read. i.e.
Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]
I2CBUS is an integer or an I2C bus name
ADDRESS is an integer (0x03 - 0x77)
MODE is one of:
b (read byte data, default)
w (read word data)
c (write byte/read byte)
Append p for SMBus PEC
root@am57xx-evm:~# i2cget -f -y 0 0x48 0 w
0xe115
For which TMP102 sensor register to read (0 in the example) and how to convert the value (0xe115) refer to the sensor documentation and sensor e2e forum, as this is not related to AM572x device.
Regards,
Pavel
chinna naidu said:RetVal = i2cget_word(0,0x48,00,&temp);
printf("\n %d : Temp value is %x",RetVal,temp);
result:
........
Cannot Open File : 3
0 : Temp value is 2116
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 2116
0 : Temp value is 1916
0 : Temp value is 1916
0 : Temp value is 2116
it's giving me the output i took 116 hexa as output 17.13 centigrade . is it correct reading from tpm102m
This is Processor forum and we support AM572x related questions. Your question seems related to TMP102 sensor, thus you need to ask/check with the TMP102 forum.
If you have any questions related to AM572x device, let me know.
Regards,
Pavel