Skip to main content
dejan
Associate II
Jul 3, 2020 3:12 PM UTC
Solved

STM32H7 hrtimer example(s)

Are there some working hrtimer examples for STM32H7 floating around?

This topic has been closed for replies.
Best answer
Jul 4, 2020 6:39 AM UTC

There are a couple in the CubeH7 distribution.

20 replies

waclawek.jan
Super User
Jul 10, 2020 9:20 PM UTC

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

Jul 12, 2020 9:45 AM UTC

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
Jul 12, 2020 2:05 PM UTC

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

Jul 12, 2020 7:57 PM UTC

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
Jul 16, 2020 8:59 AM UTC

​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