English
Language : 

SH7750_08 Datasheet, PDF (435/1162 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer
Section 12 Timer Unit (TMU)
Example of Count Operation Setting Procedure: Figure 12.2 shows an example of the count
operation setting procedure.
1. Select the count clock, for channel 0, 1, or 2, with bits TPSC2–TPSC0 in the timer control
register (TCR). When an external clock is selected, set the TCLK pin to input mode with the
TCOE bit in TOCR, and select the external clock edge with bits CKEG1 and CKEG0 in TCR.
2. Specify whether an interrupt is to be generated on TCNT underflow with the UNIE bit in TCR.
3. When the input capture function is used, set the ICPE bits in TCR, including specification of
whether the interrupt function is to be used.
4. Set a value in the timer constant register (TCOR).
5. Set the initial value in the timer counter (TCNT).
6. Set the STR bit to 1 in the timer start register (TSTR, TSTR2) to start the count.
Operation selection
Select count clock 1
Underflow interrupt
generation setting
2
When input capture
function is used
Input capture interrupt 3
generation setting
Timer constant
register setting
4
Set initial timer
counter value
5
Start count
6
Note: When an interrupt is generated, clear the source flag in the interrupt handler. If the interrupt
enabled state is set without clearing the flag, another interrupt will be generated.
Figure 12.2 Example of Count Operation Setting Procedure
Rev.7.00 Oct. 10, 2008 Page 351 of 1074
REJ09B0366-0700