General Purpose Timers - Motorola DragonBall MC68328 User Manual

Integrated processor
Table of Contents

Advertisement

Timer
• 0.25-ms resolution
• Time-out causes system RESET or issues a maskable interrupt

6.1 GENERAL PURPOSE TIMERS

The clock input to the prescaler may be selected from the main clock (divided by 1 or by 16),
from the corresponding timer input (TIN1 or TIN2) pin, or from the 32-kHZ clock. TIN is syn-
chronized to the internal clock. The clock input source is determined by the CLK SOURCE
bits of the corresponding timer control register (TCR). The timer prescaler register is an 8-
bit wide read/write register.The prescaler is programmed to divide the clock input by values
from 1 to 256 (i.e. 0 to 255 in the register). The prescaler output serves as an input to the
16-bit counter.
Each timer may be configured to count until it reaches a reference. Then, it either starts a
new time count immediately or continues to run. The free run/restart (FRR) bit of the corre-
sponding TCR selects each mode. Upon reaching the reference value, the corresponding
timer-status register (TSR) bit is set and an interrupt is issued if the interrupt-enable bit in
TCR is set.
Each timer may output a signal on the timer-output (TOUT1 or TOUT2) pin when it reaches
the reference value, as selected by the output mode (OM) bit of the corresponding control
register, TCR. This signal can be an active-low pulse for a system clock-wide, or a toggle of
the current output under program control. The output can also serve as an input to the other
timer, resulting in a 32-bit timer.
Each timer has a 16-bit timer-capture register that latches the value of the counter when a
defined transition (of TIN1 or TIN2) is sensed by the corresponding input-capture edge
detector. The type of transition triggering the capture is selected by the capture edge (CE)
bits in the corresponding TCR.
When a capture or reference event occurs, the corresponding TSR bit is set and a maskable
interrupt is issued. The timer is not activated after reset and must be programmed as users
require.
6-2
MC68328 DRAGONBALL PROCESSOR USER'S MANUAL
WATCHDOG TIMER
COMPARE REGISTER
COMPARATOR
16-BIT COUNTER
CLOCK
PRESCALER
4KHZ
Figure 6-2. Watchdog Timer Block Diagram
INTERRUPT
RESET
MPU BUS
32KHZ CLOCK
MOTOROLA

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents