One-Shot Timer Mode - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30240 Group

1.2.21.3 One-shot timer mode

In this mode, the timer operates only once (See Table 1.21 ). When a trigger occurs, the timer starts
up and continues operating for a given period. Figure 1.66 shows the Timer Ai mode register in one-
shot mode.
Table 1.21:
Timer specifications in one-shot timer mode
Item
Count source
Count operation
Divide ratio
Count start condition
Count stop condition
Interrupt request
generation timing
TAi
pin function
IN
TAi
pin function
OUT
Read from timer
Write to timer
Timer Ai mode register
b7
b6
b5
b4
b3
0
Figure 1.66: Timer Ai mode register in one-shot mode
Rev.1.00 Sep 24, 2003 Page 73 of 360
f1, f8, f32
•The timer counts down
•When the count reaches 0000
• If a trigger occurs when counting, the timer reloads a new count and restarts counting
1/n
n: Set value
• An external trigger is input
• The selected timer overflows
• The one-shot start flag is set (= 1)
• A new count is reloaded after the count has reached 0000
• The count start flag is reset (= 0)
The count reaches 0000
16
Programmable I/O port or trigger input
Programmable I/O port or pulse output
When timer Ai register is read, it indicates an indeterminate value
•When counting is stopped and a value is written to timer Ai register, it is written to both
reload register and counter
•When counting is in progress and a value is written to timer Ai register, it is written to the
reload register to be transferred to counter at next load time
b2
b1
b0
Symbol
1 0
TAiMR(i=0 to 4)
Bit symbol
Bit name
Operation mode
TMOD0
select bit
TMOD1
Pulse output function
MR0
select bit
External trigger select bit
MR1
(Note 2)
MR2
Trigger select bit
0 (Must always be fixed to "0" in timer mode)
MR3
TCK0
Count source select bit
TCK1
Note 1: The settings of the corresponding port register and port direction register are invalid.
Note 2: Valid only when the TAi
(addresses 0382
Note 3: Set the corresponding port direction register to "0".
Specification
, the timer stops counting after reloading a new count
16
Address
0396
to 039A
16
16
Function
b1 b0
1 0 : One-shot timer mode
0 : Pulse is not output
(TA
pin is a normal port pin)
iOUT
1 : Pulse is output (Note 1)
(TA
pin is a pulse output pin)
iOUT
0 : Falling edge of TAi
(Note 3)
1 : Rising edge of TAi
(Note 3)
0 : One-shot start flag is valid
1 : Selected by event/trigger select register
b7 b6
0 0 : f
1
0 1 : f
8
1 0 : f
32
1 1 : Reserved
pin is selected by the event/trigger select bit.
IN
and 0383
). If timer overflow is selected, this bit can be "1", or "0".
16
16
16
When reset
00
16
R
W
pin's input signal
IN
pin's input signal
IN
Timer A

Advertisement

Table of Contents
loading

Table of Contents