完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想测量两个上升沿之间的时间来计算霍尔效应传感器的速度(300万转/分钟)。
理想情况下,我想要一个上升计数器,它会在上升沿捕获到一个后进先出缓冲器或一个寄存器,然后重新装入计数器。 问题是,唯一可用的计数器使用FIFO缓冲器,这些缓冲器覆盖到缓冲器的前面,使得很难说哪一个值是最新的值。如果缓冲区没有溢出,那么最新的值在后面。但是,如果缓冲区已经溢出,那么最新的值就在前面。但是,由于没有溢出状态位,所以在每次捕获时,我将被迫中断处理器,以确保FIFO缓冲区不溢出。我不想经常中断处理器。有没有办法避免使用中断,避免使用轮询,并且避免为自己的计数器编写VHDL?谢谢您。 以上来自于百度翻译 以下为原文 I would like to measure the time between two rising edges to calculate speed with a hall effect sensor (30000rpm). Ideally, I would like an up-counter that would capture on a rising edge to a LIFO buffer or single register and then reload the counter. The problem is that the only counters available use FIFO buffers that overwrite to the front of the buffer, making it hard to tell which value was the latest value. If the buffer has not overflown, then the newest value is at the back. However if the buffer has overflown, then the newest value is at the front. However, since there is no overflow status bit, I would be forced to interrupt the processor on every capture to make sure the FIFO buffer does not overflow. I do not want to have to interrupt the processor so often. Is there a way to avoid using interrupts, avoid using polling, and avoid writing VHDL for my own counter? Thank you. |
|
相关推荐
2个回答
|
|
你好,
您可以使用DMA从FIFO缓冲器转移到SRAM中的某个地方。您可以触发DMA只传输两次,然后禁用它。当计数器FIFO中有数据时,它会触发。在启用DMA之前,请确保清除计数器FIFO。 以上来自于百度翻译 以下为原文 Hi, You could use DMA to transfer from the FIFO buffers to somewhere in the SRAM. You can trigger the DMA to transfer only twice, then disable it. It triggers when there is data available in the counter FIFO. Before enabling the DMA, make sure to clear the counter FIFO. |
|
|
|
lksas 发表于 2018-12-27 08:38 谢谢您!最后我才不让缓冲区溢出。它们只能在大约500赫兹的范围内访问,这是正常的,而且比我想象的要少很多。 以上来自于百度翻译 以下为原文 Thank you! I ended up just never allowing the buffers to overflow. They should only be accessed at around 500Hz, which is okay and a lot less frequent than I thought. |
|
|
|
只有小组成员才能发言,加入小组>>
752个成员聚集在这个小组
加入小组2071 浏览 1 评论
1827 浏览 1 评论
3642 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1762 浏览 6 评论
1513 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
511浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
362浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
410浏览 2评论
357浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
860浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 10:12 , Processed in 0.991499 second(s), Total 80, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号