完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
亲爱的论坛,
在我的项目中,我通过UsBART向PC发送了一些数据。现在我想检查另一方面的数据。所以我想在两边做一个CRC计算。接收机返回CRC,发送方可以交叉检查CRC。 在PSoC中有CRC组件,但它需要硬件连接(因为它是硬件组件…),UsBuTART组件没有一些硬件连接。 所以我尝试了下面的方法,我在CRC组件中使用了一个控制寄存器,并通过CRCUpter迭代通过UBUTART发送整个字符串。最后,我得到了一个结果,但我不喜欢这个解决方案,我也没有得到相同的CRCON在PC端。 因此,我的问题是,如何在PSoC5中通过UsBoCAD组件进行数据发送? 非常感谢, 托马斯 以上来自于百度翻译 以下为原文 Dear Forum, in my project I am sending several data via USBUART to a PC. Now I want to check the data on the other side. So I want to do a CRC calculation on both sides. The receiver sends back the CRC and the sender can cross check the CRC. There is this CRC component in PSoC, but it needs hardware connections (since it is a hardware component...) The USBUART component does not have some hardware connections. So I tried the following, I used a Control Registers at the CRC component and iterate the whole string sending via USBUART through the CRC component. Finally I get a result with that, but I don't like this solution and also I don't get the same CRC on the PC side. So my question is, how to do a CRC check with data sending via USBUART component in PSoC5? Thanks a lot in advance, Thomas |
|
相关推荐
9个回答
|
|
你为什么不计算软件中的CRC呢?CRC组件被设计用来计算硬件中生成的数据流的校验和,这似乎不是你的用例。
以上来自于百度翻译 以下为原文 Why don't you calculate the CRC in software? The CRC component is designed to calculate the checksum for a data stream generated in hardware, which doesn't seem to be your use case. |
|
|
|
谢谢你的回复。
是的,你说得对。但是我应该使用这个组件会使它更简单和更快(?)做计算。 以上来自于百度翻译 以下为原文 Thanks for the reply.. Yes, you are right with that. But I tought using the Component would make it more simple and faster (?) to do the calculation. |
|
|
|
它可能占用更少的CPU时间。但是正如我说的,它被设计用来提供的硬件数据,所以你需要转移登记,可以把数据的CRC校验,这需要被处理过。我不认为CRC是复杂(看看http://en.wikipedia.org/wiki/computation_of_crc)。
但是USB已经做了CRC -为什么你需要另一个? 以上来自于百度翻译 以下为原文 It might use less CPU time. But as I said, its designed to be used with data supplied by hardware - so you would need a shift register which can put the data to the CRC, and this needs to be handled too. I don't think CRC is that complicated (look at http://en.wikipedia.org/wiki/Computation_of_CRC ). But USB already does CRC - why do you need another one? |
|
|
|
好吧,也许这就是我思考的问题。
我能理解吗?美国通信公司保证我会一直拥有通过UBARTART传输的正确字符串吗?(因为它自己做CRCBY?) 因此,当传输时有错误时,UBS帧将检测它并处理它以再次发送数据。 以上来自于百度翻译 以下为原文 ok, maybe that is the problem in my thinking.. Do I understand it right, that the USB communication ensures that I will always have the correct string transmitted via USBUART? (Because it does a CRC by itself?) So, when there is an error while transmitting, the USB frame will detect it and will handle it to send the data again? |
|
|
|
恐怕你错了。从UART的角度来看,传输总是工作的,不需要做CRC计算,UART不知道在另一边的是什么。
CRC处理是(所谓的)协议的一部分,并且你必须定义(并且规划自己)使用哪种CRC,如果CRC失败或者甚至当有足够的冗余数据时,你会做什么?做一个错误检测和修正(想象一个马赛传输,在那里请求)。重新发送数据需要很长时间才能完成。 在UART接收数据的情况下,您可以请求计算并跟踪CRC,这样您就可以检查它。但这也是协议的一部分。 所以这取决于你! 鲍勃 以上来自于百度翻译 以下为原文 I'm afraid you are wrong. From the sight of the UART the transmission always works, there's no need to do a CRC calculation and the UART does not know what is on the other side. CRC-handling is part of the (so called) protocoll and therer you have to define (and to program yourself) what kind of CRC you'll use, what youÄll do if a CRC fails or even (when there is enough redundant data) do an error-detection and correction (Imagine a marsian transmition, where a request to re-send data would take a very long time to fulfill). In the case the UART receives data you may request that a CRC is calculated and tramsmitted, so you can check it. But that's part of the protocoll as well. So it is up to you! Bob |
|
|
|
是的,USB对自己进行错误检查。请参见,例如:HTTP://www. TeC-Pr.NET/InnulsU.B.HTML。因此,使用UBUART保证(几乎可以肯定),您发送的数据是由PC接收的。您仍然可以选择在安全上面附加一层,以确保例如逻辑或编程错误。但是传输本身应该是安全的。
以上来自于百度翻译 以下为原文 Yes, USB does error checking on itself. See, for example here: http://www.tech-pro.net/intro_u***.html . So using the USBUART guarantees ( almost certainly) that the data you send is received by the PC. You still might choose to do an additional layer on security on top of that, to insure against e.g. logical or programming errors. But the transmission itself should be safe. |
|
|
|
哎呀,错了。我忽略了“USB”,并引用了一个普通的UART部分,如(几乎)每个PSoC从1到5。
道歉 鲍勃 以上来自于百度翻译 以下为原文 Oops, sorr5y for a wrong post. I overlooked the "USB" and referred to an ordinary UART-part as in (nearly) each PSoC from 1 to 5. Apologises Bob |
|
|
|
|
|
|
|
正如大多数人指出的那样,USB协议本身保证了可靠的数据传输。还要注意的是,对于UBUART,使用BURF端点,保证精确的DAT交付。没有自己的CRC,你应该很好。
以上来自于百度翻译 以下为原文 As most of them have pointed out the USB protocol itself guarantees a reliable data transfer. Also note that for USBUART, bulf endpoints are used, which guarantees accurate dat delivery. You should be fine without your own CRC. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2100 浏览 1 评论
1846 浏览 1 评论
3664 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
556浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
410浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
905浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 02:39 , Processed in 1.377626 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号