cancel
Showing results for 
Search instead for 
Did you mean: 

Recommendations for using timers

whitehorsesoft
Associate III

I've been struggling to demonstrate timer capabilities, with some success but a lot of unexpected failures. I don't see any "application notes" (ANxxx) in the documentation and very little howtos in the reference manual. Is there a list of recipes for code setup for common timer usages (countup/down, repeating, using capture/compare for countup, etc)?

4 REPLIES 4
TDK
Guru

There are a whole bunch of example projects out there for various timer setups. If you are looking for existing code, I'd recommend using the Example Selector in STM32CubeMX/IDE and loading those, or examining the code online.

STM32CubeF4/Projects/STM324xG_EVAL/Examples/TIM/TIM_TimeBase/readme.txt at 4f7969ab6fcb229bc5d28e8e87187fd34e271f56 · STMicroelectronics/STM32CubeF4

 

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

> STM32CubeMX/IDE

...for 8-bit STM8?

First mention of 8 bit. But as a rule there is always lots of code on github for anything you can think of.

> First mention of 8 bit.

Asked in 8-bit specific forum (look at url, and at top where it says "STMicroelectronics Community > Product forums > STM8 MCUs".

 

> always lots of code on github

If I want, for instance, to see if UIE in TIMx_IER (in RM0016) is necessary if I'm not using interrupts (manually checking status codes in software loop), or if I can get by with just just CEN in TIMx_CR1, there is precious little in the way of examples. This is just an example. My point is that even the best places (this is one of the best, as are all other articles in his "The Way of the Register" series) explain what to do, but not specifically why one register is used over another, or in what combination to achieve what is desired.