2020-08-28 09:37 PM
2020-08-29 07:53 AM
Several examples:
2020-08-28 10:00 PM
The basic procedure is identical across all STM32 and probably all mcus: after setting up the UART for proper baudrate and enabling it for receive (and setting up properly the Rx pin in GPIO) you check the RXNE but in USART_SR and if it's set, you read a bye from USART_DR.
This is described in the USART chapter in Reference Manual - read it.
JW
2020-08-28 10:47 PM
Thanks for your reply..
yes i am able to receive a byte and i can tx the same by to the uart like this
if(USART1->ISR & USART_ISR_RXNE)
{
char temp = USART1->RDR;
USART1->RDR = temp;
while(!(USART1->ISR & USART_ISR_TC));
HAL_UART_Transmit(&huart1,&temp,sizeof(temp),100);
}
this is working..i'm trying to receive a string in the same way..can i get any example source for this...if possible.
Thank you
2020-08-29 07:53 AM
Several examples:
2020-08-29 11:21 AM
Confused as to the point of writing to the RDR or waiting for TC
Strings can be accumulated to a buffer one byte at a time. You'll need to determine how the input gets terminated