Operation As Interval Timer (16 Bits) - NEC V850ES/SA2 UPD703201 Manual

32-bit single-chip microcontrollers
Table of Contents

Advertisement

7.3.5

Operation as interval timer (16 bits)

The V850ES/SA2 and V850ES/SA3 are provided with a 16-bit register that can be used only during cascade
connection.
The 16-bit resolution timer/event counter mode is selected by setting the TMC34 and TMC54 bits of 8-bit timer
mode control registers 3 and 5 (TMC3 and TMC5) to 1.
8-bit timer/event counter n operates as an interval timer by repeatedly generating interrupts using the count value
preset in 16-bit timer compare registers 23 and 45 (CR23 and CR45) as the interval.
In the following description, TM2 and TM3 are used. Read TM2 and TM3 as TM4 and TM5 when using TM4 and
TM5.
Setting method (when TM2 and TM3 are connected in cascade)
<1> Set each register.
• TCL2 register:
• CR2 register:
• CR3 register:
• TMC2, TMC3 register: Selects the mode in which clear & start occurs on a match between TM23
<2> Set the TCE3 bit of the TMC3 register to 1. Then set the TCE2 bit of the TMC2 register to 1 to start the
count operation.
<3> When the values of the TM23 register and CR23 register connected in cascade match, INTTM2 is
generated (the TM23 register is cleared to 0000H).
<4> INTTM2 is then generated repeatedly at the same interval.
Cautions 1. To write using 8-bit access during cascade connection, set the TCE3 bit to 1 at
operation start and then set the TCE2 bit to 1. When operation is stopped, set the
TCE2 bit to 0 and then set the TCE3 bit to 0.
2. During cascade connection, TI2 input, TO2 output, and INTTM2 input are used while
TI3 input, TO3 output, and INTTM3 input are not, so set bits LVS3, LVR3, TMC31, and
TOE3 to 0.
3. Do not change the value of the CR23 register during timer operation.
258
CHAPTER 7 TIMER/COUNTER FUNCTION
Selects the count clock (t)
(The TCL3 register does not need to be set in cascade connection)
Compare value (N) ... Lower 8 bits (settable from 00H to FFH)
Compare value (N) ... Higher 8 bits (settable from 00H to FFH)
register and CR23 register (×: don't care)
TMC2 register = 0000xx00B
TMC3 register = 0001xx00B
Interval time = (N + 1) × t: N = 0000H to FFFFH
Preliminary User's Manual U15905EJ1V0UD

Advertisement

Table of Contents
loading

Table of Contents