How to generate an stm32 timer interrupt by using the embedded coder for stm32? Is there an example?

29 次查看(过去 30 天)
How to generate an stm32 timer interrupt by using the embedded coder for stm32? Is there an example?

回答(2 个)

Adit Kirtani
Adit Kirtani 2023-3-20
Hi,
To use timer interrupts, add a timer block and hardware interrupt block. You can configure the hardware interrupt block to use any of the provided interrupts available for your timer module.
There is no example for a timer-based interrupt model, but I can share this example for you instead:
This will provide a simple explanation about the hardware interrupt block. STM32 documentation will cover any confusion regarding which timer event to pick.
I hope this helps,
Adit Kirtani.
  1 个评论
Sanath
Sanath 2024-2-28
Hello,
I tried to use hardware interrupt with timer but it is not functioning for me as expected. I am trying to calculate the motor RPM from hall pulses inside the DC motor and I want the hardware interrupt to output the time of first rising edge. or at the end i want to calculate the motor rpm but I am not able to get the timer block to work. I have also tried to use the time capture block but it also behaves similar to the hardware interrupt block and provides very random values.
Also in STM programs I have seen that we are able to feedback times of next rising edge also so we have two variable but here the block can only feedback one of the factors. Could you please explain how it can be done? My program is running so i am assuming it has to do with configuration?

请先登录,再进行评论。


laila
laila 2023-3-23
hi,i want to work with stm32f446 nucleo in matlab,i have install the package of Stm32 nucleo in matlab ,but when i chek i don't find the stm32f446 nucleo,i just find other nucleo like :Nucleo F031K6 and Nucleo F103RB......

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by