赞
踩
1、Connectivity选择USART1
2、Mode选择Asynchronous
3、Parameter Settings:
Baud Rate 115200 Bit/s
Word Length 8 Bits
Parity None
Stop Bits 1
Data Direction Receive and Transmit
Over Sampling 16 Samples
4、生成代码
5、写入以下测试代码:
/* USER CODE BEGIN WHILE */
uint8_t usart_data[]="abcdef\r\n";
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&huart1,usart_data,8,10);
HAL_Delay(1000);
}
/* USER CODE END 3 */
6、测试结果为每隔1秒在串口助手上接收到一串字符串。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。