-
GD32103C-START开发板串口通讯异常
voidRece(unsignedcharrece[],unsignedchark){inti;for(i=0;i
2022-07-05 0 -
GM32F103C-START开发板串口通讯问题
想做串口通信,使用这种方式接收,但在keil中单步运行时数组中收到的全是第一个字节,全速运行时收不到数据,是这种写法不能实现串口接收吗voidusart_config(void)//串口初始化{/*enableGPIOclock*/rcu_periph_clock_enable(RCU_GPIOA);rcu_periph_clock_enable(RCU_GPIOC);/*enableUSARTclock*/rcu_periph_clock_enable(RCU_USART0);/*connectporttoUSARTx_Tx*/gpio_init(GPIOA,GPIO_MODE_AF_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_9);/*resetLEDGPIOpin*//*connectporttoUSARTx_Rx*/gpio_init(GPIOA,GPIO_MODE_IN_FLOATING,GPIO_OSPEED_50MHZ,GPIO_PIN_10);gpio_init(GPIOC,GPIO_MODE_OUT_PP,GPIO_OSPEED_50MHZ,GPIO_PIN_7);//复位引脚/*USARTconfigure*/usart_deinit(USART0);usart_word_length_set(USART0,USART_WL_9BIT);usart_stop_bit_set(USART0,USART_STB_2BIT);usart_parity_config(USART0,USART_PM_EVEN);usart_baudrate_set(USART0,9600U);usart_hardware_flow_rts_config(USART0,USART_RTS_DISABLE);usart_hardware_flow_cts_config(USART0,USART_CTS_DISABLE);usart_transmit_config(USART0,USART_TRANSMIT_ENABLE);usart_receive_config(USART0,USART_RECEIVE_ENABLE);usart_enable(USART0);}voidRece(unsignedcharrece[],unsignedchark){inti;for(i=0;i
2022-07-04 0