2021-05-16 08:44 AM
I am working on controlling of a stepper motor with STM32F446 and want to generate a PWM with variable frequency (trapezoidal) and stop it after some specified (n) pulses. I want to do this with register programming not HAL functions. So I want to know three steps bellow:
could someone help me in register programming?
Solved! Go to Solution.
2021-05-16 12:35 PM
Start by reading the TIM chapter in RM. It won't be clear at the first reading, so repeat until it starts to be a bit clearer.
JW
2021-05-16 12:35 PM
Start by reading the TIM chapter in RM. It won't be clear at the first reading, so repeat until it starts to be a bit clearer.
JW
2023-04-03 06:06 AM
Hi, I was curious, is there an official documentation that gives the steps listed by you? I went through reference manual and datasheet, but still, without this comment of yours, I would have missed some of the steps since I couldn't find any other clear step by step list.
2023-04-03 06:07 AM
I know most of this should be intuitive, but it wont be for beginners, that's why I'm asking.
2023-04-03 10:57 AM
> is there an official documentation that gives the steps listed by you?
I don't know, but given that "officially" you are supposed to click in CubeMX, I don't think so.
Maybe if you click in CubeMX and then let it generate Cube/LL code, you'll see the individual steps, if you don't mind the "name mangling" of LL. I don't use Cube so don't know.
You can also look at AN4776 and AN4013. Not exactly what you're looking for, but maybe englightening. Maybe not.
> I know most of this should be intuitive
I wouldn't call it intuitive. What I did is exactly wrote above: I read the TIM chapter (plus the relevant portions of rest of RM and DS) multiple times, while experimenting. After you set up the timers a dozen of times and make a dozen of errors, it then starts to be sort of "intuitive" ("familiar", rather).
JW