Question
Strange PD2 behavior on STM32F405RG
Posted on July 25, 2013 at 10:40
Hi !
I'm trying to use PD2 on my STM32F405RG as GPIO output. I think i configured it correctly but it does not switch. Here is my code, it is not that difficult....GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
GPIO_DeInit(GPIOD);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_SetBits(GPIOD, GPIO_Pin_2);
Or is there a special function on that pin that must be disabled?
Same code ported to PORTA works fine.
Regards,
Ed
#nonsens-stupid #stm32f4-gpio