2015-06-03 12:16 AM
Hello,
I working on USART in stm32f0-discovery board, in that USART keeps on sending a character 'c'..But i intended to write a code it sends the character 'c' whenever it receives 'a' ....Why it is happening like tat, my code isvoid usart_access(void){ unsigned char ab=USART_ReceiveData(USART2); if(ab == 'a') { while (USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET); USART_SendData(USART2,'c'); } }The USART_access function called in the while(1) loop. #stm32f0-usart2015-06-03 06:21 AM
Wait for RXNE before receiving the character, and TXE before sending the response.
2015-06-26 06:10 AM
Thanks for your help clive!!.