NEC UPD703116 User Manual page 316

32-bit single-chip microcontrollers
Table of Contents

Advertisement

(2) Operation in UDC mode
(a) Overview of operation in UDC mode
The count clock input to TM1n in the UDC mode (CMD bit of TUMn register = 1) can only be external
input from the TIUD1n and TCUD1n pins. Up/down count judgment in the UDC mode is determined
based on the phase difference of the TIUD1n and TCUD1n pin inputs according to the PRM1n register
setting (there is a total of four choices).
PRM1n Register
PRM12
PRM11
1
0
1
0
1
1
1
1
The UDC mode is further divided into two modes according to the TM1n clear conditions (count operation
is performed only with TIUD1n, TCUD1n input in both modes).
• UDC mode A (TUMn register's CMD bit = 1, MSEL bit = 0)
The TM1n clear source can be selected as only external clear input (TCLR1n), a match signal
between the TM1n count value and the CM1n0 set value during up-count operation, or logical sum
(OR) of the two signals, using bits CLR1 and CLR0 of the TMC1n register.
TM1n can transfer the value of CM1n0 upon occurrence of TM1n underflow.
• UDC mode B (TUMn register's CMD bit = 1, MSEL bit = 1)
The status of TM1n after match of the TM1n count value and CM1n0 set value is as follows.
<1> In the case of up-count operation, TM1n is cleared (0000H), and the INTCM1n0 interrupt is
generated.
<2> In the case of down-count operation, the TM1n count value is decremented (−1).
The status of TM1n after match of the TM1n count value and CM1n1 set value is as follows.
<1> In the case of up-count operation, the TM1n count value is incremented (+1).
<2> In the case of down-count operation, TM1n is cleared (0000H), and the INTCM1n1 interrupt is
generated.
316
CHAPTER 9 TIMER/COUNTER FUNCTION
Table 9-7. List of Count Operations in UDC Mode
Operation
Mode
PRM10
0
Mode 1
Down count when TCUD1n = high level
Up count when TCUD1n = low level
1
Mode 2
Up count upon detection of valid edge of TIUD1n input
Down count upon detection of valid edge of TCUD1n input
0
Mode 3
Up count upon detection of valid edge of TIUD1n input when
TCUD1n = high level
Down count upon detection of valid edge of TIUD1n input
when TCUD1n = low level
1
Mode 4
Automatic judgment upon detection of both edges of TIUD1n
input and both edges of TCUD1n input
User's Manual U14492EJ5V0UD
TM1n Operation

Advertisement

Table of Contents
loading

Table of Contents