cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use a timer complementary output as input compare

Ludovic Durand-Texte
Associate III

Hi,

I am using PB0 and PB1 (no choice) alternatively but synchronized as PWM output and input/compare.

For output, the only way to have two different DMA channels is to use a complementary output for one the two I/O.

It seems a timer complementary output (ex: PB1-TIM8_CH3N) is not connectable to the TIMER TI1, am I right?

Is there another way than the one to manage the PWM output/input compare sequence on the same channel with TIM3 CH3 & 4 one after the other on the same Channel 5 of DMA1 S7 and S2?

Thank's

3 REPLIES 3

> It seems a timer complementary output (ex: PB1-TIM8_CH3N) is not connectable to the TIMER TI1, am I right?

Yes.

You did not tell us which STM32 are you using; in following I assume STM32F407.

> Is there another way than the one to manage the PWM output/input compare sequence on the same channel with TIM3 CH3 & 4 one after the other on the same Channel 5 of DMA1 S7 and S2?

That's not a collision. The DMA in 'F2/F4/F7 uses a somewhat confusing terminology: the individual units which perform the transfers, are called streams; whereas the triggering inputs to these units (through input multiplexer) are called channels. In other words, you can run DMA triggered from TIM3_CH3 at DMA1 Stream7 (with the channel multiplexer, controlled by DMA_S7CR.CHSEL set to 5) and triggered from TIM3_CH4 at DMA1 Stream 2 (with channel in DMA_S2CR,CHSEL also set to 5) simultaneously.

JW

Ludovic Durand-Texte
Associate III

Thank's for your answer.

I can't make the two timer channels running sharing the same dma channel...

According to the document http://www.st.com/web/en/resource/technical/document/application_note/DM00046011.pdf

page 8 : "More than one enabled DMA stream must not serve the same peripheral request."

As I understand, a peripheral request goes through a DMA Channel. So, it seems that sharing, I mean in the same time, the channel 5 for the two DMA1 Stream 2 and 7 is not possible.

What did I miss ?

Ludovic Durand-Texte
Associate III

Oh sorry, I CAN make it running, a bug...

I perfectly understand what a stream is, but the dma channel notion is not clear.

The dma Channel is selected in the dma, so how the dma knows which peripheral is requesting when two of them shares the same dma channel ? Is it thanks to the Channel/dmaStream matrix used by what you call input multiplexer?

But in such case, for instance, if TIM2_CH2 and TIM2_CH4 are both requesting on DMA1_CH3, how DMA1_S6 knows which of TIM2_CH2 or TIM2_CH4 is requesting?

So, is it right to say that what must be unique is the couple (dmaChannel,dmaStream)?

In such case it is possible, for example, to use only the DMA_CH4 to manage all the USART 2 to 5 RX and TX through the streams 0 to 7. Am I right?

Maybe it would be easier to say when there is a collision?

Thank you