cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f207 remapping pins problem

dbingle
Associate II
Posted on July 10, 2013 at 17:17

I'm not sure how to remap pins that do not line up correctly with the alternate functions specified in the datasheet. For example, the picture below shows the pin out of my microcontroller where OCx-LOW are pwm out and ICx are pwm in. Comparing it to the datasheet's alternate function listing, only some pins line up to timer channels. For example, OC1-LOW and OC2-LOW pin's alternate functions match up to timer 9 channel 2 and 1, but OC3-LOW and OC4-LOW don't match up to any timers on their alternate functions so I'm not sure how to use these pins with the timers for pwm out/in.

When they match, you can do something like the following, but not sure what to do when they don't line up.

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
GPIO_Init(GPIOI, &GPIO_InitStructure); 
/* Connect pins to TIM8 AF2 */
GPIO_PinAFConfig(GPIOI, GPIO_PinSource2, GPIO_AF_TIM8);

0690X00000604woQAA.png 0690X00000604lDQAQ.png Sorry if it's a simple solution, I've never programmed any microcontroller before.
20 REPLIES 20
eugenia
Associate II
Posted on July 18, 2016 at 10:21

Hi Clive,

It is Eugenia again from the post STM32f207 PWM output. I was refering to this post of yours which I followed to get a software generated PWM.. But as soon as I try to configure the PWM output then I completely lose the PWM signal. I am using Timer 1