2024-06-16 10:59 PM - edited 2024-06-17 03:33 AM
How to read/write PWM Register in P-NUCLEO-IHM03 - Kit ? It is associated with TIM1 having 4 channels.
My motor is running for few seconds and then stop (which by default according to the documentation should be running continuously), that's why I am trying to figure out if PWM Registers are storing current values.
In debug mode, SFRs section, I found TIM1, but it has several components, which one corresponds to storing current value?
Please suggest.
Thanks in Advance!
Solved! Go to Solution.
2024-06-18 12:53 AM
Hello @tejas_amp
All the timer registers are described in the dedicated reference manual of your board, in this case, NUCLEO-G431RB
Otherwise, you should check the following registers:
TIMx_CNT: This register holds the current value of the timer counter. It's not directly related to the PWM duty cycle but can give you an idea of the timer's operation at a given moment
TIMx_CCRx: registers (CCR1, CCR2, CCR3, CCR4 for channels 1 to 4) hold the values used for comparing against the counter to generate the PWM signal
TIMx_SR : you can check this to see if there are any interrupt flags set that might indicate an issue, such as an update event or a trigger event
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-06-18 12:53 AM
Hello @tejas_amp
All the timer registers are described in the dedicated reference manual of your board, in this case, NUCLEO-G431RB
Otherwise, you should check the following registers:
TIMx_CNT: This register holds the current value of the timer counter. It's not directly related to the PWM duty cycle but can give you an idea of the timer's operation at a given moment
TIMx_CCRx: registers (CCR1, CCR2, CCR3, CCR4 for channels 1 to 4) hold the values used for comparing against the counter to generate the PWM signal
TIMx_SR : you can check this to see if there are any interrupt flags set that might indicate an issue, such as an update event or a trigger event
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-06-18 10:49 PM
Thanks !