AnsweredAssumed Answered

Hello, i'm trying to generate 3ph pwm sinewaves using dma, sine lookup table and timer1.

Question asked by toner.gene on Jan 13, 2018
Latest reply on Jan 14, 2018 by T J

I working with a nucleo-f410rb and atollic truestudio along with cubemx. I can get a channel1 (or 2 or 3) of timer1 to work using HAL_TIM_PWM_Start_DMA but i can not get the three to work together. I've tried using  HAL_TIM_DMABurst_WriteStart by constructing a sine lookup table holding n pairs of three PWM values and trying to 

 

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_3);
HAL_TIM_DMABurst_WriteStart(&htim1, TIM_DMABASE_CCR1, TIM_DMA_UPDATE, (uint32_t *)tab_a, TIM_DMABURSTLENGTH_3TRANSFERS);

where tab_a holds the values for CCR1,2,3. 

 

Can this be done (3 phase pwm sine waves) ? I seem to be missing something basic here.

 

Thanks,

Gene

Outcomes