cancel
Showing results for 
Search instead for 
Did you mean: 

I can't communicate with USART Sync mode

GRico.1
Associate II

I'm using STM32F103(blue pill). Usart1 connection with pl2303. My codes right here

uint8_t data;
  /* USER CODE END 2 */
 
  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
	HAL_Delay(1000);
	  if(HAL_USART_Receive(&husart1, &data, sizeof(data), 0) != HAL_TIMEOUT)
	  {
	   HAL_USART_Transmit(&husart1, &data, sizeof(data), 0);
	  }
    /* USER CODE END WHILE */
 
    /* USER CODE BEGIN 3 */
  }

Simple echo program. But my port reader program(AccessPort) always take a meaningless

data when I launch board. Accesport screenshot right here.

0693W000005BRO7QAO.jpg What is the problem?

4 REPLIES 4
TDK
Guru

The problem is probably the timing between the MCU and the terminal program doesn't match.

If you feel a post has answered your question, please click "Accept as Solution".
GRico.1
Associate II

That's problem right because my usb - ttl converter doesn't have any clock pin. But How can I read usart output from my pc.

Oh, I read this as UART and not USART, which I have never really used. Sorry for the noise.
If you feel a post has answered your question, please click "Accept as Solution".

Np. Have a good day.