问答

汇集网友智慧,解决技术难题

wanzhilin88

TA的家园币:185  

  • GD32F103RB映射UART0到PB6,PB7失败怎么解决?

    我在作用GD32F103RB时,LQFP64将串口0重映射到PB6,PB7时串口发送数据时无输出。用示波器测量IO口无波形。但是串口中断可以进去。PB6-Remap:USART_RXPB7-Remap:USART_TX//初始化程序如下:nvic_irq_enable(USART0_IRQn,14,0);////remapuart0rcu_periph_clock_enable(RCU_AF);gpio_pin_remap_config(GPIO_USART0_REMAP,ENABLE);/*enableGPIOclock*/rcu_periph_clock_enable(RCU_GPIOB);//clockalreadysetedrcu_periph_clock_enable(RCU_GPIOB);/*connectporttoUSARTx_Tx*/gpio_init(GPIOB,GPIO_MODE_OUT_OD,GPIO_OSPEED_2MHZ,GPIO_PIN_6);/*connectporttoUSARTx_Rx*/gpio_init(GPIOB,GPIO_MODE_OUT_OD,GPIO_OSPEED_2MHZ,GPIO_PIN_7);/*enableUSARTclock*/rcu_periph_clock_enable(RCU_USART0);/*USARTconfigure*/usart_deinit(USART0);usart_baudrate_set(USART0,9600);usart_word_length_set(USART0,USART_WL_8BIT);usart_stop_bit_set(USART0,USART_STB_1BIT);usart_parity_config(USART0,USART_PM_NONE);usart_hardware_flow_rts_config(USART0,USART_RTS_DISABLE);usart_hardware_flow_cts_config(USART0,USART_CTS_DISABLE);usart_receive_config(USART0,USART_RECEIVE_ENABLE);usart_transmit_config(USART0,USART_TRANSMIT_ENABLE);usart_enable(USART0);//interruptenable//usart_interrupt_enable(USART0,USART_INT_TBE);

  • 求助-GD32F103RB将UART0重映射到PB6,PB7上无输出是怎么回事?

    我在作用GD32F103RB时,LQFP64将串口0重映射到PB6,PB7时串口发送数据时无输出。用示波器测量IO口无波形。但是串口中断可以进去。PB6-Remap:USART_RXPB7-Remap:USART_TX//初始化程序如下:nvic_irq_enable(USART0_IRQn,14,0);////remapuart0rcu_periph_clock_enable(RCU_AF);gpio_pin_remap_config(GPIO_USART0_REMAP,ENABLE);/*enableGPIOclock*/rcu_periph_clock_enable(RCU_GPIOB);//clockalreadysetedrcu_periph_clock_enable(RCU_GPIOB);/*connectporttoUSARTx_Tx*/gpio_init(GPIOB,GPIO_MODE_OUT_OD,GPIO_OSPEED_2MHZ,GPIO_PIN_6);/*connectporttoUSARTx_Rx*/gpio_init(GPIOB,GPIO_MODE_OUT_OD,GPIO_OSPEED_2MHZ,GPIO_PIN_7);/*enableUSARTclock*/rcu_periph_clock_enable(RCU_USART0);/*USARTconfigure*/usart_deinit(USART0);usart_baudrate_set(USART0,9600);usart_word_length_set(USART0,USART_WL_8BIT);usart_stop_bit_set(USART0,USART_STB_1BIT);usart_parity_config(USART0,USART_PM_NONE);usart_hardware_flow_rts_config(USART0,USART_RTS_DISABLE);usart_hardware_flow_cts_config(USART0,USART_CTS_DISABLE);usart_receive_config(USART0,USART_RECEIVE_ENABLE);usart_transmit_config(USART0,USART_TRANSMIT_ENABLE);usart_enable(USART0);//interruptenable//usart_interrupt_enable(USART0,USART_INT_TBE);