Panasonic MN101C00 User Manual page 85

Panaxseries mn101c00 series 8-bit single-chip microcomputers
Table of Contents

Advertisement

Event Count Function
Settings for the event count function are listed below.
(1)
Set the TM4EN flag of the timer 4 mode register (TM4MD) to "0" to stop the count
operation of timer 4.
(2)
Use the TM4CK2 to 0 flags of the TM4MD register to select TM4IO input or
synchronized TM4IO input as the clock source.
(3)
Set the TM4PWM flag of the TM4MD register to "0" so that 16-bit timer operation
is selected.
(4)
Set a value in compare register 4 (TM4OCH, TM4OCL).
(5)
Set the TM4EN flag of the TM4MD register to "1" to start the timer.
(6)
When timer 4 begins operation, binary counter 4 will count upward from X'0000'.
(7)
When the value of binary counter 4 matches that of the TM4OCH and TM4OCL
registers, the timer 4 interrupt request flag is set, and the binary counter 4 is reset to
X'0000' and begins to count upward again.
When synchronized TM4IO is selected, the timer 4 clock source is synchronized with the system
clock after a transition of the TM4IO input signal. Timer 4 counts upward based on a signal
synchronized to the system clock. Therefore, correct values can be read from binary counter 4.
Figure 4-3-2 Timer 4 Event Counter Timing (when synchronous TM4IO
CPU system clock
(fs)
TM4IO input
Synchronous
circuit output
Binary counter
n
input is selected)
Chapter 4 Timer Functions
If TM4IO input is selected as the
clock source and the value of
binary counter 4 is to be read
during
synchronized TM4IO input to avoid
reading data that may be
incomplete during count-up
transitions.
synchronized TM4IO input, it is not
possible
STOP/HALT modes.
n+1
16-bit Timer Operation (timer 4)
operation,
select
However,
with
to
return
from
71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn101c115Mn101c117Mn101cp117

Table of Contents