2018-01-12 03:04 PM
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
2018-01-14 01:33 PM
if you want to adjust 3x PWM signals,
under a different timer interrupt with high priority, say every 100uS, write all three PWM values. from your sinewave table.
easier without a DMA,
to use a DMA, you would use a circular buffer for the whole table, but you only have one pointer per DMA
now you need 3 DMAs ?