cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0- Serial communication problem (USART 1)

aruns06
Associate II
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 follows

int
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
2 REPLIES 2
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..
aruns06
Associate II
Posted on July 30, 2014 at 07:14

Thank you . I applied some delay and the issue is resolved. :)

Regards.

Arun.S