AnsweredAssumed Answered

Interrupt Doesn't occur

Question asked by mattoo.anuj on Sep 1, 2016
Latest reply on Sep 1, 2016 by Clive One
I am working on STM32F030 Discovery. I trying to generate 1ms interrupt. But the code doesn't work. But when change the htim3.Init.Period from 0 to 1, it works with 2ms interrupt. But I need 1ms interrupt. Frequency is set at 48MHz.
Here is my TIM3_Init

void TIM3_Init(void)

  TIM_ClockConfigTypeDef sClockSourceConfig;
  TIM_MasterConfigTypeDef sMasterConfig;

  htim3.Instance = TIM3;
  htim3.Init.Prescaler = 48000;
  htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
  htim3.Init.Period = 0;
  htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;

  sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
  HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig);

  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
  HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig);