cancel
Showing results for 
Search instead for 
Did you mean: 

Timer sync and IRQ

Stastny.Petr
Associate III
Posted on September 11, 2016 at 02:48

The original post was too long to process during our migration. Please click on the attachment to read the original post.
1 REPLY 1
Posted on September 11, 2016 at 09:23

> I use TIM4 to generate period and TIM4 to generate one pulse every period.

? > The problem is that when I enable TIM4_IRQ (commented line), The TIM1 does not receive trigger. So, if you don't enable TIM4_IRQ, with this very same code, you see a train of pulses coming out of TIM1? What is that ''OnePulse'' stuff around TIM1 setup? I don't speak the ''library'' gobbledygook.

void
TIM4_IRQHandler(
void
)
{
if
(__HAL_TIM_GET_FLAG(&htim4, TIM_FLAG_UPDATE) != RESET) 
//In case other interrupts are also running
{
if
(__HAL_TIM_GET_ITSTATUS(&htim4, TIM_IT_UPDATE) != RESET)
{
__HAL_TIM_CLEAR_FLAG(&htim4, TIM_FLAG_UPDATE);
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
// TIM4->ARR = 10;/* recalculation */
}
}

How comes this compiles at all? IMO a closing bracket is missing. JW