AnsweredAssumed Answered

PWM on PB.10 and PB.11 with DMA and TIMER2(CH3 e CH4)

Question asked by siqueira.erisson on Jun 28, 2012
Latest reply on Jun 28, 2012 by siqueira.erisson
How can I configure PWM on TIMER2 (CH3 and CH4)?
I would like to configure CH4 in other Channel of the DMA,
but looks that only run on Channel 2.

 /* Configuracoes DMA */
 DMA_DeInit(DMA1_Channel2);
 DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)(&TIM2->CCR3);       // Associa Periferico
 //DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)(&TIM2->CCR4);       // Associa Periferico
 DMA_InitStructure.DMA_MemoryBaseAddr = (u32)PWM_Buffer;     // Associa Memoria
 DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
 DMA_InitStructure.DMA_BufferSize = PWM_ELEMENTS;
 DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
 DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
 DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
 DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
 DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
 DMA_InitStructure.DMA_Priority = DMA_Priority_High;
 DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
 DMA_Init(DMA1_Channel2, &DMA_InitStructure);
 
 /* Habilita Canal 2 - DMA1*/
 DMA_Cmd(DMA1_Channel2, ENABLE);


Attachments

Outcomes