24.8.3 Quick Start Guide for TC - Timer

In this use case, the TC will be used as a timer, to generate overflow and compare match callbacks. In the callbacks the on-board LED is toggled.

The TC module will be set up as follows:

  • GCLK generator 1 (GCLK 32K) clock source

  • 16-bit resolution on the counter

  • Prescaler is divided by 64

  • GCLK reload action

  • Count upward

  • Don't run in standby

  • No waveform outputs

  • No capture enabled

  • Don't perform one-shot operations

  • No event input enabled

  • No event action

  • No event generation enabled

  • Counter starts on 0

  • Counter top set to 2000 (about 4s) and generate overflow callback

  • Channel 0 is set to compare and match value 900 and generate callback

  • Channel 1 is set to compare and match value 930 and generate callback