User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 519
www.energymicro.com
20 TIMER - Timer/Counter
0
1 2 3 4
TIMER
Counter
Capture values
Com pare values
=
PRS
ADC
Output com pare/PWM
Input capture
USART
Clock
Quick Facts
What?
The TIMER (Timer/Counter) keeps track of
timing and counts events, generates output
waveforms and triggers timed actions in other
peripherals.
Why?
Most applications have activities that need
to be timed accurately with as little CPU
intervention and energy consumption as
possible.
How?
The flexible 16-bit TIMER can be configured
to provide PWM waveforms with optional
dead-time insertion for e.g. motor control, or
work as a frequency generator. The Timer
can also count events and control other
peripherals through the PRS, which offloads
the CPU and reduce energy consumption.
20.1 Introduction
The 16-bit general purpose Timer has 3 compare/capture channels for input capture and compare/Pulse-
Width Modulation (PWM) output. TIMER0 also includes a Dead-Time Insertion module suitable for motor
control applications.
20.2 Features
16-bit auto reload up/down counter
Dedicated 16-bit reload register which serves as counter maximum
3 Compare/Capture channels
Individual configurable as either input capture or output compare/PWM
Multiple Counter modes
Count up
Count down
Count up/down
Quadrature Decoder
Direction and count from external pins
2x Count Mode
Counter control from PRS or external pin
Start
Stop
Reload and start
Inter-Timer connection
Allows 32-bit counter mode
Start/stop synchronization between several Timers
Input Capture