cancel
Showing results for 
Search instead for 
Did you mean: 

Can STM32 Timers be reset to non-zero values to generate 'signed' capture values?

KHarb.1
Senior

I seem to remember a way to make a reset event set a timer’s value to a non-zero value. However, I didn’t see anything in the docs for the part I’m using so I’m not sure if this is a feature in STM32 parts. Is it?

An alternative is a DMA trigger on the reset that loads the CNT value. Is there a better way?

I have an in input capture value that represents a signed value. If a 16 bit timer resets to a value above 65535/2, input capture values within a known range can be sent away via DMA to the FMAC without processing steps to sort out the sign.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I don't think that accomplishes what I need. I'd need an auto-reload value and then a value other than zero to specify as the value to be reloaded.  Looks like DMA is the only way.

View solution in original post

2 REPLIES 2
Uwe Bonnes
Principal III

Check "Downcounting mode" :

In downcounting mode, the counter counts from the auto-reload value (content of the
TIMx_ARR register) down to 0, then restarts from the auto-reload value and generates a
counter underflow event.

I don't think that accomplishes what I need. I'd need an auto-reload value and then a value other than zero to specify as the value to be reloaded.  Looks like DMA is the only way.