cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0: Multiple interrupts and TIM2 Clock

a239955_stm1
Associate II
Posted on June 04, 2014 at 07:00

The original post was too long to process during our migration. Please click on the attachment to read the original post.
4 REPLIES 4
Posted on June 04, 2014 at 13:28

I would do this differently. I don't think you need the enable/disable, but the M0 is not my thing.

You'd be better to let TIM2 free run, and take time stamps from TIM2->CNT at entry to the handler, you then subtract the time of last entry, from that of the current, and you'd have the time elapsed between the two.

Are you sure your EXTI is not getting a bouncing signal from a key press or something?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
a239955_stm1
Associate II
Posted on June 04, 2014 at 16:57

Thanks for your input.

Input signal is a square wave coming from a function generator. So no bouncing in input.

I assumed ''PCLK_Frequency'' is the clock source of TIM2. Is it correct?

shoaib
Associate II
Posted on March 11, 2016 at 15:42

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6jl&d=%2Fa%2F0X0000000buI%2Fqe8OIsKKP.L8x8XxZyA8cSqOl7Nv0pDLypwaeTPIQjk&asPdf=false
Posted on March 11, 2016 at 17:13

You have created this huge web of unnecessary complexity and interrelationship. Please discuss this with your advisors or professors.

As I believe I've already explained, this is not how this works.

To revisit:

The timer triggers the ADC directly, the ADC transfers each sample via DMA, all eight and then when it calls the DMA interrupt the data is in the array you asked it to put the data in. There is only one interrupt, and neither the TIM or ADC generate it.

A timer triggered ADC is not in continuous mode.

Please do not hijack threads with off topic questions.

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