6.1 MCC Melody Timer

Tips related to Timer configuration, when using either Driver or PLIB.

6.1.1 MCC Melody Timer Driver - Setting Period

This section details considerations related to Timer Driver configuration when setting a required period.

Configuring the Timer Driver can be done in multiple ways:

Multiple PLIBs may be available. One can be chosen to assign hardware for use by the driver.

Multiple units of time are available within the driver:

As an example, setting the timer period to 100 ms can be accomplished in this way:

6.1.2 MCC Melody Timer PLIBs - Setting Period

This section details considerations related to Timer configuration when setting a required period.

When configuring a Timer PLIBs in Melody, start by setting the value for the Requested Period (s), where ’s’ is in seconds, then ensure that Miniumum Period ≤ Requested Period(s) ≤ Max Period by adjusting:

  1. Timer Mode - e.g., 8-bit vs 16-bit (the 8-bit counts to 256, leading to a shorter period than the 16-bit, which counts to 65,536).
  2. Clock Prescaler - Divides the input to the Timer from the selected Clock Source.
  3. Postscaler - Divides the output frequency of the Timer by the selected ratio.
  4. Clock Source - These are the various clocks from which the Timer can be clocked.

For example, below are two of the many ways in which the desired period of 100 ms (0.1s) can be achieved: