44.6.2.6.1 Waveform Output Generation Operations

The compare channels can be used for waveform generation on output port pins. To make the waveform available on the connected pin, the following requirements must be fulfilled:
  1. Choose a Waveform Generation Operation in the Waveform Generation Operation bits in Waveform register (WAVE.WAVEGEN (WAVE <2:0>)).
  2. Optionally invert the waveform output WO[y] by writing the corresponding Waveform Output y Inversion bit in the Driver Control register (DRVCTRL.INVENy).
  3. Configure the pins with the I/O Pin Controller. Refer to PORT - I/O Pin Controller for details.
    Note: Event must not be used when the compare channel is set in waveform output operating mode.

The counter value is continuously compared with each CCy value. On a comparison match, the Match or Capture Channel y bit in the Interrupt Flag Status and Clear register (INTFLAG.MCy) will be set on the next zero-to-one transition of GCC_TCCx (see Normal Frequency Operation). An interrupt and/or event can be generated on the same condition if Match/Capture occurs, i.e. INTENSET.MCy and/or EVCTRL.MCEOy is '1'. Both interrupt and event can be generated simultaneously. The same condition generates a DMA request.

There are seven waveform configurations for the Waveform Generation Operation bit group in the Waveform register (WAVE.WAVEGEN). This will influence how the waveform is generated and impose restrictions on the top value. The configurations are:
  • Normal Frequency (NFRQ)
  • Match Frequency (MFRQ)
  • Normal Pulse-Width Modulation (NPWM)
  • Dual-slope, interrupt/event at TOP (DSTOP)
  • Dual-slope, interrupt/event at ZERO (DSBOTTOM)
  • Dual-slope, interrupt/event at Top and ZERO (DSBOTH)
  • Dual-slope, critical interrupt/event at ZERO (DSCRITICAL)

When using MFRQ configuration, the TOP value is defined by the CC0 register value. For the other waveform operations, the TOP value is defined by the Period (PER) register value.

For dual-slope waveform operations, the update time occurs when the counter reaches ZERO. For the other Waveforms Generation Operations, the update time occurs on counter wraparound, on overflow, on underflow, or on re-trigger.

The table below shows the update counter and overflow event/interrupt generation conditions in different Waveform Generation Operations.

Table 44-2. Counter Update and Overflow Event/interrupt Conditions
NameOperationTOPUpdateOutput Waveform OVF Interrupt Flag/Event
On MatchOn UpdateUpDown
NFRQNormal FrequencyPERTOP/ ZEROToggleStableTOPZERO
MFRQMatch FrequencyCC0TOP/ ZEROToggleStableTOPZERO
NPWMSingle-slope PWMPERTOP/ ZEROSee section 'Output Polarity' belowTOPZERO
DSCRITICALDual-slope PWMPERZERO-ZERO
DSBOTTOMDual-slope PWMPERZERO-ZERO
DSBOTHDual-slope PWMPERTOP(1) & ZEROTOPZERO
DSTOPDual-slope PWMPERZEROTOP
  1. The UPDATE condition on TOP only will occur when circular buffer is enabled for the channel.
References:
  • Circular Buffer
  • PORT I/O