完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
喜
Vl53L0X测距传感器如何通过GPIO中断中断,我只能在vl53l0x_interrupt_threshold_settings.h中找到很长的寄存器地址列表。 在初始化和校准传感器之后,我尝试使用下面的代码。但是,StartMeasurement()中没有给出中断。我正在使用STM32f103RE微控制器。 FixPoint1616_t threshold_high =(255); FixPoint1616_t threshold_low =(350); status = VL53L0X_SetInterruptThresholds(pTestDev, VL53L0X_DEVICEMODE_SINGLE_RANGING,threshold_low, threshold_high); status = VL53L0X_SetGpioConfig(pTestDev,0,VL53L0X_DEVICEMODE_SINGLE_RANGING,VL53L0X_GPIOFU NCTIONALITY_THRESHOLD_CROSSED_LOW,VL53L0X_INTERRUPTPOLARITY_LOW);状态= VL53L0X_StartMeasurement(pTestDev); 最好的祝福 乔纳斯 #interrupt#vl53l0x#stm32f103#interrupt-status-register 以上来自于谷歌翻译 以下为原文 hi, how does the Vl53L0X ranging sensor adress the GPIO for the interrupt, i can only find a long list of register adresses in the vl53l0x_interrupt_threshold_settings.h. After initialization and calibration of the Sensor, i tried it with the code below. However, no interrupt is given out in StartMeasurement(). Im using the stm32f103RE microcontroller. FixPoint1616_t threshold_high=(255); FixPoint1616_t threshold_low=(350); status= VL53L0X_SetInterruptThresholds(pTestDev, VL53L0X_DEVICEMODE_SINGLE_RANGING, threshold_low , threshold_high); status=VL53L0X_SetGpioConfig(pTestDev,0,VL53L0X_DEVICEMODE_SINGLE_RANGING,VL53L0X_GPIOFU NCTIONALITY_THRESHOLD_CROSSED_LOW, VL53L0X_INTERRUPTPOLARITY_LOW); status=VL53L0X_StartMeasurement(pTestDev); best regards jonas #interrupt #vl53l0x #stm32f103 #interrupt-status-register |
|
相关推荐
2个回答
|
|
我现在用民意调查做了。通过高速测量,我猜不会浪费太多时间。我会把它装进去以后再打断。谢谢!
以上来自于谷歌翻译 以下为原文 I did it with a poll now. With high speed measurement, there is not much time wasted i guess. I will cange it to interrupt later on. Thanks! |
|
|
|
民意调查显示整个测量周期约为40ms。我认为对于我的系统来说,阻塞时间并不重要,因为MC无论如何都会等待结果。
但是,在将测量更改为之后,()显示错误3.这是最小范围失败并且根据手册UM2039第16页默认情况下甚至没有设置。复位后2秒发生错误,然后在没有任何错误的情况下实现测量。我尝试了一些延迟以获得缓冲区的时间,但这只会延迟到错误的时间。 与您以前的代码不同,我使用轮询完成了所有操作,并没有为中断设计硬件。 古来= HAL_GetTick(); / *要求准备好测量数据并等待40 ms直到数据准备好* / while((MeasurementDataReady [k]!= 1)&amp;&amp;(time&lt; = 40)){ NEWTIME = HAL_GetTick(); 时间= NEWTIME-古来; 状态[10] = VL53L0X_GetMeasurementDataReady(); } / *将测量数据存储在设备上的struct * / 状态[11] = VL53L0X_GetRangingMeasurementData();状态[12] = VL53L0X_ClearInterruptMask(); 编辑:听起来像是一个中断的错误,它是。在解除中断后,测量数据就像它应该的那样。代码正在运行。 以上来自于谷歌翻译 以下为原文 The entire measurement cycle is about 40ms now with the poll. I think for my system the blocked time is not critical, cause the MC waits for the result anyway. However after changing the measurement to , the () shows error 3. Thats Min Range Fail and according to the manual UM2039 page 16 not even set by default. The error occurs 2 seconds after reset, before that the measurement is achieved without any error. I tried some delay to get time for the buffer, but that only delays the time till the error. In deviation to your previous code, i did everything with a poll and didn't designed the hardware for interrupt. oldtime=HAL_GetTick(); /*Ask for measurement data ready and wait 40 ms till data is ready */ while ((MeasurementDataReady[k]!=1)&&(time<=40)) { newtime=HAL_GetTick(); time=newtime-oldtime; status[10]=VL53L0X_GetMeasurementDataReady(); } /*Store measurement data in struct on device*/ status[11]=VL53L0X_GetRangingMeasurementData(); status[12]=VL53L0X_ClearInterruptMask();
|
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2567 浏览 1 评论
3191 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1761 浏览 1 评论
3586 浏览 6 评论
5962 浏览 21 评论
920浏览 4评论
1296浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
560浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1284浏览 3评论
1334浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-3 06:53 , Processed in 0.888077 second(s), Total 49, Slave 42 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号