cancel
Showing results for 
Search instead for 
Did you mean: 

The problem of the reading of temperature data from LSM303DLHC

hamtver_alex
Associate
Posted on November 12, 2013 at 08:34

Dear Team.

I need to read temperature data from LSM303DLHC for temperature compensation of the accelerometer data.I use the STM32F3Dicsovery board and the ''stm32f3_discovery_lsm303dlhc.c''  library. I can read the interested data only in debug mode, during normal mode operation of the controller I always take '0'. All other data is read correctly. By the way,the type of TEMP_OUT_H_M and TEMP_OUT_L_M registers, unlike other, is not specified in the datasheet. In what may be the problem?
2 REPLIES 2
Thiago REIS
Associate II
Posted on November 18, 2013 at 14:35

Hello Alex,

In order to work with the temperature sensor's output, please check section 7.2 in page 36 of the attached datasheet, there you will find the registers setup to have the temperature data output working properly.

Please let me know if this helps you on this topic.

Thank you,

Thiago Reis

________________

Attachments :

DM00027543.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzI3&d=%2Fa%2F0X0000000bK1%2FIudZlEdCSsJshJzxBGLVQf02cmK6QDXI7JZRvpdHsdA&asPdf=false
hamtver_alex
Associate
Posted on November 20, 2013 at 11:35

Dear, Thiago Reis.

I once read the datasheet. I initialize CRA_REG_M register. The problem is that when I work in a debugging regime (Keil), I read the temperature measurment. In this case, the clock is provided by ST-Link. If I get out of debug mode, after a reset controller I take '0'. In last case, the clock is provided by a crystal oscillator. I see this problem in the STM32-F3Discovery board and the STM32F103C6. The stm32f3_discovery_lsm303dlhc.c''  library is used.