MHz frequencies on OUTPUT
hey there
I have a stm32f103 blue pill board which I wish to generate MHz frequencies on pinC13.
I have used TIM1. it starts and interrupts and on each interrupt I toggle PC13
like so
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
if(htim->Instance == TIM1)
{
HAL_GPIO_TogglePin(GPIOC,GPIO_PIN_13);
}
}also I set APB1 to 64MHz in Cube.
and here is my TIM1 config(this part is generated by Cube so I just bring up the Prescaler and Period part )
htim1.Instance = TIM1;
htim1.Init.Prescaler = 0;
htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
htim1.Init.Period = 1;
htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
htim1.Init.RepetitionCounter = 0;as you can see with these Prescaler and Period I should have frequency around 64000000/(0+1)(1+1)~32MHz
but on Oscilloscope I see around 125kHz!
I know my oscilloscope TIM/DEV is limited to us but at least I expect to see to parallel lines showing high frequency
what is the problem?
