2018-03-30 12:15 AM
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?2018-03-30 01:30 AM
Check what AFIO_MAPR register can do for you. Using PB10 for TIM2_CH3 is not the default configuration.
2018-03-30 11:14 AM
can edit this register with spl ?
do you know function for it ?
can sent me sample code frome it ?