English
Language : 

SH7058 Datasheet, PDF (419/1130 Pages) Renesas Technology Corp – Renesas SuperHTM RISC engine
11.3.11 Event Count Function and Event Cycle Measurement
Channel 9 has six 8-bit event counters (ECNT9A to ECNT9F) and corresponding general registers
(GR9A to GR9F). Each event counter has an external pin (TI9A to TI9F).
Each ECNT9 operates unconditionally as an event counter. When an edge is input from the
external pin, ECNT9 is incremented. When ECNT9 matches the value set in GR9, it is cleared,
and then counts up when an edge is again input at the external pin. By making the appropriate
setting in the interrupt enable register (TIER) beforehand, an interrupt request can be sent to the
CPU on compare-match.
For ECNT9A to ECNT9D, a trigger can be transmitted to channel 3 when a compare-match
occurs. In channel 3, if the channel 9 trigger input is set in the timer I/O control register (TIOR)
and the corresponding bit is set to 1 in the timer start register (TSTR), the TCNT3 value is
captured in the corresponding general register (GR3A to GR3D) when an ECNT9A to ECNT9D
compare-match occurs. This enables the event cycle to be measured.
An example of event count operation is shown in figure 11.24. In this example, ECNT9A counts
up on both-edge, falling-edge, and rising-edge detection, H'10 is set in GR9A, and a compare-
match is generated.
An example of event cycle measurement operation is shown in figure 11.25. In this example,
GR3A in channel 3 captures TCNT3 in response to a trigger from channel 9.
Pφ
TI9A
Edge
detection
signal
ECNT9A
Clock
ECNT9A
GR9A
TSR9
CMF9A
Capture
trigger
To channel 3
00
01
02 03
10
00
05
06
10
Cleared by software
Rising and falling edges
Falling edge
Figure 11.24 Event Count Operation
Rising edge
Rev. 3.0, 09/04, page 378 of 1086