2025-04-01 7:28 AM
Hello,
I am using the STM32F407IET in one of my projects and I have timer 1 set us as follows below
currently my channel 1 is used to record the positive rises on a incoming pulse signal and what I want to do is use the gated mode to be able to tell me when the pulse is high this way I should be able to calculate duty cycle. the issue that I am currently facing is the gated count can elapse before my DMA interrupt flags so I'm struggling to measure anything with over ~5% duty cycle. is there a way on this timer to throw an interrupt when the count has elapsed?
for example I have another timer set up to so when the count reaches the end of its counting period it throws an interrupt so I can set a bunch of flags every second and that's using the global interrupt but for some reason timer 1 doesn't have a global interrupt and I don't know how to make it interrupt from the timer.
if you need any more information please let me know and hopefully that makes sense.
Thank you
2025-04-01 8:25 AM
I have no idea whatsoever what do you want to achieve. Try to draw a timing diagram.
JW
2025-04-01 11:23 PM
All I want to be able to do is have an interrupt when the count on timer 1 elapses?
2025-04-03 11:41 AM
If you want interrupt when TIMx_CNT reaches TIMx_ARR, that's Update event, so what you want is Update interrupt.
JW
2025-04-04 3:07 AM
Yes that's what I thought, so for my configuration now I have my TIM1_ARR set to 65535 and the NVIC TIM1 Update enabled
I assumed then that once TIM1_CNT reached TIM1_ARR it would trigger a interrupt so I went into the interrupt code and put a breakpoint here
but it never stops on it even though it will stop on other interrupts.
I'm not sure if maybe I have my configuration wrong but I'm just confused as to why its not triggering.
Thank you
2025-04-05 1:22 AM
Well, I don't know. I don't use Cube/CubeMX/CubeHAL, and all I can offer is a "interrupt-doesn't-fire" checklist, but that expects register-level debugging.
JW
2025-04-05 6:34 AM
2025-04-07 1:43 AM
Thank you for your help, I relalised I was not initializing the timer 1 interrupt.