I'm trying to configure the timer3 to have a frequency of 1KHz, without success.

Here's my configurations:

**System Clock:**

```
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 4;
RCC_OscInitStruct.PLL.PLLN = 64;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;

```

So SYSCLK=64MHz

**Timer3:**

```
htim3.Instance = TIM3;
htim3.Init.Prescaler = 480;
htim3.Init.CounterMode = TIM_COUNTERMODE_UP;
htim3.Init.Period = 66;
htim3.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
if (HAL_TIM_Base_Init(&htim3) != HAL_OK)
{
    Error_Handler();
}

sClockSourceConfig.ClockSource = TIM_CLOCKSOURCE_INTERNAL;
if (HAL_TIM_ConfigClockSource(&htim3, &sClockSourceConfig) != HAL_OK)
{
    Error_Handler();
}

sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim3, &sMasterConfig) != HAL_OK)
{
    Error_Handler();
}

if(HAL_TIM_Base_Start_IT(&htim3) != HAL_OK)
{
    /* Starting Error */
    Error_Handler();
}

```

So APB1 Timer Clock = 32MHz.

So the Timer3 Clock Frequency should be (1/(32MHz/480))\*66, which is approximately 1Khz, but for some reason I'm getting 500Hz.

Any help will be greatly appreciated.

EDIT: 

**My interrupt function:**

```
/*check if interrupt is from TIMER 3*/
    if (htim->Instance!=TIM3)
        return;

    timer_counter++;

    if (timer_counter == 65500)
        timer_counter=0;

    if(timer_counter%1000==0)
    {
        uint16_t test[4];

        Send_CAN(&CanHandle2, 8, test);
    }

```

I'm receiving the CAN message every 2 seconds instead of every second.