完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我在使用LPS331AP时遇到了一些麻烦。使用逻辑分析仪,我已经验证了AN4159第5.1.1节(单次模式测量序列)中给出的命令序列正在发送到器件。但是,当我从传感器检索测量值时,2字节温度测量值始终为CC CC,3字节压力测量值始终为6D 6D 6D。传感器需要大约40 ms才能返回此答案,因此似乎更新速率至少是正确的。
AN4159第6.2.2节还提到了“C源文件列表的存在,这些文件提供了使用压力传感器初始化,配置和执行测量的基线。”但是,我无法找到这些文件。如果有人知道我在哪里可以找到这些,我认为这可能对消除潜在错误有很大帮助。 或者,如果我上面描述的问题听起来很熟悉,那么任何其他信息都将非常受欢迎。 谢谢! 以上来自于谷歌翻译 以下为原文 I have been having some trouble getting up and running with the LPS331AP. Using a logic analyzer, I've verified that the sequence of commands given in AN4159 section 5.1.1 (one shot mode measurement sequence) is being sent to the device. However, when I retrieve a measurement from the sensor, the 2-byte temperature measurement is always CC CC and the 3-byte pressure measurement is always 6D 6D 6D. The sensor takes about 40 ms to return this answer, so it seems that the update rate is correct at least. AN4159 section 6.2.2 also mentions the existence of ''a list of C source files that provide the baseline in initializing, configuring and performing measurements with the pressure sensor.'' However, I have not been able to find these files. If anyone knows where I can find these, I think the might be a big help in eliminating potential errors. Alternatively, if the problem I've described above sounds familiar, any other information would be very much appreciated. Thanks! |
|
相关推荐
1个回答
|
|
由于存在许多威廉希尔官方网站
错误,此设备上的文档非常糟糕。我还没有尝试过单次模式,但我只是自动模式工作,我正在使用多字节I2C读取。
需要注意的事项: 1.在更改配置和控制寄存器之前,务必清除CTRL_REG1中的掉电控制位。然后在完成设备设置之后和实际进行测量之前再次设置它。 2.如果使用I2C从特定地址开始进行多字节读操作,由于器件上的地址指针自动递增,因此必须在执行I2C读操作之前对前一地址进行I2C写操作。在我的例子中,我想通过最后一个温度输出字节读取状态寄存器以进行6字节读取。我必须对状态寄存器地址减去1进行I2C写操作才能获得正确的读数。 3.压力输出不是2的补码格式。它是一个直的无符号整数。应用笔记中的示例证实了这一点。 4.数据表中温度的比例因子为480,但在应用笔记中显示为(120 * 4),但在示例120中使用。然而,480似乎对我有用。我仍然需要验证这一点。 5.至少在自动模式下,可能在单次触发模式下,内部平均值的数量可能与输出数据速率不兼容,从而导致错误的输出数据。输出数据速率的清晰度实际上是输出寄存器更新的速率,而不是串行总线时钟速率。 6.有一条说明,虚假的I2C总线可能导致设备挂起或导致数据输出挂起。这可以通过在I2C总线上连续喊出9次或更多次STOP来清除。我还没有做到这一点,并担心我公交车上的其他设备会想到这个...... 7.数据表寄存器映射在地址0x30显示AMP_CTRL,但该寄存器的描述显示地址0x2d。哪个是对的? 8.同样,reg map甚至不包括Delta_Press_ ..寄存器.... 9. RES_CONF寄存器中的RFU位为零,但默认为零。 10. CTRL_REG1中的DIFF_EN位有两个不同的描述“中断电路使能”和“用于启用差压输出计算的电路”。 我很确定第二个是正确的,但.... 我只看了这些文件2天.... 以上来自于谷歌翻译 以下为原文 Documentation on this device is really bad with numerous technical errors. I've not attempted one-shot mode yet, but I just got auto-mode working and I'm using multi-byte I2C reads. Things to watch out for: 1. Always clear the Power-Down control bit in CTRL_REG1 before changing config and control registers. Then set it again when you are done setting up the device and before actually making measurements. 2. If making multi-byte reads starting at a specific address using I2C, since the address pointer on the device auto-increments, you must do an I2C write of the preceding address before doing I2C reads. In my case, I wanted to read the status register through the last temperature out byte for a 6 byte read. I had to do an I2C write of the status register address minus one to get the correct reads. 3. The pressure output is NOT in 2's complement format. It is a straight up, unsigned integer. The example in the App Note confirms this. 4. The scaling factor for temperature is 480 in the datasheet, but in the app note its shown as (120*4), but in the example 120 is used. However, 480 seems to be working for me. I still need to validate this. 5. At least in auto-mode, possibly in one-shot mode, the number of internal averages may not be compatible with the output data rate causing erroneous output data. A point of clarity being the Output Data Rate is really the rate at which the output registers are updated, not the serial bus clock rate. 6. There is a note saying that a spurious I2C bus can cause the device to possibly hang or cause the data output to hang. This can be cleared by consecutively yelling STOP nine or more times on the I2C bus. I've not had to do this as yet and fear what the other devices on my bus will think of this... 7. The datasheet register map shows AMP_CTRL at address 0x30, but the description of this register shows address 0x2d. Which is correct? 8. Similarly, the reg map does not even include the Delta_Press_.. registers.... 9. There is zero info on the RFU bit in the RES_CONF register, except that it defaults to zero. 10. The DIFF_EN bit in CTRL_REG1 has two different descriptions ''Interrupt circuit enable'' and ''used to enable the circuitry for the computing of differential pressure output.'' I'm fairly sure the second one is correct, but .... And I've only looked at these documents for 2 days.... |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2747 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1813 浏览 1 评论
3655 浏览 6 评论
6044 浏览 21 评论
1342浏览 4评论
204浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
359浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
451浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
277浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 11:19 , Processed in 1.122146 second(s), Total 76, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号