完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我正在使用LPS22HB压力传感器,我无法得到它的响应。我将ctrl_reg1设置为01000000,ctrl reg 2设置为00011000,其他所有设置为默认值。
我使用的是1MHz SPI时钟和CS引脚(低电平有效)。 然后我写入pressure_XL寄存器并检索第一个字节,然后使用迭代数据收集(ctrl_reg2 enabled)连续检索L和H字节。 我工作在2.5V并正确发送正确的字节(测量我的微控制器的输出) 为什么我没有回复? 以上来自于谷歌翻译 以下为原文 I am working with the LPS22HB pressure sensor and I cannot get a response from it. I have ctrl_reg1 set as 01000000, ctrl reg 2 set as 00011000, and everything else as default. I am using a 1MHz SPI clock and a CS pin (low - active). I then write to the pressure_XL register and retrieve the first byte then consecutively retrieve the L and H bytes using the iterative data collecting (ctrl_reg2 enabled). i am operating at 2.5V and am correctly sending the right bytes (measured the outputs of my microcontroller) Why am I getting no response? |
|
相关推荐
3个回答
|
|
|
嗨,
您正在使用的设置似乎是正确的。 我能够使用相同的设置正确阅读,因此下面必定有一些奇怪的东西。 我需要进一步的细节才能理解这种行为。 你能给我发送带有WhoAMI_register(0x0F)读数的SPI时序图和压力数据读数(0x28h,0x29h和0x2A)吗? 问候 安东内拉 以上来自于谷歌翻译 以下为原文 Hi, the setting you are using seems to be correct. I am able to read properly using the same setting therefore there must be something strange underneath. I need further details in order to understand this behaviour. Can you send me the SPI timing diagram with the WhoAMI_register (0x0F) reading and the reading for pressure data (0x28h, 0x29h and 0x2A)? Regards Antonella |
|
|
|
|
|
我在这里也看到了类似的问题,使用I2C。
这时,我的两个寄存器设置为: 控制寄存器1:0x20 控制寄存器2:0x00 在这种情况下,我将进行10 Hz操作,连续(BDU)更新,并且没有低通数据配置。 对于控制寄存器2,我使用I2C然后从0x28,0x29和0x2A读取单字节压力,并且不希望设备自动递增地址,因此禁用。我也禁用了FIFO。 我希望我能够直接从0x28,0x29和0x2A读取数据并以高达10 Hz的速率转换为压力。 此时,我只能从这些寄存器上的器件读取[0x00,0x00,0x2D]。这显然是不正确的。 我能够读取和写入设备上的所有其他寄存器,包括WHO_AM_I寄存器,并且返回正确,以及配置寄存器的设置/读取。 关于这里可能发生的事情的任何想法? 以上来自于谷歌翻译 以下为原文 I have seen similar issues here as well using I2C. At this time, my two registers are set as: Control Register 1: 0x20 Control Register 2: 0x00 I'm going for 10 Hz operation in this case, continuous (BDU) updates, and no low pass data configurations. For control register 2, I'm using I2C then single byte reads from 0x28, 0x29, and 0x2A for the pressure and don't want the device to automatically increment the address and so that is disabled. I also have the FIFO disabled. It is my expectation that I should then be able to read the data directly out of 0x28, 0x29, and 0x2A and convert to pressure, at a rate of up to 10 Hz. At this time, I'm only able to read [0x00, 0x00, 0x2D] from the device on those registers. That is clearly not correct. I am able to read and write all other registers on the device, including the WHO_AM_I register and that comes back correct, as well as the setting/reading of the configuration registers. Any thoughts on what may be happening here? |
|
|
|
|
|
压力寄存器的读取与状态寄存器同步?
如果不使用中断模式,则在读取输出寄存器之前,必须检查状态寄存器(27h)上的P_DA位(可用压力数据)。 您必须轮询此位,当它设置为1表示生成新的压力数据,因此您可以在输出寄存器(0x28,0x29和0x2A)上读取此值。 温度输出也是如此。 问候 安东内拉 以上来自于谷歌翻译 以下为原文 The reading of the pressure registers is sinchronized with the status register? If you are not using the interrupt mode, before to read the output registers you have to check the P_DA bit (Pressure data available ) on status register (27h). You have to poll this bit and when it is set to 1 means that a new pressure data is generated and so you can read this value on output registers (0x28, 0x29 and 0x2A). The same is for temperature outputs. Regards Antonella |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1453 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1502 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3649 浏览 1 评论
3842 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2461 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
728浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
663浏览 5评论
710浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
941浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
745浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 16:33 , Processed in 0.553697 second(s), Total 46, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1972