cancel
Showing results for 
Search instead for 
Did you mean: 

Does the HRTIM support a DMA-based input capture (IC) mode?

TDK
Guru

I would like capture the CNT register and transfer it to a circular buffer on every rising/falling edge on 10 different signal lines. Is this possible and is there a reference which describes how to do this?

This is on the STM32H7 series.

I have read AN4539 (HRTIM cookbook). I've also looked at the STM32H745 reference manual. It's still unclear if the HRTIM peripheral supports an input capture mode similar the to general purpose timers.

The CPT1DE/CPT2DE bits control the DMA request for the capture event, which would suggest the functionality exists, but I haven't found any resources on how to use this exactly.

The EExSNS bits seem to control if an event happens on the rising and/or falling edges of each channel.

The phrase "input capture" doesn't appear within anywhere in the HRTIM section of the reference manual, so maybe it's not possible.

If you feel a post has answered your question, please click "Accept as Solution".
1 ACCEPTED SOLUTION

Accepted Solutions

It's not "input capture" as [external] inputs (as routed into external events) are only a fraction of possible triggers for the capture. Which triggers are used, is selected in HRTIM_CPTnxCR, look at that register's description.

There is a paragraph, titled Capture, describing the working of capture, in the Timer A..E timing units subchapter (in RM0433 Rev 5 it's on page 1354).

For routing of pins to external events, see the External events global conditioning subchapter and the External events mapping and associated features table there

JW

View solution in original post

5 REPLIES 5

It's not "input capture" as [external] inputs (as routed into external events) are only a fraction of possible triggers for the capture. Which triggers are used, is selected in HRTIM_CPTnxCR, look at that register's description.

There is a paragraph, titled Capture, describing the working of capture, in the Timer A..E timing units subchapter (in RM0433 Rev 5 it's on page 1354).

For routing of pins to external events, see the External events global conditioning subchapter and the External events mapping and associated features table there

JW

ColaChugger
Associate II

In rev 6 its at page 1371.

Does it even make sense to use HRTIM since the DMA only runs at half the speed of the HRTIM ?

DMA is much "slower" than that - it takes several DMA clocks to make a transfer, plus any latencies due to other DMA channels, latencies of the end-devices and paths to them (HRTIM's registers are beyond an AHB/APB bridge for example, and RAMs may impose latencies too) and conflicts with other busmasters.

So, you won't be able to capture edges which are too close to each other for the above timing constraints.

HRTIM kernel clock determines the granularity of the capture, though.

JW

rev 6 of what? Latest RM0399 is rev2.

The resolution will be better with the HRTIM, even if the ultimate throughput (edges/second) is the same as the normal timers.

If you feel a post has answered your question, please click "Accept as Solution".

> rev 6 of what? Latest RM0399 is rev2.

I mentioned RM0433 above. You did not tell us exactly which 'H7 do you have in mind...

Re-reading your original post - there's a gotcha though. While 10 inputs should be possible (10 events, 2 each into capture of the 5 sub-timers), there are only 5 DMA requests into DMAMUX - one per sub-timer - and I am not sure this limitation can be overcome in some safe way.

JW