![](http://datasheet.mmic.net.cn/120000/M37549G2-XXXFP_datasheet_3558779/M37549G2-XXXFP_29.png)
Rev.2.02
Mar 31, 2009
REJ03B0202-0202
7549 Group
Timers
The
7549 Group has two 8-bit timers (timer 1 and timer 2) and
one 16-bit timer (timer A).
Timer 1 and timer 2 share the same 8-bit prescaler (prescaler 12).
Each timer and prescaler has a separate timer latch and prescaler
latch.
The division ratio of every timer and prescaler is 1/(n+1), where
n is the value of the timer latch or prescaler latch.
The timers decrement at each count clock input. When the count
value reaches “0”, an underflow occurs at the next count pulse.
The value of the corresponding timer latch is reloaded into the
timer at underflow and counting is continued. When a timer
underflow occurs, the interrupt request bit corresponding to each
timer is set to “1”.
Prescaler 12 (PRE12)
Prescaler 12 is an 8-bit prescaler that counts the signal selected
by the prescaler 12 count source selection bit. The count source
can be selected from
φSOURCE/16 and XCIN input clock.
Writing to prescaler 12 writes the value to both the prescaler
latch and prescaler.
Reading from prescaler 12 reads the prescaler 12 count value.
The initial value is set to “FF16” after reset.
The division ratio of prescaler 12 is 1/(n+1), where n is the
setting value.
Prescaler 12 cannot stop counting by software.
Timer 1 (T1)
Timer 1 is an 8-bit timer that counts the prescaler 12 output.
When Timer 1 underflows, the timer 1 interrupt request bit is set
to “1”.
Writing to timer 1 writes the value to both the timer 1 latch and
timer 1.
Reading from timer 1 reads the timer 1 count value. The initial
value is set to “0116” after reset.
The division ratio of timer 1 is 1/(m+1), where m is the setting
value. This gives that the division ratio of prescaler 12 and timer
1 is 1/((n+1)
× (m+1)), where n is the prescaler 12 setting value
and m is the timer 1 setting value.
Timer 1 cannot stop counting by software.
Timer 2 (T2)
Timer 2 is an 8-bit timer that counts the signal selected by the
timer 2 count source selection bit.
The count source can be selected from among
φSOURCE/16,
/256, prescaler 12 output, and timer A output signal.
Timer 2 counts the selected count source and sets the timer 2
interrupt request bit to “1” at underflow.
When writing to timer 2, the value of the timer 2 write control bit
can be used to select a write to both the timer 2 latch and timer 2
or a write to only the timer 2 latch.
Reading from timer 2 reads the timer 2 count value.
Timer 2 starts counting from “FF16” after reset.
The division ratio of timer 2 is 1/(n+1), where n is the timer 2
setting value. Timer 2 stops when the timer 2 count stop bit is set
to “1”.
When the P13/T2OUT output valid bit is set to “1”, the polarity of
the waveform output from the P13/T2OUT pin can be inverted at
each timer 2 underflow. The output start level of the T2OUT pin
can be selected using the T2OUT polarity switch bit. When this
bit is set to 0, the output starts at “H” level. When this bit is set to
“1”, the output starts at “L” level.
Notes
(1) Reading from and Writing to Timer 1 and 2 and Prescaler 12
If the timer/prescaler count source clock and
φSOURCE are
different clocks, the timers and prescaler cannot be read or
written. Select the same clock to enable read and write
operations.
Note that timer 2 can be read and written even using a
different clock while its counting is stopped.
1Prescaler 12 and timer 1 cannot be read/written in the
following conditions:
Prescaler 12 count source: XCIN input clock
φSOURCE: Clock other than XCIN input clock
2Timer 2 cannot be read/written during counting in the
following conditions:
Timer 2 count source: Prescaler 12
Prescaler 12 count source: XCIN input clock
φSOURCE: Clock other than XCIN input clock
or
Timer 2 count source: Timer A underflow
Timer A count source: XCIN input clock
φSOURCE: Clock other than XCIN input clock
or
Timer 2 count source: Timer A underflow
Timer A count source: low-speed on-chip oscillator
output
φSOURCE: Clock other than low-speed on-chip
oscillator
(2) Count Source of Prescaler 12
The XCIN input clock can be selected as the prescaler count
source only if the 32 kHz quartz crystal oscillator is selected
by the oscillation method selection bit in FSROM1.