Skip to main content
MBert
Associate
Jan 14, 2020 8:46 AM UTC
Solved

HAL SysTick interrupt is not 1ms!

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 8)

Matteo

This topic has been closed for replies.
MBert
MBertBest answer
Associate
Jan 14, 2020 2:26 PM UTC

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!

5 replies

Ozone
Principal
Jan 14, 2020 9:41 AM UTC

> 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.

waclawek.jan
Super User
Jan 14, 2020 9:47 AM UTC

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
MBertAuthorBest answer
Associate
Jan 14, 2020 2:26 PM UTC

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!

JoniS
Senior
Jan 14, 2020 2:56 PM UTC

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.

waclawek.jan
Super User
Jan 14, 2020 2:51 PM UTC

Thanks for coming back with the solution.

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

JW