cancel
Showing results for 
Search instead for 
Did you mean: 

Input Capture Interrupt on TIM4

Gaston
Senior

Hi,

Id need to measure the frequency of an input signal using TIM4. My device is a STM32L475RCT and to do this I've used the TIM_InputCapture example from CubeIDE. In my application TIM1 is not available.

The problem is for the TIM4 I'm not able to set the Input Capture Interrupt from NVIC Interrupt table. How can I do this?

0693W00000AQ8wyQAD.png 

I've also observed the TIM17 is available and I think this timer can be linked to TIM1 somehow. The Input Capture Interrupt for TIM1 is feasible.

Any idea?

regards,

gaston

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Gaston​ ,

Thanks for your for having reporting.

Actually, backing to Nested vectored interrupt controller (NVIC) section in STM32L47xxx Reference Manual, only Timer 1 as well as Timer 8 are able to generate TIMx capture compare interrupt (x=1/8):

0693W00000AQA5mQAH.pngAlso, you can find the different Interrupt Definition in the generated stm32l475xx.h file.

Thus, only TIM4 global interrupt can be enabled through STM32CubeMX.

>I've also observed the TIM17 is available and I think this timer can be linked to TIM1 somehow. The Input Capture Interrupt for TIM1 is feasible.

I'm not sure that I understood your request, but if you meant the "Timer Link feature for synchronization or event chaining" you can find more details in STM32L475xx Data Sheet. You can refer also to the STM32 cross-series timer overview for further information.

Hope this helps you.

Khouloud.

View solution in original post

4 REPLIES 4

Hello @Gaston​ ,

Thanks for your for having reporting.

Actually, backing to Nested vectored interrupt controller (NVIC) section in STM32L47xxx Reference Manual, only Timer 1 as well as Timer 8 are able to generate TIMx capture compare interrupt (x=1/8):

0693W00000AQA5mQAH.pngAlso, you can find the different Interrupt Definition in the generated stm32l475xx.h file.

Thus, only TIM4 global interrupt can be enabled through STM32CubeMX.

>I've also observed the TIM17 is available and I think this timer can be linked to TIM1 somehow. The Input Capture Interrupt for TIM1 is feasible.

I'm not sure that I understood your request, but if you meant the "Timer Link feature for synchronization or event chaining" you can find more details in STM32L475xx Data Sheet. You can refer also to the STM32 cross-series timer overview for further information.

Hope this helps you.

Khouloud.

Hi Khouloud,

Thank you for replying. Okay, there is not possible to use the Input Capture Interrupt but I have to measure the input signal frequency/period on PB7 pin (the Hardware is already made). CubeMx shows these available timers:

0693W00000BZUwJQAX.pngAs we have seen I cannot use TIM4_CH2 with this purpose but I wonder if it is possible with TIM17, TIM8.

I've tried to set TIM8 but in this case I cannot select the Input Capture Direct mode for any channel. All of them are in conflict with others pins (Channel 1..4) or have only the Output available (Channel 5..6)

The only alternative I see is to use TIM17 but I don't know how. I'll check the information you've suggested but I'd appreciate any help from your side.

thanks in advance,

gaston

gaston,

> Okay, there is not possible to use the Input Capture Interrupt

Khouloud did not say that you cannot use interrupt upon Input Capture on TIM4, just that you have to enable the "global TIM4 interrupt" - it merges all the interrupt sources into a single interrupt vector. Then it's the task of the ISR to distinguish between the sources; Cube will do this for you if you use it.

JW

Gaston
Senior

JW, thanks for the clarification.

regards,

gaston