完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
所有:也许这是我有限的颅骨能力,但我无法准确地理解数据是如何通过UART组件处理到FIFOs并随后由DMA读出的。
1)在每个UDB和UARtiS(DUH)UDB基础上有两个4字节FIFO。我假设一个FIFO用于RX,另一个用于TX。现在,我们是否只有8位的ASTATIC4FIFO元素,或者它们可以被级联/细分(2个FIFO元素,用于16位,等等)? 2)如何将DMA指向FIFO中的正确位置,或者仅仅是由FIFO控制逻辑自主处理的任务? 3)如果在FIFO超时读取数据时会发生什么……它只会传入数据,或者读出的数据现在被破坏了。 4)用于设置DMA的正确地址是什么?基地地址是外围基地吗?或者我应该使用UARTARI($数)?假设上16位是UARTHARRXDATAYPTR。 5)在UART头文件中,我注意到有一个指向RXI数据缓冲区的指针(UARTHARRXDATAYPPTR)和指向与缓冲区相关联的类型Reg的指针(UARTHARRXDATAYRE)。后者是用来干什么的?叫我哑巴,为什么需要指针指向寄存器?它是否用作某个函数的参数? 我试图在TRM文档中找到这些数据的粒度,但到目前为止,我已经无法,所以请原谅我,如果这些问题中的任何一个看起来无知,但我只是不知道在哪里可以找到详细的信息。 以上来自于百度翻译 以下为原文 All: perhaps it is my limited cranial capacity, but I am unable to understand exactly how the data is processed into the FIFOs by the UART component and subsequently read out by a DMA. 1) There are two 4 byte FIFOs in each UDB and the UART is (duh) UDB-based. I assume one FIFO is used for the Rx, the other for Tx. Now, do we have a static 4 FIFO elements only for 8 bits, or can they be concatentated/subdivided (2 FIFO elements for 16 bits, etc.)? 2) How do you point the DMA to the correct spot in the FIFO, or is that simply task handled autonomously by the FIFO control logic? 3) What happens if you're trying to read data while the FIFO overruns...it the incoming data simply pre-empted or is the read-out data now corrupted. 4) What is the correct address to use for setting up the DMA. Is the base address PERIPHERAL _BASE? Or should I use UART_($number)_RXDATA_PTR? I assume the upper 16 bits are the UART_RXDATA_PTR. 5) In the UART header file, I notice there is a pointer to the RX_DATA buffer (UART_RXDATA_PTR) and a pointer to a pointer to type reg associated with the buffer (UART_RXDATA_REG). What is the latter used for? Call me dumb by why do you need a pointer to a pointer to the register? Is it used as an argument to some function somewhere? I tried to find this granularity of data in the TRM documents but thus far I've been unable, so pardon me if any of these questions seem ignorant but I just don't know where to find the detailed information. |
|
相关推荐
12个回答
|
|
标题应该是“DMA的机制读取FuuMART FIFOS”。对不起,混乱!
以上来自于百度翻译 以下为原文 The title really should be "the mechanics of DMA reads from UART FIFOs". Sorry for the confusion! |
|
|
|
回答
1:就UDB而言:是的,您可以将它们组合成16, 24或32位宽的FIFO相同大小的设备。 2。它是一个FIFO,所以你只需从中读取并得到实际值。 三。不会发生任何责任,溢出将由硬件指示。它就像闯红灯的街道一样:你不能可靠地预测会发生什么,你刚才知道这是错误的。 4。UART是一个外围设备,所以源地址上面的字将是外围的基,而较低的地址字(在TD中指定)将是寄存器。 5。因为你需要在这里的地址,有一个庞德到寄存器(这是一个地址)。要在C中指定一个寄存器,您需要一些看起来像指针的结构,但实际上不是一个,所以不要混淆。 我现在需要一杯咖啡… 为了理解UDBs和FIFO实现,有一些关于该主题的视频,向您展示如何使用一个小的可微编码ALU(算术和逻辑单元)创建“数据路径”组件。视频不少于二十分钟,我看了他们几次,决定这对我来说太复杂了。就在最近,我重新审视了它们,我尝试了一些真正有效的例子,但是你需要更多的了解:至少需要使用Verilog的基本知识,但是只需要看看PSoC的Bur5ED功能就值得观看VIDS。 快乐入门 鲍勃 以上来自于百度翻译 以下为原文 Answer 1: as far as UDBs are concerned: Yes, you may combine them to form 16, 24 or 32bit wide devices having FiFos of the same size. 2. It is a FIFO, so you simply read from it and get the actual value 3. Nothing rerliable will happen, an overflow will be indicated by the hardware. Its the same as crossing the street having a red light: you cannot reliable forcast what will happen, you just now that this is wrong 4. The UART is a peripheral and so the source's address upper word will be PERIPHERAL_BASE and the lower address word (specified in the TD) will be the register. 5. Since you need an address here, there is a pounter to the register (which is an address) . To specify a register in C you need some construct that looks like a pointer, but really isn't one, so do not get confused. I'll need a coffee now.... To understand UDBs and FIFO implementations there are some videos concerning that theme, showing you how to create "DataPath" components using a small microcodable ALU (Arithmetic and Logical Unit). The videos are each not less than twenty minutes and I watched them some times ago and decided that this would be too complicated for me. Just recently I re-viewed them and I tried some examples which really worked, but you need to learn a lot more: At least basic knowledge of using VeriLog is needed, but just to have a look at the bur5ied capabilitiies of PSoCs is worth watching the vids. Happy FIFOing Bob |
|
|
|
对不起,打字,但我是1.85米(6’2)高,我的Fig提示提示的大小不匹配我的笔记本电脑键盘的大小
以上来自于百度翻译 以下为原文 Sorry for the typos, but I'm 1.85m (6'2") hight and the size of my figertips doesn't match the size of my laptop keyboard |
|
|
|
鲍伯:谢谢你的回复。我对这两个指针的问题是:一个是指向ReG8的指针,另一个是指向Reg 8的指针。这是指针指向一个我没有得到的指针…为什么需要它?对于输入参数,必须有一些函数需要它,但这将是什么函数呢?
以上来自于百度翻译 以下为原文 Bob: thanks for your reply. My question about the two pointers is this: one is a pointer to a reg8, the other is a pointer to a pointer to reg 8. It is this pointer to a pointer that I don't get...why is it needed? There must be some function that requires it for an input argument, but what function(s) would this (those) be? |
|
|
|
{定义UARTHAR11TXDATAYRG(*(Req8*)UARTHAR11BuARTHOSTXXTXSHIVTERE U0X F0YRG)
第一个星号的意思是“下面指向什么”,下面是一个“Reg *”:一个指针 换句话说:指针指向什么,这是一个Reg(ister-Bob)。 以上来自于百度翻译 以下为原文 #define UART_1_TXDATA_REG (* (reg8 *) UART_1_BUART_sTX_TxShifter_u0__F0_REG) The first asterisk means "What the following points to" and the following is a "reg *":, a pointer In other words: what the pointer points to, which is a reg(ister) Bob |
|
|
|
有一个指示溢出的中断,通过读取状态寄存器来访问。UTIT8 UARTAL读写状态(无效)
这允许你决定在这种情况下该怎么做。 1)在每个UDB中有两个4字节FIFO,UART是(DUH)UDB。我假设一个FIFO用于RX,另一个用于TX。现在,我们是否有一个静态的4个FIFO元素,仅用于8位,或者它们可以被级联/细分(2个FIFO元素,用于16位等等)? 我认为鲍伯是正确的,在UDB中的FIFO对于另一个UDB来说是不可阻挡的。但最好是提交一个技术案例 HTTPS://SeCUR.CyPress?COM/MyActudio/?ID=25和技术支持=1和源=页眉和CFID=1039603和CFToCK=36156420 来确定这一点。您可以考虑基于香草模块的自定义模块,但这显然是一些额外的工作。 需要。 2)如何将DMA指向FIFO中的正确位置,或者仅仅是由FIFO控制逻辑自主处理的任务? FIFO显然是一个基于SRAM的组件,对于BoBS点,必须在寄存器TRM中拼出要读的寄存器。 对于PSoC 5。您可以查看其他FIFO条目,但这似乎不是基于您的问题所必需的。 描述。 问候,Dana。 以上来自于百度翻译 以下为原文 There is an interrupt that indicates overrun, accessed by reading status register. uint8 UART_ReadRxStatus(void) This allows you to decide what to do in this case. 1) There are two 4 byte FIFOs in each UDB and the UART is (duh) UDB-based. I assume one FIFO is used for the Rx, the other for Tx. Now, do we have a static 4 FIFO elements only for 8 bits, or can they be concatentated/subdivided (2 FIFO elements for 16 bits, etc.)? I think Bob is right on this, the FIFO in the UDB is not cascadable to another UDB. But best to file a tech case at https://secure.cypress.com/myaccount/?id=25&techSupport=1&source=header&CFID=1039603&CFTOKEN=36156420 to make sure of this. You could consider a custom module based on vanilla module, but thats clearly some extra work needed. 2) How do you point the DMA to the correct spot in the FIFO, or is that simply task handled autonomously by the FIFO control logic? The FIFO is clearly an SRAM based component, to Bobs point, the register to read must be spelled out in the Register TRM for PSOC 5. You could always look at other FIFO entries, but that does not seem necessary based on your problem description. Regards, Dana. |
|
|
|
Dana:我想也许我给了一个不正确的印象。这不是一个问题,就像我想了解正在发生的事情一样。到目前为止,我还没有能够从文档中获取Uber的详细信息。麻烦的是,细节很重要。
以上来自于百度翻译 以下为原文 Dana: I think perhaps I gave an incorrect impression. This isn't a problem so much as I want to understand what is going on. I have not been able to get the uber-fine details needed from the documentation thus far. The trouble is, the details matter. |
|
|
|
鲍伯:不要挑剔,但我不同意:
{定义UARTHAR11TXDATAYRG(*(Req8*)UARTHAR11BuARTHOSTXXTXSHIVTERE U0X F0YRG) 我理解的UARTHAR1BUARTHSTXXTXSHIVTETER U0XYF0YRG是一个指向Reg 8的指针,在这种情况下,对于Tx数据来说,似乎是一个FIFO(不是我指的是同一件事,而是相关的)。我不认为这是寄存器本身,只是指向这个寄存器的指针。 因此,UARTHAR11TXDATAYRG应该是指向该指针的指针。我的问题是,为什么你甚至需要一个指针指向这样的指针,如果你只能跟随原始指针。 以上来自于百度翻译 以下为原文 Bob: not to nitpick, but I disagree: #define UART_1_TXDATA_REG (* (reg8 *) UART_1_BUART_sTX_TxShifter_u0__F0_REG) UART_1_BUART_sTX_TxShifter_u0__F0_REG by my understanding is a pointer to reg 8, in this case what appears to be a FIFO for the Tx data (not the same thing I was referring to but related). I do not think this is the register itself, just a pointer to this register. UART_1_TXDATA_REG should thus be a pointer to this pointer. My question regards why you'd even need a pointer to a pointer to something like this if you can just follow the original pointer. |
|
|
|
我完全理解你的意思,但你并没有考虑到第一个“*”。在定义中,它引用了下面的“跟随”,这是一个指针。
不要将一个声明和一个引用混合到一个变量中,这个定义将用文本跟踪替换UARTHAR11TXDATAYRG,并从星号开始。 空虚* MyPointer; UIT8 8; I=(*(UTIN 8*)MyPosiple; 这里,您也找不到指针的指针。 鲍勃 以上来自于百度翻译 以下为原文 I'd perfectly understand what you meant, but you are not taking into account the first "*".in the definition. It de-references the term following, which is a pointer indeed. Do not mix a declaration with a reference to a variable, this #define will just replace UART_1_TXDATA_REG with the text following and that starts with an asterisk like void * MyPointer; uint8 ii; ii = (* (uint8 *) MyPointer; Here you do not find a pointer to a pointer as well. Bob |
|
|
|
|
|
|
|
鲍伯:你说得对,我错了。昨天晚上我在思考这个问题……他们正在取消一个指针,并且把这个指针作为一个指针指向RG 8,就像你说的那样。我认为你也碰到了一些东西…他们可能首先把指针作为空指针的类型指针,然后再重写到*RG 8。
谢谢你玩“与哑巴辩论”。像往常一样,我失去了论点,但无论如何都很有趣。 以上来自于百度翻译 以下为原文 Bob: you are absolutely correct, my mistake. I was thinking about this last night...yep, they are dereferencing a pointer, and casting this pointer as a type pointer to reg 8, just as you say. I think you hit on something as well...they probably DO initially cast the pointer as a type pointer to void and then later recast it to * reg 8. Well, thanks for playing "debate with a dummy". As usual I lost the argument but it was fun anyway. |
|
|
|
不要问问题的借口。
当我开始我的职业生涯时,我在一个核动力研究中心参与了IMS360的编程帮助工作台:我写了一个程序,它拒绝与“符号PL0T不能被解决”的程序联系在一起,FORTRAN绘图例程是常用的背景。 他们花了半天的时间找出我用“0”(0)拼写的“PL0T”,而不是字母“o”。 我原谅自己太傻了,花了那么多时间,他们回答: “我们必须原谅自己花了很长时间才发现并向你展示那些显而易见的东西,但我们仍然在学习……” 欢迎您再来! 鲍勃 以上来自于百度翻译 以下为原文 No excuses for asking questions. When I started my career I engaged the programming help-desk of the IBM360 in a nuclear power research centre for half a day: I had written a program that refused to link with the message "Symbol PL0T could not be resolved" with the background that the FORTRAN-Plot routine was commonly used. It took them half a day to find out that I spelled "PL0T" with a "0" (Zero) instead of the letter "O". I excused myself for beeing so stupid and having taken so much of their time and they answered: "We have to excuse ourselves that it took us so long to find and show you the obvious, but we still learn..." You are always welcome! Bob |
|
|
|
只有小组成员才能发言,加入小组>>
751个成员聚集在这个小组
加入小组2062 浏览 1 评论
1820 浏览 1 评论
3629 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1757 浏览 6 评论
1505 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
495浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
351浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
407浏览 2评论
353浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
846浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-16 20:17 , Processed in 1.108459 second(s), Total 99, Slave 82 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号