Hi, I'm using STM32F373CC and i'm trying to receive a string from uart , I am new to this controller and anyone pls suggest how to receive a string from Uart1.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-28 9:37 PM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-29 7:53 AM
Several examples:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-29 7:53 AM
Several examples:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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​
Up vote any posts that you find helpful, it shows what's working..
