lcp2388 UART Tx fifo

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

lcp2388 UART Tx fifo

1,616件の閲覧回数
fzg
Contributor I

UART fifo 通过UnLSR寄存器的THER和TEMT位标记fifo中是否有数据,如何能知道fifo中是否已满,或者fifo中剩余空间。我的应用是想用轮询方式发送数据,每次轮询时,如果有需要发送的数据,就将fifo填满,此时fifo可能有剩余字节。但无法知道剩余多少,就只能等fifo空后,再一次性将fifo填入16字节。但这样可能会使两个字节间隔变长导致帧断裂,破坏modbus协议,特在此求助。谢谢大家。

0 件の賞賛
返信
3 返答(返信)

1,386件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport

Did you enable the interrupt? if no, please enable the interrupt in U0IER.    

0 件の賞賛
返信

1,386件の閲覧回数
fzg
Contributor I

谢谢您的回答,我目前整个项目设计就是想不用中断的方式发送数据,希望能定时器定期轮询的方式发送数据,lpc2388这款芯片可以实现么,谢谢!

0 件の賞賛
返信

1,386件の閲覧回数
jimmychan
NXP TechSupport
NXP TechSupport

U0IER[1] enables the THRE interrupt for UARTn. The status of this can be read from UnLSR[5].

UnIER[2] enables the UARTn RX line status interrupts. The status of this interrupt can be read from UnLSR[4:1].

U0IER enable 可以只用來查status用, 不是一定要用中断的方式发送数据, 可以继续用轮询的方式发送数据.

0 件の賞賛
返信