STM32F0- Serial communication problem (USART 1)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-28 11:36 PM
Posted on July 29, 2014 at 08:36
Hi,
I am trying to sent some data to the controller (STM32F051) via pl2303 connector. Data is sent from an application. The problem is, I'm not able to receive the data sent by the application properly. The data received in the buffer is always a '\0'. I closed the application and opened Hyper Terminal and sent a character ('1') to the controller. The controller is able to receive the data properly. To check the data sent from application, I connect my PL2303 connector to another FTDI chip and received the data using Hyper terminal. This time data is received properly. So I confirmed that the application is sending data properly. The baud rate of the application is 2 Don't know whether the issue is with the configuration of usart. I am using both usart1(2400) and 2 (9600). The receiver section is as followsint
port_app(unsigned
char
rx_port [])
{
int
i =0;
unsigned
char
rx[6];
if
((USART1->ISR & USART_ISR_RXNE) >0)
{
for
(i=0;i<3;i++)
{
rx_port[i] = USART_ReceiveData(EVAL_COM1);
}
}
if
(i >= 3)
{
return
1;
}
else
return
0;
}
Regards,
Arun.S
#stm32f0 #serial
Labels:
- Labels:
-
STM32F0 Series
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-29 5:28 AM
Posted on July 29, 2014 at 14:28
Need to wait for RXNE before each byte
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-07-29 10:14 PM
Posted on July 30, 2014 at 07:14
Thank you . I applied some delay and the issue is resolved. :)
Regards. Arun.S