Cypress技术william hill官网
直播中

赵淑洁

7年用户 892经验值
私信 关注
[问答]

UART缓冲区问题

我已经配置了缓冲器操作的UART,缓冲器大小为128,运行在57.6kbPs。使用UARTHIPPARTRAIL,我发送多于几个字符的问题。
在5个字符中,它们都被正确发送,6个字符中断。看来这个问题与中断有关。只要UARTHI PUCHCHAR例程将字符直接放入PSoC UART发送数据寄存器,就发送字符。如果UARTHIPPUCHAR例程将字符放置到缓冲区中,则缓冲区继续填充,并且没有一个字符被发送。UARTHARTXBuffrError增量正确,UARTHARTX缓冲区读取保持在零。
TX-on上的FIFO空中断被打开,似乎中断只是不开机。
有什么想法吗?

以上来自于百度翻译


     以下为原文
  I have configured the UART for Buffered operation with a buffer size of 128 running at 57.6Kbps.  Using UART_PutArray I have issues sending more than a few characters.
    At 5 characters, they are all sent correctly, and 6 breaks it.  It looks as if the problem is related to interrupts.  As long as the UART_PutChar routine puts the character directly into the PSOC UART send data register the character are sent.  If the UART_PutChar routine places the character into the buffer then the buffer continues to fill and none of the characters are sent.  The UART_TxBufferWrite increments correctly and the UART_TxBuffer Read stays at zero.
    The TX - On FIFO Empty interrupt is turned on and it seems like the interrupt is just not firing.
    Any Ideas?

回帖(5)

姜钰

2019-5-22 13:37:42
出乎意料:你启用了全局中断吗?
也许你可以在这里发布你的项目(创建一个工作区包),这样我们就可以看看它。

以上来自于百度翻译


     以下为原文
  Just out of the blue: did you enable global interrupts?
    Maybe you can post your project here (create a workspace bundle), so we can have a look at it.
举报

赵淑洁

2019-5-22 13:55:54
启用全局中断。这样一个简单的概念。
我写汇编程序和一些C程序已经35年了,我又一次谦卑了。
谢谢你的快速反应。
彼得

以上来自于百度翻译


     以下为原文
  Enable Global Interrupts.  Such a simple concept. 
    I've been writing Assembler and some C programs for 35 years and am once again humbled.
    Thank you for your quick response.
    Peter
举报

王琳

2019-5-22 14:12:38
我把所有初始化的东西都分割成一个名为RealalIZHealSub()的单独例程。老实说,不止一次,我忘了在主机上调用它。
黑暗中的你并不孤单
鲍勃

以上来自于百度翻译


     以下为原文
  I extracted all that initialization stuff into a separate routine named InitializeHardware(). To be honest, more than once i forgot to call it in main().
     
    You are not alone in the dark
    Bob
举报

姜钰

2019-5-22 14:31:03
有时我桌上的水晶球真的很有用
还有帮助的是,我不止一次地犯了这个错误——这有助于学习…现在,我开始看,每次我启动一个项目,通过整个生成/提供的代码(特别是main),或者删除该行,或添加一个注释,为什么我把它留在里面。这有助于我防止这样的错误。

以上来自于百度翻译


     以下为原文
  Sometimes this crystal ball thingie on my desk really works
    What also helps is that I amde this error more than once - this helps learning... Now I started to look, everytime I start a project, through the whole generated/provided code (especially main) and either delete the line or add a comment why I leave it in. This helps me preventing such mistakes.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分