Associate
January 30, 2018
Question
STM32F100VLDISCOVERY & One Pulse Mode (TIM2) Triggered by Button
- 14 replies
- 2580 views
Posted on January 30, 2018 at 15:52
I am trying to understand how to configure a timer in one pulse mode, using the STM32F100VLDISCOVERY board. I have used STM32CUBEMX to configure the blue button (PA0) as TIM2_CH1 ('Channel 1 input capture direct mode'), and PA1 as TIM2_CH2 '(Channel2 PWM Generation'). (STM32CUBEMX project attached).
I added a single line to the project, just after the line that says: 'MX_TIM2_Init();' :
HAL_TIM_OnePulse_Start(&htim2, TIM_CHANNEL_2);
When I press the Blue Button, I see the 'CC1IF' bit (SR register) momentarily toggle. But I don't see a pulse on PA1.
I imagine I'm still missing a line of code or two, advice/assistance is greatly appreciated.
#one-pulse-mode #stm32f100vldiscovery