完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨ST社区!
我正在使用LPS25H压力传感器和STM32F1 uC。我能够读出温度和压力,但压力值太低(温度很好)。它应该是1009.5毫巴,传感器输出979.4毫巴。 我尝试在焊接后增加压力补偿值,但压力为1035.2毫巴。有没有人知道我应该注意什么?初始化和读取例程: 初始化 读出 以上来自于谷歌翻译 以下为原文 Hi ST Community! I am working with LPS25H pressure sensor and STM32F1 uC. I am able to read out temperature and pressure but the pressure value is too low (temperature is fine). It should be 1009.5 mbar and the sensor outputs 979.4 mbar. I have tried adding pressure offset value after soldering, but the pressure is then 1035.2 mbar. Does anyone have any clue what should I be carefull about? Initialization and read routines: INITIALIZATION
READOUT
|
|
相关推荐
8个回答
|
|
嗨,
我对初始化阶段和读出阶段都有一些建议。 关于初始化阶段,所有寄存器的配置值都是正确的,但是: 1.可以避免寄存器CTRL_REG2,CTRL_REG3,CTRL_REG4和FIFO_CTRL的设置,因为0x00是所有这些寄存器的默认值。 2.但是,如果要写这些寄存器,只有在设置这些寄存器后才能设置CTRL_REG1(0x20h)寄存器。只有在所有寄存器都可配置后,CTRL_REG1的PD(掉电)位才必须设置为1。 3.请记住,从地址是通过读/写位完成的(1表示读取,o表示写入)。关于读出阶段: 1.请记住,完整的参考压力值由PRESS_OUT_H / _L / _XL组成,并表示为2的补码。 2.在读取压力值之前,检查STATUS_REG(27h)的P_DA位是否设置为1(新的压力样本可用)。 问候 安东内拉 以上来自于谷歌翻译 以下为原文 Hi, I have some suggestion regarding both the Initialization phase and the readout phase. Regarding the Initialization phase, the values of configuration for all registers are correct, but: 1. the setting of the registers CTRL_REG2, CTRL_REG3, CTRL_REG4 and FIFO_CTRL could be avoided because 0x00 is the default value for all these registers. 2. However, if you want write these registers,the CTRL_REG1 (0x20h) register has to be set only after setting of these registers. The PD (power down) bit of the CTRL_REG1 has to be set to 1 only after all registers are configurated. 3. Keep in mind that the slave address is completed with a Read/Write bit (1 for Read, o for Write). Regarding the readout phase: 1. Keep in mind that the full reference pressure value is composed by PRESS_OUT_H/_L/_XL and is represented as 2’s complement. 2. Before you read the pressure value, check if P_DA bit of STATUS_REG (27h) is set to 1 ( a new pressure sample is available). Regards Antonella |
|
|
|
安东内拉,请你提出建议。
我试过只设置RES_CONF和CTRL_REG1寄存器,没有任何改变。我也尝试了不同的设置顺序。 读/写地址位在I2C1_Read_Data和I2C1_Send_Data例程内发出。 在读取压力和温度之前,我还添加了P_DA和T_DA位校验。 作为参考,我发布了传感器值: 干杯, 兹拉特科 以上来自于谷歌翻译 以下为原文 Antonella, thak you for the suggestions. I have tried setting only RES_CONF and CTRL_REG1 registers, nothing have changed. I have also tried different setup order. Read/Write address bit is issued inside of I2C1_Read_Data and I2C1_Send_Data routines. I have also added P_DA and T_DA bits checkout before reading pressure and temperature. For the reference, I am posting sensor values:
Cheers, Zlatko |
|
|
|
嗨Zlatko,
执行的所有操作和寄存器的值看起来都是正确的。 你试过其他样品吗? 传感器的电源电压值是多少? 问候 安东内拉 以上来自于谷歌翻译 以下为原文 Hi Zlatko, all operations performed and the value of the registers look like correct. Have you tried with an other sample? What is the value of supply voltage for the sensor? Regards Antonella |
|
|
|
嗨!
VDD_IO和VDD电压均为3.3V。这是我尝试过的第四个样本,每个样本都有同样的问题。 我也在试验缓冲区值的不同整数转换,就像在其他库中一样,但是对我来说没有任何作用。 我们也用风扇尽可能加热它,压力没有显着变化(至少温度补偿正在起作用)...... 最好的祝福, 兹拉特科 以上来自于谷歌翻译 以下为原文 Hi! Both VDD_IO and VDD voltages are 3.3V. This is 4th sample that I have tried, same issue with each one. I was also experimenting with different integer casting of buffer values, as in other libraries, but nothing worked for me. We have also heated it up as much as possible with fan and pressure has not changed significantly (at least temperature compensation is working :)... Best regards, Zlatko |
|
|
|
嗨Zlatko,
如果我已经很好理解,你会读取所有样品的压力值。 您是否可以尝试只读取寄存器28h-2Ch,而无需写入CTRL_REG1寄存器而不检查P_DA和T_DA状态位? 1.您必须提供传感器供电并读取压力和温度值,而无需写入寄存器且不检查状态位。 2.然后你必须切断电源。 3.重复步骤1.你能告诉我压力和温度的读数值吗? 你可以尝试所有4个样品吗?问候 安东内拉 以上来自于谷歌翻译 以下为原文 Hi Zlatko, If I have well understood, you read always the same pressure value for all samples. Can you try to read only the registers 28h-2Ch, without write the CTRL_REG1 register and without check the P_DA and T_DA status bits? 1. You have to provide supply the sensor and read the pressure and temperature values without write no registers and without check the status bits. 2. Then you have to remove power supply . 3. Repeat the step 1.Could you send me the read value of pressure and temperature? Could you try all 4 samples?Regards Antonella |
|
|
|
安东内拉,
正常初始化程序后,我正在读取不同的压力值(现在大约是985.6,应该是1016左右)。 在没有初始化(写入任何寄存器)的情况下,我总是收到相同的值: 问候, 兹拉特科 以上来自于谷歌翻译 以下为原文 Antonella, After normal initialization routine I am reading different pressure values (now is around 985.6, should be around 1016). Without initialization (writing to any of registers) on power on, I always receive same values:
Regards, Zlatko |
|
|
|
兹拉特科,
我需要其他信息。 您是使用LPS25H适配器板作为标准DIL 24插座(参见附件)还是您在电路板上焊接了LPS25H样品? 是使用特定平台ST还是自定义平台?您是否可以重复初始化和读取过程,检查所有样本的STATUS_REG(0x27h)标志,并向我发送所有寄存器的转储以及压力和温度的读取值? 关于STATUS_REG的T_DA位和P_DA位,可以检查逻辑AND吗?如果两者均为1,则可以读取压力和温度输出寄存器。 我不清楚,如果你读取样品的值,即使你用风扇尽可能多地加热读数值,或者即使没有明显的压力值,读数值也始终是相同的。 。 你能解释一下吗? 问候 安东内拉 以上来自于谷歌翻译 以下为原文 Zlatko, I need other information. Are you using a LPS25H adapter board for a standard DIL 24 socket (see attached file) or did you soldered a sample of LPS25H on your board? Are using a specific platform ST or a custom platform?Can you repeat the procedure of initialization and reading with check of the flags of STATUS_REG (0x27h) for all samples and send me the dump of all registers and the read values for pressure and temperature ? Regarding the T_DA bit and P_DA bits of STATUS_REG, can you check the logical AND? If both are 1 you can read the pressure and temperature output registers. It is not clear for me, if when you read a value for a sample the read value is always the same for all time even if you heated it up as much as possible with fan or if the value of pressure has changed even if no significantly. Can you explain pls? Regards Antonella |
|
|
|
嗨!
关于这个问题的任何消息? 我也在读几个原型的错误(太低)压力。在我的情况下,它似乎与温度有关。在23°C的温度下,LPS25HB的温度为-21°C,压力为968hPa: 在35°C的温度下(没有其他变化)我正在阅读: 其转换温度为-6°C,压力为1029hPa(几乎是正确的)。 在42°C时,我的读数为2°C和1076hPa。 我几乎想要测量更多的点并实施我自己的温度校正 LPS25HB采用紧密放置的100nF 0402 SMD电容和稳定的2.1V电源焊接到定制PCB。不幸的是,我忽略了将Pin 3(保留)连接到Ground,但纠正该问题没有任何效果。 问候, 迈克尔 编辑:刚刚发现LPS25H(非HB)数据表提到了42.5°C的温度偏移(T(°C)= 42.5 +(TEMP_OUT / 480))。通过偏移,温度现在正确(这至少表明我的I2C通信和计算是正确的)。然而,压力仍然太低并且高度依赖于温度。 以上来自于谷歌翻译 以下为原文 Hi! Any news on this issue? I’m reading a wrong (too low) pressure on several prototypes too. In my case it seems to be related to temperature. At 23°C temperature the LPS25HB returns a temperature of -21°C and a pressure of 968hPa:
At 35°C temperature (nothing else changed) I’m reading:
Which converts to a temperature of -6°C and a pressure of 1029hPa (which is almost correct). At 42°C I’m reading 2°C and 1076hPa. I’m almost tempted to measure a few more points and implement my own temperature correction The LPS25HB is soldered to a custom PCB with a closely placed 100nF 0402 SMD capacitor and a stable 2.1V power supply. Unfortunately I had neglected to connect Pin 3 (Reserved) to Ground but correcting that issue had no effect. Regards, Michael EDIT: Just discovered that the LPS25H(not HB) datasheet mentions a 42.5°C temperature offset (T(°C) = 42.5 + (TEMP_OUT / 480)). With the offset the temperature is correct now (which at least indicates that my I2C communication and calculation is correct). However, the pressure is still too low and highly temperature dependent. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2711 浏览 1 评论
3235 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1807 浏览 1 评论
3643 浏览 6 评论
6030 浏览 21 评论
1332浏览 4评论
206浏览 3评论
194浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
348浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
439浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-18 16:01 , Processed in 2.540409 second(s), Total 62, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号