cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 disco TIM1 PWM DMA mode not work.

parth kothiya
Senior

i want to generate variable duty PWM using TIM1 & DMA but it not work.

uint16_t variable_duty[10] = {0,1000,2000,3000,4000,5000,6000,7000,8000,9000};
 
HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_1,(uint32_t*)variable_duty,10);
HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_2,(uint32_t*)variable_duty,10);
HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_3,(uint32_t*)variable_duty,10);

2 REPLIES 2
KnarfB
Principal III

The correct setup of everything (not shown in your code) is important. You might look at this example http://fabioangeletti.altervista.org/blog/stm32-interface-ws2812b/

KnarfB

Imen GH
ST Employee

​Hello,

Please find attached a document which helps you to solve your problem.

As I mentioned, you must add the instructions and variables and check all configurations.

Regards