23.3.2.3 Waveform Generation Modes

The TCD provides four different Waveform Generation modes. The Waveform Generation modes determine how the counter is counting during a TCD cycle, and when the compare values are matching. A TCD cycle is split into these states:

  • Dead time WOA (DTA)
  • On time WOA (OTA)
  • Dead time WOB (DTB)
  • On time WOB (OTB)

In a standard configuration all states are present in the order they are listed and they are non-overlapping. The compare values Compare A Set (CMPASET), Compare A Clear (CMPACLR), Compare B Set (CMPBSET), and Compare B Clear (CMPBCLR) defines when each of the states are ending and the next is beginning. There are four different ways to go through a TCD cycle. The different ways are called Waveform Generation modes. They are controlled by the Waveform Generation Mode bits (WGMODE) in the Control A register (TCDn.CTRLA). The Waveform Generation modes are:

  • One Ramp mode
  • Two Ramp mode
  • Four Ramp mode
  • Dual Slope mode

The name indicates how the counter is operating during one TCD cycle.