标题: UART SR寄存器清除问题 [打印本页] 作者: kevicki 时间: 2015-11-28 00:37 标题: UART SR寄存器清除问题 STM8S207RB开发板,用库函数。
设置了UART1的TC中断,发现没有发送数据也会不断的进入中断,定位到SR寄存器中TC位默认值就为1,所以导致不断进入TC中断。按照手册说明,TC flag can be also cleared by software sequence: a read operation to UART1_SR register (UART1_GetFlagStatus()) followed by a write operation to UART1_DR register (UART1_SendData8() or UART1_SendData9()) (如下图为UART1_ClearFlag函数的注释对TC位清除方法的说明)
[attach]1154[/attach]