2018-11-29 01:01 AM
Hello,
I'm working with CubeMX to configure my MCU (STM32F030CCT6TR) for my school project. I want to generate a PWM with DMA but I don't know how to do it even after doing researches.
Currently I configure my DMA as attached.
Can you help me ?
Best regards,
John
2018-11-29 02:43 AM
Hi @JDooe ,
I'd highly recommend you to refer to TIM example under the STM32CubeF0 V1.9.0 firmware package.
It's found under the path below:
STM32Cube_FW_F0_V1.9.0\Projects\STM32F030R8-Nucleo\Examples\TIM\TIM_DMA
The example titled "TIM_DMA" provides a description of how to use DMA with TIMER Update request
to transfer Data from memory to TIMER Capture Compare Register. The objective of the example is to configure TIM1 channel 3 to generate a complementary PWM signal.
You may take this example as a reference to correctly configure your peripheral.
Khouloud.
2018-11-29 03:00 AM
Hi @Khouloud GARSI ,
Thank you for your help. I will look this up.
Best regards,
John
2018-11-29 03:15 AM
You're always welcome!
If you have any further questions, do not hesitate to post them on our STM32MCUs Forum ;)
Best regards,
Khouloud.
2018-12-10 02:22 AM
Hello,
I found examples that use TIM DMA but the target wasn't the same as mine. So I tried to understand the code of the main.c and adapt it.
I found the problem. It was from my TIM configuration I didn't initialize the good Channel that I use for my PWM.
Now I can generate a PWM but when I want to change the value of my buffer that i use to generate the PWM, the PWM doesn't change.
Can you help me ? Do you have any idea how to debug the code of the main.c, attached?
Best regards,
John
2019-01-21 11:40 AM
Up
2021-02-14 09:53 PM
Hello @JDooe
I too face the same issue with different mcu, did you find any solutions for the issue stated.
If so kindly reply with it.
Regards,
AK