Question
STM32F103RBT6 TIM2 PWM notwork
Posted on March 30, 2018 at 09:15
hi
i write this code for TIM2 CH3 PWM generation GPIOB.10
but it not works
can help too me ....
BEST regards
// RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);
//// GPIO_StructInit(&port);// port.GPIO_Mode = GPIO_Mode_AF_PP;// port.GPIO_Pin = GPIO_Pin_10;// port.GPIO_Speed = GPIO_Speed_10MHz;// GPIO_Init(GPIOB, &port);//// TIM_TimeBaseStructInit(&timer);// timer.TIM_Prescaler = 720;// timer.TIM_Period = 1000;// timer.TIM_ClockDivision = 2;// timer.TIM_CounterMode = TIM_CounterMode_Up;// TIM_TimeBaseInit(TIM2, &timer);//// TIM_OCStructInit(&timerPWM);// timerPWM.TIM_Pulse = 15;// timerPWM.TIM_OCMode = TIM_OCMode_PWM1;// timerPWM.TIM_OutputState = TIM_OutputState_Enable;// timerPWM.TIM_OCPolarity = TIM_OCPolarity_High;// TIM_OC3Init(TIM2, &timerPWM);//// TIM_Cmd(TIM2, ENABLE);#tim-pwm #stm32 #timer #pwm #timer2 #notworking #bug?