Forum : ARM
Post Information | Post |
---|---|
January 8, 2011 - 2:22pm
|
I m using EVALUATION BOARD from STM which has ST32F103VBT6 as the target. I am using RLINK emulator along with this evaluation board. As a start up of this controller i started working from USART. The USART1 is working very fine at 9600-8-N-1 settings. Now i m trying to send some data to USART2. In this eval board the USART2 is remapped to Port D from Port A. int main(void) GPIO_Configuration(); USART_Init(USART2, &USART_InitStructure); USART_ITConfig(USART2, USART_IT_TXE, ENABLE); USART_ITConfig(USART2, USART_IT_RXNE, ENABLE); USART_Cmd(USART2, ENABLE); while (1) void RCC_Configuration(void) RCC_DeInit(); RCC_HSEConfig(RCC_HSE_ON); HSEStartUpStatus = RCC_WaitForHSEStartUp(); if(HSEStartUpStatus == SUCCESS) FLASH_SetLatency(FLASH_Latency_2); RCC_PCLK1Config(RCC_HCLK_Div2); RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9); RCC_PLLCmd(ENABLE); while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET) RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK); while(RCC_GetSYSCLKSource() != 0x08) void GPIO_Configuration(void) GPIO_PinRemapConfig(GPIO_Remap_USART2, ENABLE); /* Configure USART2 Tx (PD.05) as alternate function push-pull */ /* Configure USART2 Rx (PD.06) as input floating */ And i have added the USART2_IRQ handler routine. Please help me regarding this. |
Try this GPIO configuration
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOD, &GPIO_InitStructure);
/* Configure USART2 Rx(PD6) as input floating */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOD, &GPIO_InitStructure);
_________________________________
Also to check the UART configuration you should do polling rather than directly use interrupt handling.
Here u can use polling transmission and try seeing the output on the hyperterminal.