How to use timer1 for pwm input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 11:14 AM
I use STM32F103c6 timer1 for pwm input . after right config in cubemx, and in simulink enable timer1 ch1 interrupt. Then auto code gen, but code in Keil the ch1 interrupt not enable, its callback not registered, the timer also not started. Want to know how to use timer1 pwm input in simulink, look forward to reply! Already Confused for one week ...
- Labels:
-
STM32-MatTarget
-
STM32F1 Series
-
TIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 11:47 AM
I don't think you'll find much dedicated Simulink/Matlab support here.
Which STM32?
Make sure that the interrupts have the same name as listed in the vector table, usually in startup file. Note, that TIM1 is usually an exception, having several separate interrupts for different groups of signals (Update, CC, etc.) Read the Interrupts chapter in RM.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-21 7:13 PM
Thx for your answer.
- It is F103C8.
- For time 1, in simulink it is GUI selection.i think there is no mistake. And after config in cubemx, auto code contain tim1-cc-irqhandler(). But no hal-Tim-irqhandler call. And in init, no cc-irq register and no timer start.
- So wonder whether the software don’t support auto-gen for timer1 pwm-input , or i did something wrong. But in demos,no such application. So please help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-04-29 12:27 PM
Hi, @PYong.2​ did you enabled the IRQs for TIM1 under NVIC in CubeMX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-05-09 3:59 AM
yes, already enabled the IRQs for TIM1. For no solution,I choose to ​add start code to fix it. Thx!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-07 1:13 PM
And did you try a Cube configuration like this?
