cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743 PWM

MTS
Associate II

hello friends)))) I bought a new stm32H743 for familiarization and got confused how to implement PWM on HRTIM. I'm trying to do PWM on timer B. configured GPIO_PC8 to AF1 in GPIOx_AFRH. everything is fine there.

HRTIM_B_PERxR==2000
HRTIM_B_CMP1xR==2000
HRTIM_B_SETx1R installed bits PER and CMP1
HRTIM_RSTx1R  installed bits  PER and CMP1
HRTIM_OENR  installed TB1OEN
HRTIM_TIMxCR installed  CONT
HRTIM_MCR installed TBCEN

what else do I need for PWM to work?

6 REPLIES 6
MTS
Associate II

I don't use libraries. can you tell me what else needs to be included in the registers?do you need dead time?

MTS
Associate II

how can you understand how the HRTIM timer works if most of it is hidden from you in the header files of the "C" language? I do not know where to ask more. STM support is silent as always. if there was good documentation, I wouldn't ask.

MasterT
Lead

Read: RM0433 Reference manual

You don't have to use libraries, just study each function call that HAL_ driver does for you, and set each register manually. Doing so you are wasting a lot of time, and need to be careful to set registers in correct order - some hardware like DMA very stubborn in this aspect, it's even wouldn't tell you what is correct sequence it's expecting.

I don't use HRTIM nor 'H7, but my mantra is, read out and check content of relevant registers (HRTIM and GPIO).

You probably should see some counter changing, too.

JW

MTS
Associate II

ок