AnsweredAssumed Answered

STM32f207 remapping pins problem

Question asked by bingle.dylan on Jul 10, 2013
Latest reply on Jul 18, 2016 by boeh_ocansey.eugenia
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);
 stm32f207.png

data.png

Sorry if it's a simple solution, I've never programmed any microcontroller before.

Outcomes