50.1. HRPwm Output
50.1.1. Overiew
pwm project configures several different types of waveforms and outputs them.
Forced output
Fault mode
Edge-aligned
Center-aligned
50.1.2. Configurations
Dual Channel Oscilloscope
Install the serial terminal, view board information , and configure the serial terminal parameters
HRPWM_P0 and HRPWM_P2 pins Check the information according to the board model
50.1.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.