2012-06-28 10:38 AM
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); #dma-timer2-ch3-ch4-pb.10-pb.112012-06-28 10:57 AM
DMA1_Channel2 is driven by TIM2_UP, and only that channel.
A 32-bit transfer doesn't help as the two 16-bit registers you want to write are too far apart.2012-06-28 12:38 PM
THANKS CLIVE1,