| 本帖最后由 meiyaolei 于 2023-7-4 23:32 编辑 
 开发平台: MDK
 开发板:AC7802
 目地:利用AC7802开发板串口打印出相关的信息;
 1、原理图:
 
 
   
   2、串口框架:
 
   3、波特率描述
 
   4、寄存器:
 
   5、打印出相关的数据:
 
   6、相关代码:
 初始化:
 UART_ConfigType uart_config;
 
 GPIO_SetFunc(GPIOA, GPIO_PIN4, GPIO_FUN3);
 GPIO_SetFunc(GPIOA, GPIO_PIN5, GPIO_FUN3);
 
 uart_config.baudrate   = 115200;
 uart_config.dataBits   = UART_WORD_LEN_8BIT;
 uart_config.stopBits   = UART_STOP_1BIT;
 uart_config.fifoByteEn = DISABLE;
 uart_config.sampleCnt  = UART_SMP_CNT0;
 uart_config.callBack   = NULL;
 
 UART_Init(UART1,&uart_config);
 
 用于printf的fputs或标准中的其他打印函数
 int fputc(int ch, FILE *f)
 {
 UART_SendData(UART1, ch);
 while (!UART_TxIsEmpty(UART1)) {};
 
 return ch;
 }
 
 打印出MEIYAO AC7802
 printf ("meiyao AC7802\r\n");
 7、杜绑连接图:
   
 
 
 
 |