cancel
Showing results for 
Search instead for 
Did you mean: 

How do you make a software counter reset on a HRTIM timer?

RKjær.1332
Associate

I'm currently working with the 32F3348DISCOVERY Evalution board, and I'm trying to reset the HRTIM timer A counter by setting bit 9 in the HRTIM_CR2 register.

The timer operates in non-retriggerable single-shot mode.

How do I set the bit to 1 with my code?

I've tried the method described in the following thread, but i can't seem to get it to work.

https://stackoverflow.com/questions/54735239/programing-stm32-like-stm8register-level-gpio/54745719

  

1 REPLY 1
RKjær.1332
Associate

Apparently the answer was simpler than I expected, but after struggling for hours it seemed easier to reach for help.

So if anyone runs in to this problem in the future, i solved it by accessing the HRTIM_CR2 register using the following code:

HRTIM1_COMMON->CR2 |= (0x12 << 8);

which sets bit 9 and 12 to 1, to reset Timer A and Timer D counters.