Prescaler Input Capture

Post here first, or if you can't find a relevant section!
Post Reply
George
Posts: 2
Joined: Tue May 23, 2023 2:13 am

Prescaler Input Capture

Post by George »

Hi!
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(); 
I need to divide by 2 the timer input:

Code: Select all

TIMER2_BASE->CCMR1 |= (1<<2);
I don't see any compilation errors but I don't see any result of this command either.
What am I doing wrong?
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Prescaler Input Capture

Post by dannyf »

Maybe read the datasheet / reference manual?
George
Posts: 2
Joined: Tue May 23, 2023 2:13 am

Re: Prescaler Input Capture

Post by George »

dannyf wrote: Wed May 24, 2023 12:52 am Maybe read the datasheet / reference manual?
Image


Image
Post Reply

Return to “General discussion”