2022-01-11 02:01 PM
I am having trouble getting the TIM1 timer on the STM32F413VG chip to output PWM to pin PE9. My configuration and code in STM32CubeIDE can be seen in the attached images. Have I done something wrong? Every example I have found out there skips TIM1 and goes straight to TIM2, could it be that TIM1 does not support PWM generation, even though it is an option in CubeIDE?
Solved! Go to Solution.
2022-01-11 03:24 PM
Should work.
Initialize PE9 as GPIO output and toggle to verify you're actually monitoring that pin.
2022-01-11 03:02 PM
TIM1 and TIM8 are Advanced Timers, you must explicitly enable the PWM outputs. HAL_TIM_PWM_Start()
Show the actual pin and clock initialization code.
2022-01-11 03:24 PM
Should work.
Initialize PE9 as GPIO output and toggle to verify you're actually monitoring that pin.
2022-01-11 04:32 PM
Read out and check/post content of TIM and relevant GPIO registers content.
JW
2022-01-12 10:34 AM
Thanks a lot for the replies guys. As TDK said, it should work, and it did. The problem was that I am apparently confused with the orientation of the chip. So when I measured the correct pin, I got the expected output :). I assume you guys can tell me the logic here: In the datasheet, the LQFP100 chip is presented like this:
As you can see (you guys are probably familiar with this, but I will try to explain my confusion), the chip is presented without any of the orientation markers, nor text that specifies the orientation. Therefore I assumed that the text on the physical chip would match the orientation of the figure, but to my surprise, it is actually rotated 90 degrees CCW.
Would any of you care to explain to me why that is, and where I can find documentation for this in upcoming projects?
2022-11-10 11:16 PM
Hi,
From the above code, i have used, I am getting output. But from this method how to calculate the PWM frequency can you please suggest me.
2022-11-11 02:34 AM
the orientation marker on a chip -> is to know, where is pin no. 1 .
here you see all the pin numbers ... too much information ???
2022-11-11 05:33 AM
Marking information is found in the datasheet.
With text oriented left to right, pin one is bottom-left.