cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 HRTIM Single-shot mode

KGane.1
Associate III

Hi, I want to use HRTIM to generate active low pulse of width 50ms. The functionality is to generate single 50ms pulse to enable external counter IC. Are there examples to configure HRTIM in single-shot mode.

HRTIM kernel freq is 200MHz. Prescaler is 4=50MHz. This gives 20ns resolution on counter. For 16-bit counter, we can generate pulse width of 1.310ms. How to generate pulse width higher than 1.31ms?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RomainR.
ST Employee

Hello KGane.1 (Community Member),

Is it mandatory for your application to use HRTIMER with 20ns resolution to generate 50ms pulse ?

Do you have to combine this one shot pulse with other complex PWM waveforms generated by the HRTIMER ?

if yes, you must drastically decrease the frequency of STM32H7 buses to obtain a suitable resolution.

Otherwise use a 16 or 32bit GPTimer in one shot, which offers more flexibilities in prescaler ratio from input buses frequency. 

Best regards,

Romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
RomainR.
ST Employee

Hello KGane.1 (Community Member),

Is it mandatory for your application to use HRTIMER with 20ns resolution to generate 50ms pulse ?

Do you have to combine this one shot pulse with other complex PWM waveforms generated by the HRTIMER ?

if yes, you must drastically decrease the frequency of STM32H7 buses to obtain a suitable resolution.

Otherwise use a 16 or 32bit GPTimer in one shot, which offers more flexibilities in prescaler ratio from input buses frequency. 

Best regards,

Romain,

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KGane.1
Associate III

@RomainR.​ Thanks for comments.

I am using HRTIM as MHz clock source to an external device. I want to align counter enable signal with clock. So i thought it would be better to use HRTIM to generate single pulse of fixed width.

It would be helpful if the timing units in HRTIM supports more prescaler value. Currently it is limited to /1,/2,/4.

I'll look for GP timer to implement the functionality.

I am also looking for external clock generator/pwm controller/one shot pulse generator which supports generating precise clock and one shot pulse. Please let me know if ST has part which supports generating clock and single pulse.

RomainR.
ST Employee

Hi @KGane.1 

I understand your goal by using HRTIMER, but it only supports DIV 1, 2, 4 prescalers.

So it is not suitable for your application.

Regarding your external clock generation part, maybe you should do the research precisely with your needs in terms of frequency and precision on website.

I thank you in advance to mark this post as answered

Best regards,

Romain

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.