47.3. HRPwm Output

47.3.1. Overiew

pwm project configures several different types of waveforms and outputs them.

  • Forced output

  • Fault mode

  • Edge-aligned

  • Center-aligned

47.3.2. Configurations

47.3.3. Running the Demo

  • After power on, the oscilloscope can observe P0, P1 output high level, low level, edge-aligned PWM and center-aligned PWM

  • Compared with the reference PWM, the HRPWM output pulse width differs by HRPWM_SET_IN_PWM_CLK clock cycles

  • Serial port printing information:

hr pwm example


>> Test force HRPWM output on P0 and P2
Output high
Output low


>> Generate edge aligned waveform
Two waveforms will be generated, HRPWM P0 is the target waveform
whose duty cycle will be updated from 0 - 100 and back to 0; HRPWM P2 is a reference


>> Generate central aligned waveform
Two waveforms will be generated, HRPWM P0 is the target waveform
whose duty cycle will be updated from 0 - 100 and back to 0; HRPWM P2 is a reference
test done

Note

Output the PWM waveform once, and if you observe the waveform again, you need to run the program again.