AnsweredAssumed Answered

STM32F205ZGT6 - PC13 as output doesn't work

Question asked by pozzato.guilherme on May 8, 2014
Latest reply on May 9, 2014 by Clive One
Hello,

I'm trying to use the PC13 as an output but I can't get any signal change from it. I'm already setting the pins PC14 and PC15 as inputs following the datasheet orientations. 

I used one of the STM example code templates to run a debug code just to change the PC13 value and sometimes it work and sometimes it doesn't. 

RCC_GetClocksFreq(&RCC_Clocks);
SysTick_Config(RCC_Clocks.HCLK_Frequency / 100);
 
GPIO_InitTypeDef  GPIO_InitStructure;
 
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
 
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
 
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
 
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
 
/* Infinite loop */
while (1)
{
   /*  Set PC13 for 50 ms. */
  GPIOC->BSRRL = GPIO_Pin_13;
  Delay(5);
   
     /*  Unset PC13 for 50 ms. */
  GPIOC->BSRRH = GPIO_Pin_13;
  Delay(5);
}

Is there anything missing? I'm using this pin for a SPI CS with external pull-up.

Best Regards

Outcomes