ST意法半导体
直播中

王丽婧

7年用户 228经验值
私信 关注
[问答]

从LSM303DLHC读取温度数据

亲爱的团队。

我需要从LSM303DLHC读取温度数据,以便对加速度计数据进行温度补偿。我使用STM32F3Dicsovery板和“stm32f3_discovery_lsm303dlhc.c”库。我只能在调试模式下读取感兴趣的数据,在控制器的正常模式操作期间我总是取'0'。正确读取所有其他数据。顺便说一句,TEMP_OUT_H_M和TEMP_OUT_L_M寄存器的类型与其他寄存器不同,未在数据表中指定。可能是什么问题?

以上来自于谷歌翻译


以下为原文




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)

张鑫

2018-11-27 16:15:04
你好Alex,
 
 为了使用温度传感器的输出,请查看所附数据表第36页的7.2节,在那里您将找到用于使温度数据输出正常工作的寄存器设置。
 
 如果这有助于您解决此主题,请与我们联系。
 
 谢谢,
 
 蒂亚戈雷斯

以上来自于谷歌翻译


以下为原文







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
举报

王丽婧

2018-11-27 16:27:01
亲爱的,蒂亚戈雷斯。
 
 
 
我曾经读过数据表。我初始化CRA_REG_M寄存器。问题是当我在调试机制(Keil)工作时,我读了温度测量。在这种情况下,时钟由ST-Link提供。如果我退出调试模式,在复位控制器之后我取'0'。在最后一种情况下,时钟由晶体振荡器提供。我在STM32-F3Discovery板和STM32F103C6中看到了这个问题。使用了stm32f3_discovery_lsm303dlhc.c''库。

以上来自于谷歌翻译


以下为原文





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.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分