-
以上是我的相关程序,编译没有错误,不知哪里出了问题
-
void main(void)
{
UART_Init(); //初始化UART
Send_Str("STM8S UART 实验!\r\n");//发送字符串
enableInterrupts(); //开启中断
while (1)
{
}
}
-
INTERRUPT_HANDLER(UART3_RX_IRQHandler, 21)
{
/* In order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction.
*/
//UART3_ClearITPendingBit(UART3_IT_RXNE);
UART3_SendData8(UART3_ReceiveData8());
}
-
void UART_Init(void)
{
UART3_DeInit();
UART3_Init((u32)9600, UART3_WORDLENGTH_8D, UART3_STOPBITS_1, UART3_PARITY_NO, UART3_MODE_TXRX_ENABLE);
UART3_ITConfig(UART3_IT_RXNE_OR, ENABLE);
UART3_Cmd(ENABLE);
enableInterrupts();
}
-
STM8S207R8T6,串口3不能实现接收中断,我用的是IAR库函数版本,麻烦各位大神帮我看看