Can not set up PWM for a different Pin than PA5
Hey,
after trying to setup a different PIN for example: PC0 for PWM I just can not get it to work.
But this sample code works only for PA5:
#include "stm32f3xx.h"
int main(void) {
RCC->AHBENR |= RCC_AHBENR_GPIOAEN;
RCC->APB1ENR |= RCC_APB1ENR_TIM2EN;
GPIOA->MODER |= 0b10 << 10;
GPIOA->AFR[0] |= 0b0001 << 20;
TIM2->CCMR1 = 0 << 16 | 0b110 << 4;
TIM2->CCER = TIM_CCER_CC1E;
TIM2->PSC = 7999;
TIM2->ARR = 999;
TIM2->CCR1 = 100;
TIM2->CR1 = TIM_CR1_CEN;
for (;;)
__WFI();
}
How would I need to change it for use with PC0?
Since its kind of for a project I can not use HAL.
I use STM32CubeIDE on the Nucleo-F303RE board.
Thanks in advance!

