R8C/20 Group, R8C/21 Group 14. Timers
Rev.2.00 Aug 27, 2008 Page 259 of 458
REJ09B0250-0200
Table 14.37 Output Compare Mode Specifications
Item Specification
Count Source f4, f8, f32
Count Operation • Increment
• When the 8-bit counter content matches with the TREMIN register
content, the value returns to 00h and count continues.
The count value is held while count stops.
Count Period • When RCS2 = 0 (4-bit counter is not used)
1/fi x 2 x (n + 1)
• When RCS2 = 1 (4-bit counter is used)
1/fi x 32 x (n + 1)
fi: Frequency of count source
n: Setting value of TREMIN register
Count Start Condition Write 1 (count starts) to the TSTART bit in the TRECR1 register
Count Stop Condition Write 0 (count stops) to the TSTART bit in the TRECR1 register
Interrupt Request Generation
Timing
When the 8-bit counter content matches with the TREMIN register
content
TREO Pin Function Select any one of the followings:
• Programmable I/O ports
• Output any one of f2, f4 and f8
• Compare output
Read from Timer When reading the TRESEC register, the 8-bit counter value can be
read.
When reading the TREMIN register, the compare value can be read.
Write to Timer Writing to the TRESEC register is disabled.
When the TSTART and TCSTF bits in the TRECR1 register are set to
0 (timer stops), writing to the TREMIN register is enabled.
Select Functions • Select use of 4-bit counter
• Compare output function
Every time the 8-bit counter value matches with the TREMIN register
value, TREO output polarity is reversed. The TREO pin outputs “L”
after reset is deasserted and the Timer RE reset by the TRERST bit
in the TRECR1 register. Output level is held by setting the TSTART
bit to 0 (count stops).