2011-11-13 04:36 PM
2011-11-13 06:28 PM
TIM_TimeBaseStructure.TIM_Prescaler = 1440 - 1; // 72MHz/1440 = 50kHz
TIM_TimeBaseStructure.TIM_Period = 1000 - 1; // 50KHz/1000 = 50 Hz TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure); Then you can program the width between 0-1000 (20 us units), and the output frequency of PWM CH1-4 will be 50 Hz You could used 144-1 and 10000-1, or 36-1 and 40000-1, if you need more fine grain control of the width.2011-11-16 04:36 AM
Thank you for suggestion about prescaler and period.
Due to problems with EXTI and STM32F1 I have decided to try STM32F4 uC with have many more timers.If someone have any solution orr suggestion for my problem with EXTI interrupts, please send me reply.