Timer interrupt not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-06 3:38 AM
but when i use the interrupt to set the duty cyles always the phase voltages are zero
how to dynamically set the phase voltages in the timer interrupt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-06 4:03 AM
1. Use the code insert feature instead of screen dumps.
2. Is your timer callback ever called? Maybe you started the timer without period interrupt enabled. Use the debugger to check it.
3. If it is called, use the debugger to check the values written to CCRx registers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-06 4:20 AM - edited ‎2024-09-06 4:21 AM
1.Okay got it
2. Yes the timer callback is called i could see the elec angle value being updated.
this is my timer config where should i enable period interrupt
3. is there a way to check the ccr registers in the live expressions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-06 5:14 AM
HAL_TIM_PWM_Start does not turn on any interrupts. Use HAL_TIM_PWM_Start_IT instead if you want callbacks to happen.
You can add TIM1->CCR1 to the live expressions to see it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-09-06 5:26 AM - edited ‎2024-09-06 5:33 AM
its says failed to evaluate expression
Also i'm not using HAL_TIM_PWM_Start i'm using HAL_TIM_Base_Start_IT(&htim1) to start the interrupt @TDK
EDIT: tried using this
HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1);
HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_2);
HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_3);
but still same behaviour maybe if i could see whether if the ccr values changes in the live expression would be helpful to debug
