Question
How-To use USART3
Posted on February 03, 2011 at 04:13
I'm trying to use USART3 with the regular mapping of Tx on PB10 and Rx on PB11. To start with I was just trying to get a single character to transmit. By the way, I'm using Atollic TrueSTUDIO. The following code does not seem to work. Any ideas would be helpful.
Thanks, Jim /* Configure USART Tx as function push-pull */ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init( GPIOB, &GPIO_InitStructure ); RCC_APB1PeriphClockCmd( RCC_APB1Periph_USART3, ENABLE); RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOB, ENABLE ); USART_ClockStructInit( &USART_ClockInitStruct ); // The Struct Init function has USART_Clock disabled by default. //USART_ClockInitStruct.USART_Clock = USART_Clock_Enable; USART_ClockInit( USART3, &USART_ClockInitStruct ); USART_StructInit( &USART_InitStructure ); USART_Init( USART3, &USART_InitStructure ); USART_Cmd( USART3, ENABLE ); USART_SendData( USART3, 'H' ); #usart #usart #discovery