LSM303AGRTR minimun configuration as temperature sensor
Good afternoon,
My name is Jorge. I am an firmware engineer from Sayme Corp in Spain.
I am using an LSM303AGRTR acceleration and magnetic sensor to get temperature values.
I am following the instructions from the datasheet:
"4.5 Temperature sensor The LSM303AGR is supplied with an internal temperature sensor. Temperature data can be enabled by setting the TEMP_EN[1:0] bits to ‘1’ in the TEMP_CFG_REG_A (1Fh) register. To retrieve the temperature sensor data the BDU bit in CTRL_REG4_A (23h) must be set to ‘1’. Both the OUT_TEMP_L_A (0Ch), OUT_TEMP_H_A (0Dh) registers must be read. Temperature data is stored inside OUT_TEMP_H as two’s complement data in 8-bit format left-justified. "
resources finded at: https://www.st.com/resource/en/datasheet/lsm303agr.pdf
But the temperature doesn´t change when i apply a hot air stream. It always returns 64 from OUT_TEMP_L_A and 3 from OUT_TEMP_H_A.
My algorithm is something like this:
1) check who_i_am (0Fh --> 0x33)
2) Temperature sensor enable on TEMP_CFG_REG_A (1Fh --< 0xC0)
3) BDU enabled on CTRL_REG4_A (23h --> 0x80)
4) do-while polling STATUS_REG_AUX_A while07h hasn´t 0x04
5) when out of do-while I read 0Ch and 0Fh and always I get the same values.
Now since my problem has been explained:
There is a minimun configuration to use the temperature sensor?
Can you write the conversion equation for the temperature?
Is the temperature expresed i 16 or in 8 signed bits?
