cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F205VET PortC(PC13) PGIO problem

kari2
Associate II
Posted on August 14, 2012 at 14:59

Hello,

I have faced a problem with pin GPIO pin PC13. I'm trying to use PC13 as output. Seems like after I initialize USART3 the PC13 pin does not work anymore in Push-Pull-mode. Anyhow If I enable the PC13 pull-up resistor, the PC13 works as output(in OC-mode, with pull-up).

The PC13 should not have anything to do with USART3. (PC10 and PC11 are user by the USART3). Actually in my case only PC10, because I'm using only USART3 TX.

PC13 initialization:

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;

GPIO_Init (GPIOC, &GPIO_InitStructure);

USART3 pin initialization:

  /* Configure USART3 as input floating */

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;

  GPIO_Init (GPIOC, &GPIO_InitStructure);

  /* Configure USART3 as alternate function push-pull */

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;

  GPIO_Init (GPIOC, &GPIO_InitStructure);

If don't initialize USART3, the PC13 works fine in Push-Pull mode.

I have not found anything special about this from data-sheet or err-data. Also CMSIS defines etc seems to be ok.

3 REPLIES 3
Posted on August 14, 2012 at 16:38

Is this on just one board, or multiple? Could you have some shorts somewhere?

PC13 has very LOW drive capabilities, along with 3 other pins they have a combined drive of 3mA and speeds below 2 MHz. Their power is gated through the backup domain.

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* Connect USART pins to AF */
GPIO_PinAFConfig(GPIOC, GPIO_PinSource10, GPIO_AF_USART3); // USART3_TX
GPIO_PinAFConfig(GPIOC, GPIO_PinSource11, GPIO_AF_USART3); // USART3_RX

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kari2
Associate II
Posted on August 15, 2012 at 09:01

Thank you for fast reply.

I have 3 boards with same problem. I haven't found short circuits on boards. The PC13 and PC14 are used for fet driving. The load for PC13 and PC14 is 0,33mA, because of pull-down resistor on those. The signal change rate is really low on these signals. PC15 is not used and not initialized.

If I enable PC13 pull-up the port seems to work in ''open collector mode'', but in this mode I can't get enough output current(the output rises to 0,7V because of the weak pull-up on cpu).

The backup domain is tied to the VDD. PC14 works just fine, so I quess the supply is ok.
kari2
Associate II
Posted on August 16, 2012 at 08:46

I didn't get PC13 working in push-pull mode when uart3 is initialized. By changing to another IO everything works ok.