필터 지우기
필터 지우기

stm32F446re Timer Compare Interrupt

조회 수: 10 (최근 30일)
Soner Özdemir
Soner Özdemir 2023년 10월 16일
댓글: Soner Özdemir 2023년 10월 22일
Hello,
Im using matlab2023b with Embedded Coder Support Package for STMicroelectronics STM32 Processors with a stm32f446re nucleo board.
I'm trying to generate an interrupt when the timer reaches to a certain value. I've chosen TIM8 for this:
When I run the model, it only generate both CC1 and CC2 interrupts at timer overflow. And it generates them even if the timer hasn't started.
How can I make the timer8 generate interrupts at certain timer values?
Kind regards

채택된 답변

Vikky Patil
Vikky Patil 2023년 10월 18일
Hello Soner,
The CC1G and CC2G are software way to generate the Capture Compare event.
We need to enable Channel 1 and Channel 2 in the CubeMX.
If the capture compare event values are fixed you can do one time configuration in CubeMX
if you want to change the compare values at run time you can add PWM output block with Channel 1 and Channel 2 enabled on it, with input capture compare values
  댓글 수: 1
Soner Özdemir
Soner Özdemir 2023년 10월 22일
Hello Vikky,
Worked flawlessly with PWM block, thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by