Generating a PWM waveform utilizes the counter and a number of match/compare registers corresponding to the amount of PWMs needed. The concept of Events and States is introduced so that a programmer can add the ability to control output signals with unique timing requirements. In this example shown here, the Match registers are loaded with a value that is compared against the counter. The top line shows the timer counting up, until it reaches the a limiting value, where it resets back to 0. After each match, the event conditions define what action to take with the output pin. In the case of a PWM output, Events are essentially the signals caught from a match of the counter and the compare register. The Event may include setting an output high or low, by a simple configuration setting. These events make up the two states of the output. States can be implemented when the behavior of the counter needs to be changed by limiting or reversing the counter, or when pulse sequences need to flow in a specific order. More than one match register can be linked to a State definition. The diagrams show how these principles apply in typical use cases.