24.8.2 Quick Start Guide for TC - Match Frequency Wave Generation

In this use case, the TC will be used to generate a match frequency. The TC module will be set up as follows:

  • GCLK generator 0 (GCLK main) clock source

  • 16-bit resolution on the counter

  • No prescaler

  • Match frequency wave generation

  • GCLK reload action

  • Don't run in standby

  • No inversion of waveform output

  • No capture enabled

  • Count upward

  • Don't perform one-shot operations

  • No event input enabled

  • No event action

  • No event generation enabled

  • Counter starts on 0

  • Capture compare channel 0 set to 4000

When system clock is 8MHz, and the compare channel 0 is 4000, the output frequency will be about 1KHz ( 8000000/4000/2 ).