Skip to main content
Priyadarshini Solanki
Associate III
April 23, 2018
Question

STM32f070xB, TIM16_CH1 input capture

  • April 23, 2018
  • 1 reply
  • 1092 views

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.

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
April 23, 2018
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

Priyadarshini Solanki
Associate III
April 24, 2018
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)

waclawek.jan
Super User
April 24, 2018
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