cancel
Showing results for 
Search instead for 
Did you mean: 

Bonjour, je veux créer une fonction pour calcule les nombres d'impulsion de signal avec une périodisation de 40 ms j'ai configure le timer en mode ETR et reset le Counter puis en lance le Counter mais on ne peut pas de vérifie si le Counter est incrément

Anaghim
Associate II

0693W00000NpgK7QAJ.png

17 REPLIES 17

This is an English language forum. Please don't exclude others from your conversation.

JW

what ?

TBH I'd much prefer people to use whatever language they are most comfortable in expressing themselves, explaining the problem as completely as possible, and letting Google Translate get me something to interpret. I'd certainly prefer this over a brief word-salad as someone tries to express things awkwardly in English. I'll respond in English, and people can translate that back.

Graphics / screen-shots don't translate well, but will suffice in a push.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I would avoid the TIM1->SR RMW forms, the register is designed to automatically mask the writes such that there aren't race conditions, where you clear flags indiscriminately.

TIM1->SR &= 0xFE; // BAD FORM

TIM1->SR = 0xFE; // HOW HARDWARE WAS DESIGNED

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

This is probably a cultural thing. I grew up in a multilingual environment where trying to use the partner's language was a matter of courtesy as well as prudence. Sometimes this ended up in negotiating a common language and using third language (German, legacy of the Austrian empire) was one of the options.

In an a-priori given language forum, the person who asks should go the extra mile to make himself understood, otherwise he excludes himself from possible answers from those who are not willing to volunteer to answer, if it involves extra steps.

After all, how much of the STM32-related material is available in French?

JW

PS. I wonder who voted my rant as Best post here.

In TIM2 interrupt, you don't need to anything else, just read out TIM1->CNT and subtract it from previously read out value to find out the difference, and store the new value. Don't stop TIM1, don't clear TIM1->CNT. TIM1 is 16-bit counter, so you have to take this into account when TIM1->CNT overflows.

But first make sure TIM1 works - simply set it up as you intended, enable, and then without doing anything with it just observe in register view of debugger, if TIM1->CNT counts accordingly to the input signal.

JW

thanks.

I think it's a student's school homework, and he's trying to realize what's in the statement. Obviously it seems more efficient to achieve something other than what is requested...