2024-06-01 09:01 PM
I'm using CubeIDE and I want to have an output compare event on TIM1 CH1 trigger an input capture event on TIM8. It doesn’t seem like there is a way to do this with normal timer functions and CubeIDE. Is it possible if I work outside CubeIDE?
As a backup, I believe I can also use a DMA transfer triggered by TIM1 CH1 output compare to save TIM8->CNT to memory. Is this a viable solution?
Solved! Go to Solution.
2024-06-02 01:32 PM
If I remember correctly, the only "regular" way is the one described by Waclawek.Jan. You can use DMA to read CNT register, but you have to count with some jitter. It can be few ticks (of core clock), but in case another DMA channels running it can be more. If you do not need "single tick" precision, then it is viable.
But you can also start another timer synchronously with TIM8 and perform capture on it.
2024-06-02 12:01 AM
> I want to have an output compare event on TIM1 CH1 trigger an input capture event on TIM8.
In TIM1_CR2.MMS, select OC1REF as TRGO source. In TIM8_SMCR.TS, select appropriate ITR value for TIM1 to be TIM8's TRGI. In TIM8_CCMRx.CCxS set to 0b11 for TRC to be the capture trigger source.
JW
2024-06-02 12:47 PM
I forgot to mention that TIM8 is being reset via ITR9 from TIM20, so the trigger is already in use. If there isn't another way, I'm back to attempting the DMA implementation above.
2024-06-02 01:32 PM
If I remember correctly, the only "regular" way is the one described by Waclawek.Jan. You can use DMA to read CNT register, but you have to count with some jitter. It can be few ticks (of core clock), but in case another DMA channels running it can be more. If you do not need "single tick" precision, then it is viable.
But you can also start another timer synchronously with TIM8 and perform capture on it.
2024-06-02 02:58 PM
You can also interconnect TIM1_CH1 and TIM8_CH1 externally, using two pins.
JW