R8C/13 Group
12.2 Timer (Timer Y)
12.2 Timer Y
Timer Y is an 8-bit timer with an 8-bit prescaler and has two reload registers-Timer Y Primary and Timer
Y Secondary. Figure 12.11 shows a block diagram of Timer Y. Figures 12.12 to 12.14 show the TYZMR,
PREY, TYSC, TYPR, TYZOC, PUM, and YCSS registers.
The Timer Y has two operation modes as follows:
• Timer mode: The timer counts an internal count source.
• Programmable waveform generation mode: The timer outputs pulses of a given width successively.
Data bus
TYSC register
Reload register
TYPR register
Reload register
TYCK1 to TYCK0
Reload register
=00
2
f
f
1
8
=01
2
=102
Timer Y interrupt
INT2 interrupt
Counter
Counter
f
RING
=112
PREY register
TYS=1
Polarity
switching
TYOPL=1
TYOPL=0
Q
Q
TYMOD0=1
TYOCNT=0
TYOCNT=1
Toggle
flip-flop
CK
INT
2/CNTR1
CLR
P3_2 bit in P3 register
Write to TYZMR register
TYMOD0 bit=1
Figure 12.11 Timer Y Block Diagram
Timer Y, Z mode register
b7 b6 b5 b4 b3 b2 b1 b0
Symbol
TYZMR
Address
008016
After reset
0016
Bit symbol
TYMOD0
Function
0 : Timer mode
Bit name
RW
RW
Timer Y operation
mode bit
1 : Programmable waveform generation mode
0 : Rising edge
1 : Falling edge
INT2/CNTR1 polarity
R1EDG
TYWC
RW
RW
switching bit(1)
Function varies depending on the operation
mode
Timer Y write
control bit
0 : Stops counting
1 : Starts counting
Timer Y count
start flag
TYS
RW
RW
b5 b4
Timer Z operation
mode bit
0 0 : Timer mode
TZMOD0
TZMOD1
0 1 : Programmable waveform generation mode
1 0 : Programmable one-shot generation mode
1 1 : Programmable wait one-shot generation
mode
RW
RW
RW
Timer Z write
control bit
Function varies depending on the operation
mode
TZWC
Timer Z count
start flag
0 : Stops counting
1 : Starts counting
TZS
NOTES:
1. The IR bit in the INT2IC register may be set to “1” (interrupt requested) when the R1EDG bit is rewritten.
Refer to the paragraph 19.2.5 “Changing Interrupt Factor” in the Usage Notes Reference Book.
Figure 12.12 TYZMR Register
Rev.1.20 Jan 27, 2006 page 80 of 205
REJ09B0111-0120