2011-11-10 01:21 AM
Hi,
I wrote the code for the USART3 initialization and it does not work (cannot see anything on the scope while sending data). Can you tell me if I am doing something wrong? //configure clock for USART RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); //configure clock for GPIO RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE); //configure AF GPIO_PinAFConfig(GPIOD,GPIO_Pin_8,GPIO_AF_USART3); GPIO_PinAFConfig(GPIOD,GPIO_Pin_9,GPIO_AF_USART3); //configure ports, &GPIO_InitStructure); GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(GPIOD, &GPIO_InitStructure); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_Init(GPIOD, &GPIO_InitStructure); USART_InitStructure.USART_BaudRate = 9600; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; USART_Init(USART3, &USART_InitStructure); /* Enable USART */ //USART_Cmd(USART3, ENABLE);2011-11-10 01:08 PM
GPIO_PinAFConfig(GPIOD,GPIO_PinSource8,GPIO_AF_USART3);
GPIO_PinAFConfig(GPIOD,GPIO_PinSource9,GPIO_AF_USART3);2011-11-20 03:14 PM
@clive1
Spent a couple of hours troubleshooting this... wish I found this post a couple of hours ago.