Why stm32F103ZET use serial port can't receive and send data? #1612
Unanswered
espruino-discuss3
asked this question in
Electronics
Replies: 1 comment
-
Posted at 2016-08-22 by @gfwilliams I think you're posting in the wrong place - this forum is for Espruino JavaScript. You're posting C code that isn't related to Espruino - you should contact ST Microelectronics who make the chips at http://st.com, or you might have some luck posting on http://stackoverflow.com/ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Posted at 2016-08-20 by user67013
Hi! Why stm32F103ZET use serial port can't receive and send data?
The system has been in smooth operation when configuration with USART1 program. The data's receiving and sending are very good. But it went wrong when I replaced usart1 instead of usart2.
Serial port is not working properly. I don't know what's wrong. Please give me some suggestions.Thank you.
u8 data;
int main()
{
}
void USART2_IRQHandler(void)
{
if(USART_GetFlagStatus(USART2, USART_IT_RXNE) != RESET)
{
USART_ClearFlag(USART2, USART_FLAG_RXNE);
data = USART_ReceiveData(USART2);
USART_SendData(USART2, data);
while(USART_GetFlagStatus(USART2, USART_FLAG_TXE) != SET);
}
}
Best regards,
Beta Was this translation helpful? Give feedback.
All reactions