完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我使用PSOC 5LP在CY8CKIT-059开发板上作为我最后一年工程项目的一部分。我需要以最高的频率采样二进制数据。我现在使用一个50% DC PWM来生成一个1和0的流作为设定频率的虚拟数据。我想知道最小的采样周期是可以实现的。对于实际系统,数据不是PWM流,而是来自IR接收器的在恒定频率下的外部二进制(0 V或5 V)信号。而且我可以更快地采样,我能更快地把数据传输到板上。我用的是78兆赫的时钟设置
我现在可以每1.038个样本采样一个比特。我这样做如下: 我设置PWM以在任何边缘创建中断。在主要情况下,当虚拟数据开始被接收(PWM启动)时,PWM引脚(My“接收器”)中断被触发。这使得一个标志,当它被捕获在主时,禁用PWM PIN(“接收器”)中断。此后,我启用一个定时器设置一半的PWM周期,它设置了一个样本标志在每个中断。每次设置这个样本标志时,我通过在PWM引脚上执行读函数来读取PIN,并将其存储到阵列中。我已经尝试过其他方法,但这是迄今为止我所能达到的最快的速度。不管怎样,得到一个较小的采样周期吗?我最好能在每50, 100个或200个ns的时候取样数据,但是任何比我现在更好的数据已经是一个改进。 对不起,如果这是一个很愚蠢的问题,但我没有太多的经验与这个处理器。如果有必要,我可以附上一个最小的项目。此外,如果我没有透露任何其他细节,我会乐意提供他们,如果你让我知道。 提前感谢。如有任何帮助,将不胜感激。 消息编辑:Marcel Stegmann 以上来自于百度翻译 以下为原文 I'm using the PSoC 5LP on the CY8CKIT-059 development board for a segment of my final year engineering project. I need to sample binary data at the highest frequency possible. I'm currently using a 50% DC PWM to generate a stream of 1's and 0's as dummy data of a set frequency. I would like to know the minimum sampling period achievable. For the real system the data is not a PWM stream, but an external binary (0 V or 5 V) signal from an IR receiver at a constant frequency. And the faster I can sample, the faster I can transmit my data to the board. I'm using the clock set-up at 78 MHz I can currently sample one bit every 1.038 us. I do this as follows: I set up the PWM to create an interrupt at any edge. In the main, when the dummy data starts being received (PWM start), the PWM pin (my "receiver") interrupt is triggered. This enables a flag, which when caught in the main, disables the PWM pin ("receiver") interrupt. Thereafter I enable a timer set for half the PWM period, which sets a sample flag at each interrupt. Each time this sample flag is set, I read the pin by performing a read function on the PWM pin and store it into an array. I have tried other methods, but this is around the fastest speed I could achieve as of yet. Is there anyway of getting a smaller sampling period? I would preferably like to be able to sample data at every 50, 100, or 200 ns, but anything better than what I have is already an improvement. Excuse me if this is a really stupid question, but I don't have much experience with this processor. I can attach a minimal project if necessary. Also, if I left out any other details, I will gladly provide them if you let me know. Thanks in advance. Any help would be greatly appreciated. Message was edited by: Marcel Stegmann |
|
相关推荐
2个回答
|
|
|
我相信最简单的输入流采样方法是使用现有的SPI从组件SPIS。它只读取输入二进制流并将其转换为字节。然后用UBFS将字节发送到PC。如果连续传输,瓶颈是USB传输速度(~2Mb/s)。另一种将二进制转换为字节的方法是移位寄存器组件。不应介入任何中断。使用DMA临时缓冲RAM中的传入数据。
以上来自于百度翻译 以下为原文 I believe that easyest way of sampling input stream woul be using existing SPI slave component SPIS. It just reads input binary stream and converts it to byte. Then you send that byte to PC using USBFS. If continuously transmitting, the bottleneck is USB transfer speed (~2MB/s). Other way to convert binary to byte is Shift register component. No interrupts should be involved. Use DMA to temporarily buffer incoming data in RAM. |
|
|
|
|
nvwuwy 发表于 2018-12-25 09:35 非常感谢!我以前从未使用过SPI或DMI组件,但实际上它似乎是我的问题的一个非常合适的解决方案。这不是我所希望的,因为如果发现传输错误,我会发现调试它更困难,但非常合适。如果我能让它奏效,我一定会把它选为正确的答案。谢谢您。 以上来自于百度翻译 以下为原文 Thank you very much! I've never used an SPIS or a DMI component before, but it actually seems like a very suitable solution to my problem. It's not what I was hoping for as I will find it more difficult to debug it if I get transmission errors, but very suitable. If I can get it working I'll definitely vote this as the correct answer. Thank you. |
|
|
|
|
只有小组成员才能发言,加入小组>>
786个成员聚集在这个小组
加入小组cyUSB3014一直显示2.1,不能到3.0情况,谁遇到过
7088 浏览 0 评论
2474 浏览 1 评论
2166 浏览 1 评论
4031 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
2073 浏览 6 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
7566浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
6114浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
742浏览 2评论
709浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7961浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 19:49 , Processed in 0.650070 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2140