2009-03-05 07:08 PM
Hall sensors on TIM4 + PWM output
2011-05-17 01:15 AM
Hi,
I use the TIM4 to get the hall sensors for a BLDC motor. In addition to that, I want to generate a PWM signal on the TIM4-CH4 to control a small brushed motor. The problem is that the period of the TIM4 is set to U16_MAXCode:
// Set full 16-bit working range TIM_HALLTimeBaseInitStructure.TIM_Period = U16_MAX; TIM_HALLTimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1; TIM_TimeBaseInit(HALL_TIMER,&TIM_HALLTimeBaseInitStructure); but I need at least a timer period set to 0x00FF to generate a valid PWM for the brushed motor. My question: If I setCode:
TIM_HALLTimeBaseInitStructure.TIM_Period = 0x00FF; what other modifications is needed in the code for the hall sensors? Thank you!