AnsweredAssumed Answered

USART Loopback with STM32F107

Question asked by Loïc Blanchard on May 20, 2015
Latest reply on May 27, 2015 by Loïc Blanchard
Hi,

I would make a loopback with my board STM3210C using USART2. I use the code here.
Here is my main code :

while(1)
 {
      
 
//Wait until a byte is received
while(USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET);
   
RXBUFF[j] = USART_ReceiveData(USART2);
  
if (USART_GetFlagStatus(USART2, USART_FLAG_TXE) != RESET)
 USART_SendData(USART2, RXBUFF[j]);
  
j++;
if (j >= 1)
j = 0;
}

When I use the Hyperterminal to show the data exchange, I have a value returned only all the 4 or 5 values send.
I just would send a number between 0 and 9, and receveid the same to verify the connexion.

Thanks for your help
Best regards

Loïc

Outcomes