Skip to main content
dejan
Associate II
July 3, 2020
Solved

STM32H7 hrtimer example(s)

  • July 3, 2020
  • 20 replies
  • 5504 views

Are there some working hrtimer examples for STM32H7 floating around?

This topic has been closed for replies.
Best answer by

There are a couple in the CubeH7 distribution.

20 replies

waclawek.jan
Super User
July 10, 2020

There's no multiplier in the models where HRTIM does have the sub-ns resolution, either ('F334, 'G474). Instead, the outputs are appropriately shifted by a delay line with selectable output taps. 'H7 probably does not have this delay line implemented.

The HRTIM chapter for those models sort of says this, but then blurs it with the (factually incorrect, but marketingly better) talks about multipliers and gigahertzs.

JW

July 12, 2020

I measured the average period and StDev for 10k samples with prescaler=0. When the period was set to 320 clk (25ns), I measured 24.963ns (StDev=110ps). With period set to 321 clk, measured average was 25.049ns (StDev=481ps).

So it looks like the average really can be set with 12.8GHz resolution given sufficiently high number of samples, but if the period is not a multiple of 2.5ns the clock is unstable.

dejan
dejanAuthor
Associate II
July 12, 2020

Well, aside from these results - what I meant is that HIRES timer on H7 looks very similar (if not the same ) as the one on F3 family, but for some reason ST decided to cut it out from the specs & ref. manual (even HIRES cookbook states that H7 has no DLL, but it's obviously there).

July 12, 2020

Why do you think H7 has DLL? The clock is dithering when it is not a multiple of 2.5ns. Is that how the DLL output should look like?

Vincent Onde
ST Employee
July 16, 2020

​Hello,

I confirm here is no DLL on the H7 series. You can check this with the oscilloscope: you'll see the output dithering, with 2 edges 2.5ns apart.

On a device with the DLL (F3, G4), you wouldn't see any dithering on the edge.

The reason why we cut this out of the spec are the following:

  • the dithering does not behave properly when adjusting duty cycle (it does not dither for some period value)
  • This operating mode has not been verified thoroughly, we cannot commit on the global HRTIMER functionnality.

Best regards,

Vincent