cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F205ZGT6 - PC13 as output doesn't work

gui
Associate
Posted on May 08, 2014 at 20:36

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
1 REPLY 1
Posted on May 09, 2014 at 01:19

It's in the backup power domain like PC14/15, but should be fine with light loads, below 2 MHz into 30pF, and 3mA between all three pins.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..