完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
有没有合适的文件或例子来说明如何使用UART FIFO?
我注意到很多关于UARTs的讨论,似乎有很多困惑。 目前,我为单字节RX中断设置了UART,并通过中断馈送了一个循环缓冲器,并对主线代码进行了解密并解析接收到的数据,寻找有效的数据包。 在我看来,FIFO应该能够替换我的循环缓冲区。 关于不受驱动的UART、使用FIFO和应该进行什么样的错误检查,似乎没有什么文档。 谢谢 以上来自于百度翻译 以下为原文 Is there any decent document or examples around that shows how to use the UART FIFO? I note many discussions on UARTs and there seems to be plenty of confusion. At present, I set up the UART for single byte RX interrupt and have a circular buffer being fed by the interrupt and the mainline code dequing and parsing the received data, looking for valid packets. It seems to me the FIFO should be able to replace my circular buffer. There seem to be little documentation regarding inetrrupt driven UART, Use of the FIFO and what sort of error checking should be done. Thanks |
|
相关推荐
23个回答
|
|
|
错误检查与UART组件无关。它取决于你正在使用的协议。
错误检查是错误检查。它是应用程序设计。 例如。我做了很多MODBUS RTU。我使用循环冗余校验。CRC-16 在大多数情况下,该组件仅由中断代码、状态寄存器掩码、环形缓冲区和一些变量组成。 所有这些你都可以自己做。 一本值得学习的好书 C程序员对串口通信的指导。 任何UART都是带有保持寄存器和状态寄存器的移位寄存器。 大多数只有一个保持寄存器。但这就是你所需要的。你的处理器比,是通过UART,阅读它通过一个简单的或标志的数据快许多倍,是所有你需要做的基本水平。 以上来自于百度翻译 以下为原文 Error checking has nothing to do with the UART Component. It is dependent on the protocol you are using. Error checking is error checking. It is application programming. For example. I do a lot of Modbus RTU. I use a cyclic redundancy check. CRC-16 For the most part the component consists of only the interrupt code, the status register masks , A ring buffer and a some variables. All of this you can do yourself. A good book to learn from is C Programmers guide to serial communications. all any UART is, is a shift register with a holding register and a status register. Most have only a single holding register. But that is all you need. Your processor is many times faster than the data that is coming in via the UART so reading it via a simple Ored flag is all you really need to do at the basic level.. |
|
|
|
|
|
你推荐的第三方书将如何帮助我理解UART是否会说超支和帧错误?
这些旗子是柏树组件的一部分,不是吗? 你是说TyHAT不是CypU-UART组件提供可靠串行通信的能力或能力吗?我在这里讨论的是低级UART,而不是更高级的解析器和CRC校验等。 例如:如果UART组件指示一个字符已准备就绪,那么我假设没有帧错误或超载吗? 以上来自于百度翻译 以下为原文 How will the 3rd party book you recommended, help me understand whether simply reading the UART will clear say overrun and frame errors ? These flags are part of the CYPRESS component are they not? Are you saying tyhat it is not the responsibility or whithin the capability of the Cypress UART component to provide reliable serial communications? I am talking here about low level UART and not higher level parsers and CRC checking etc. For example: If the UART component indicates a character is ready then I assume there was no frame errors or overruns? |
|
|
|
|
|
例如,使用芯片的时候,我不得不这样做的明确标志,
无符号字符集(空) { 如果((U2稳定)Or)(U2稳定,FER) { 错误; FRR=假; 返回错误; } COMICACHAR= UARTGETDATABLE(UART2); 回归真实; } 以上来自于百度翻译 以下为原文 For instance, when using Microchip, I had to do this to clear the flags, unsigned char COMErrorFree(void) { if((U2STAbits.OERR)||(U2STAbits.FERR)) { U2STAbits.OERR = false; U2STAbits.FERR = false; return false; } com_char = UARTGetDataByte(UART2); return true; } |
|
|
|
|
|
UART实现信号误差和条件(如TX FIFO的空,不是空的…)
像一个交通灯,它是在一个特定的应用程序你想要做什么的信号提供您选择:忽略他们,把字符要求重新发送,cout错误和和和… 我不是通过提供的软件UART接口总监督的一个朋友。就像我的相机,我要禁用自动性有它到底做了什么我要花多少时间。 所以我有自己的接口适应复杂性和/或要求的安全项目所需的(或客户)wilol花了我额外的3行写的,就是这样。低价格比不观察红灯。 鲍勃 以上来自于百度翻译 以下为原文 The UART implementation signals errors and conditions (as Tx empty, FIFO not empty...) Like with a traffic light it is your choice in a certain application what you want to do with the signals provided: ignore them, drop the character ask for a re-transmit, cout errors and and and... I am not a friend of total supervision of the UART interface by the provided software. Like with my camera I have to spend much time in disabling automatisms to have it exactly done what I want. So having my own interface adapted to the complexity and / or required safety needed by the project (or my customer) wilol cost me additional 3 lines to write, that's it. Low price compared to not observing a red light. Bob |
|
|
|
|
只有小组成员才能发言,加入小组>>
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评论
710浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
7962浏览 2评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 05:56 , Processed in 0.529994 second(s), Total 47, Slave 40 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
507