cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f070xB, TIM16_CH1 input capture

Priyadarshini Solanki
Associate II

Posted on April 23, 2018 at 12:59

I am using STM32f070xB controller. I want to use @TIM16_CH1 for input capture.

GPIO_PIN: ♯PB8

Timer clock freq: 3MHz

TIMER is getting interrupted continuously but after 120Hz, flow is not going into Capture compare callback.

i.e, __HAL_TIM_GET_FLAG(htim, TIM_FLAG_CC1) is always RESET for frequency above 120Hz.

Anyone can let me know, what can be the reason behind.

Even for specific PORT-PIN GPIO external interrupt is not happening after 120Hz.

4 REPLIES 4
Posted on April 23, 2018 at 23:02

Is compiler optimization switched on?

Cube/HAL interrupt handling consumes relatively lot of resources (computing time), you may want to rewrite the ISRs yourself.

JW

Posted on April 24, 2018 at 06:16

Yes, Compiler optimization is switched on.

The same implementation with TIM14_ch1, Port A pin 4.

TIM14 PB4 is able to capture interrupt till 2Khz (Maximum I have checked)

Posted on April 24, 2018 at 22:20

So, when you go over 120Hz with the input signal, TIM16 stops to throw the CC1 interrupts? And what happens if then you drop the input frequency, do the interrupts reappear or not?

Read out and check/post the TIM16 registers' content before and after the problem happens.

JW

Posted on April 25, 2018 at 13:11

Yes, Correct.

When I go over 120Hz with the input signal, TIM16 stops to throw the CC1 interrupts.

Then if I drop the input frequency, interrupt reappears.

I will read all pre and post TIM16 registers an update.