AnsweredAssumed Answered

Strange PD2 behavior on STM32F405RG

Question asked by Ed_B on Jul 25, 2013
Latest reply on Jul 29, 2013 by Ed_B
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

Outcomes