cancel
Showing results for 
Search instead for 
Did you mean: 

Chaining 2 Timers - Pause the chaining effect

dibs
Associate II
Posted on October 31, 2013 at 03:18

STM32F4xx

I have a setup where I am chaining 2 timers together with the internal trigger. TIMA is sending a TRGO to TIMB, which outputs in One Pulse Mode. This part works.

What I want to do is to programatically tell TIMB to stop listening to TIMA. Then I want to tell it to start listening to TIMA again. What is the best way to pause the internal trigger functionality?

Thank you,

#stm32f4 #timer-chaini #timer
3 REPLIES 3
Posted on October 31, 2013 at 04:53

I'm thinking you clear the SMS bit in TIMx->SMCR

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
dibs
Associate II
Posted on October 31, 2013 at 14:37

Thanks, I will try that and see how it works.

To make the problem a little more complicated: I have CC1 and CC2 on TIMB outputting One-shots. I want to be able to ''pause'' the affect of TRGI to CC2, but not to CC1, and then ''unpause'' later.

dibs
Associate II
Posted on October 31, 2013 at 21:50

I managed to get everything that I wanted working, so I will let everyone know what I learned:

I am using TIMA to trigger TIMB with one-shots on CC1 and CC2. Also, I am doing everything in the ISR of TIMA.

You can disable the internal trigger between the timers by:

TIMB->SMRC = 0;

I reenabled it by setting the register back to trigger mode. This allows for the one shot to finish its current pulse and then not be triggered again.

Trying to disable TIMB or CC1 or CC2 in TIMA ISR because the pin will be stuck in its current state. This type of thing will only work if you are certain that the one-shot has already finished.