2022-08-30 12:33 PM
I'm struggling to get DMA working on a PWM Timer. I've read just about everything i can, but not having any luck get it working.
Running this code.. produces a PWM signal as expected on the output.
TIM1->CCR1 = 50;
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
However, when I swap the code to the following, all I get is a low signal. It never produces a PWM at all. My expectation is that it should do. I have my scope on single shot, and triggered correctly.
pwmData[0] = 0;
pwmData[1] = 10;
pwmData[2] = 20;
pwmData[3] = 30;
pwmData[4] = 40;
pwmData[5] = 50;
pwmData[6] = 60;
pwmData[7] = 70;
pwmData[8] = 80;
pwmData[9] = 90;
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)pwmData, 10);
I have DMA setup for the timer
Solved! Go to Solution.
2022-08-31 06:12 AM
So I rebuilt the entire project from scratch, and its now working.
2022-08-30 03:07 PM
Red out and check/post content of TIM and DMA registers.
JW
2022-08-31 06:12 AM
So I rebuilt the entire project from scratch, and its now working.