LPC1225 UART TX作品,但RX不做
我的设置是:
- LPC1225FBD48/321
- Ext Crystal:16MHz
- PLL:MSEL = 6,PSEL = 2
- UART0:CLKDIV = 250 DL = 1 DivAddval = 1 mulval = 1 mulval = 1 Mulval = 4
PLL给出mainClk = 96MHz; UART的PCLK为:96MHz/250 = 384KHz;比特率:384KHz/(16x1x1.25)= 19200
,但仅在LPC传输时起作用。当LPC收到角色时,它报告了2个字符,有时还会收到框架错误。其他比特率的类似问题。以较低的速率(例如2400),LPC报告收到的单个字符,有时是框架错误,但收到的字符与我发送的字符不同。看起来TX和RX正在使用不同的时钟。
将UART与Flash Magic一起使用Bootloader时,UART运行良好。
有人遇到过这样的问题吗?
My setup is:
- LPC1225FBD48/321
- ext crystal: 16MHZ
- PLL: MSEL=6, PSEL=2
- UART0: CLKDIV=250 DL=1 DIVADDVAL=1 MULVAL=4
PLL gives mainclk=96MHz ; PCLK for UART is: 96MHz/250=384kHz ; Bit rate: 384kHz/(16x1x1.25)=19200
And it works, but only when LPC transmits. When LPC receives a character, it reports 2 characters received and sometimes framing error. Similar problem for other bit rates. At lower rates, like 2400, LPC reports single character received and sometimes framing error, but received character is not the same as I sent. It looks like Tx and Rx are using different clocks.
The UART works well when using bootloader with Flash Magic.
Has anyone encountered such a problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了一个解决方案。设置clkdiv = 50和dl = 5后,UART变得完全功能。虽然文档并未禁止先前的参数集,并且两组都应给出相同的结果,但只有后者允许双向通信。
I finally found a solution. After setting CLKDIV = 50 and DL = 5, the UART became fully functional. While the documentation did not prohibit the previous set of parameters and both sets should give the same result, only the latter allows two-way communication.