2013-10-30 07:18 PM
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 #timer2013-10-30 08:53 PM
I'm thinking you clear the SMS bit in TIMx->SMCR
2013-10-31 06:37 AM
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.2013-10-31 01:50 PM
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.