How do I use the Action Qualifier to configure the F28x ePWM waveform?

Hi I was using Up/Down count and everything was working fine. Then I switched to Up Count but I can not get the expected PWM waveforms on my oscilloscope. Anything wrong? Please help me.

(No subject)

It's not too difficult

The F28x ePWM module has a 16 bit counter for which you set a period. When it counts up to the period it can either start counting back down (Up/Down mode) or restart at zero (Up node). This is set in the Count Mode field. There are 2 output pins for each PWM unit, A & B. There are two corresponding compare registers CMPA and CMPB, which can be used to set the value on the output pin to a logical 1 or 0. The CMPA/B regs are set by the value you provide on the A/B input pins to the ePWM block. The pins expect an fx1.16 (16-bit scaled integer with 1 magnitude bit) value. A value of .2 give a value of 20% of full period to the respective CMP register, a value of .5 give a 50% of full period value to the CMP register and so on. Each A/B output can be affected by 6 possible events:

  • counter = zero match
  • counter = period match
  • CMPA reg up count match
  • CMPA reg down count match
  • CMPB reg up count match
  • CMPB reg down count match

The above events can be used to set the A/B output to a 1, 0, T (toggle) or X (ignored). Below is the relevant portion of the ePWM config screen when you right click on the ePWM block:
Action Qualifier
The configuration above will use CMPA to modulate the on-time for output A, and CMPB modulates off-time for output B. Note that you have complete flexibility to use CMPA to modulation output B and CMPB to modulate output A, though it is not recommended.
The CMPA/B down count match only makes sense if you are doing up/down or down count. If you choose Up count, a Down count match will never happen so you should choose either a Z (zero count) or P (period) match in addition to a CMPA/B Up count match.