cancel
Showing results for 
Search instead for 
Did you mean: 

HAL SysTick interrupt is not 1ms!

MBert
Associate II

Hi all...

I having an issue with HAL SysTick interrupt on STM32F072B mcu:

With default configuration (see the image) and an external 8MHz oscillator,

if i toggle a pin in the SysTick interrupt, i get a state change every 0.75 ms instead of 1 ms...

What is wrong? I have to set a calibration register or similar?

Thank you all for support 😎

Matteo

1 ACCEPTED SOLUTION

Accepted Solutions
MBert
Associate II

Thank you all... but I found the mistake !

I was using a broken oscilloscope, with wrong time base calibration !!!!!

:persevering_face: :pouting_face: :face_screaming_in_fear:

Regards!

View solution in original post

5 REPLIES 5
Ozone
Lead

> With default configuration (see the image) and an external 8MHz oscillator,

> if i toggle a pin in the SysTick interrupt, i get a state change every 0.75 ms instead of 1 ms...

Check the schematics of your board, I suppose the default 8 MHz quartz frequency is not correct.

Read out and check the systick registers.

If possible, output SYSCLK to MCO and check.

Alternatively, try to use HSE as SYSCLK directly, without using PLL. How does the systick clock change?

> external 8MHz oscillator

Is HSEBYP set in RCC.CR?

JW

MBert
Associate II

Thank you all... but I found the mistake !

I was using a broken oscilloscope, with wrong time base calibration !!!!!

:persevering_face: :pouting_face: :face_screaming_in_fear:

Regards!

Thanks for coming back with the solution.

Please select your post as Best so that the thread is marked as solved.

JW

this is why every PCB should always contain atleast one led, make it blink with X second intervals. easy to observe with eye if the clock speed is totally off from expected.

something i learned the hard way with my first embedded projects.