2016-10-12 09:57 PM
Dear All,
I am working in STM32F070R8T6.For the Timer base pwm generation I need to use TIM6, I have no option for choosing TIM1 and TIM2.I need to activate internal pwm which may cause by pressing GPIO key button. Kindly, help me to set TIM6 in stmcubemx.2016-10-13 03:12 AM
Hi hasan.md_mubdiul,
''I am working in STM32F070R8T6.For the Timer base pwm generation I need to use TIM6, I have no option for choosing TIM1 and TIM2?I guess that you use STM32F070RBT6 (not STM32F070R8T6), and you don?t have option for choosing TIM1 and TIM3 (not TIM1/2)TIM6/7 are basic timers witch don?t feature independent channel for PWM generation so you cannot use them.As shown in this figure you can use TIM14/15/16/17-Syrine-2016-10-13 05:17 PM
Dear Sir Syrine,
Thank you very much, I saw this in datasheet that TIM6/7 will not be use for this MCU. My circuit does not contain any external TIMER I/O port. That means, I have to activate internal timer.This setting generates, static void MX_TIM14_Init(void) { TIM_IC_InitTypeDef sConfigIC; htim14.Instance = TIM14; htim14.Init.Prescaler = 0; htim14.Init.CounterMode = TIM_COUNTERMODE_UP; htim14.Init.Period = 0; htim14.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; if (HAL_TIM_Base_Init(&htim14) != HAL_OK) { Error_Handler(); } if (HAL_TIM_IC_Init(&htim14) != HAL_OK) { Error_Handler(); } if (HAL_TIM_OnePulse_Init(&htim14, TIM_OPMODE_SINGLE) != HAL_OK) { Error_Handler(); } sConfigIC.ICPolarity = TIM_INPUTCHANNELPOLARITY_RISING; sConfigIC.ICSelection = TIM_ICSELECTION_DIRECTTI; sConfigIC.ICPrescaler = TIM_ICPSC_DIV1; sConfigIC.ICFilter = 0; if (HAL_TIM_IC_ConfigChannel(&htim14, &sConfigIC, TIM_CHANNEL_1) != HAL_OK) { Error_Handler(); } if (HAL_TIMEx_RemapConfig(&htim14, TIM_TIM14_MCO) != HAL_OK) { Error_Handler(); }My aim is to apply this timer along with pwm and use it by press key.Kindly, refer me any helpful example source code.RegardsHasan