Prescaler Input Capture
Posted: Tue May 23, 2023 2:26 am
Hi!
I use example HardwareTimerPWMInput from A_STM32_Examples:
I need to divide by 2 the timer input:
I don't see any compilation errors but I don't see any result of this command either.
What am I doing wrong?
I use example HardwareTimerPWMInput from A_STM32_Examples:
Code: Select all
Timer2.pause();
Timer2.setPrescaleFactor(72);
Timer2.setInputCaptureMode(TIMER_CH1, TIMER_IC_INPUT_DEFAULT);
Timer2.setInputCaptureMode(TIMER_CH2, TIMER_IC_INPUT_SWITCH);
Timer2.setPolarity(TIMER_CH2, 1);
Timer2.setSlaveFlags(TIMER_SMCR_TS_TI1FP1 | TIMER_SMCR_SMS_RESET);
Timer2.refresh();
Timer2.resume();
Code: Select all
TIMER2_BASE->CCMR1 |= (1<<2);
What am I doing wrong?