16-Bit Timer Setup Examples; Setting Up An Event Counter Using Timer 4; Block Diagram Of Event Counter Using Timer 4; Panasonic - Panasonic MN10285K User Manual

Panax series microcomputer
Table of Contents

Advertisement

Use the MOV instruction for this
setup and only use 16-bit write
operations.
This step stops the TM4BC
count and clears both TM4BC
and the S-R flip-flop to 0.
Panasonic Semiconductor Development Company

4.11 16-Bit Timer Setup Examples

4.11.1 Setting Up an Event Counter Using Timer 4

In this example, timer 4 counts the TM4IB input signal (B
and generates an interrupt on the second and fifth cycles.
P2
TM4IB
P6
Timer 4
(B
/4)
OSC
up
TM4IB
Figure 4-27 Block Diagram of Event Counter Using Timer 4
To set up timer 4:
1.
Set the operating mode in the timer 4 mode register (TM4MD). Disable
timer 4 counting and interrupts. Select up counting. Select TM4IB as the
clock source.
TM4MD (example)
Bit:
15
14
13
12
TM4
TM4
TM4
EN
NLD
UD1
Setting:
0
0
0
0
2.
Set the divide-by ratio for timer 4. To divide the TM4IB input signal by 5,
write x'0004' to timer 4 compare/capture register A (TM4CA). (The valid
range for TM4CA is x'0001' to x'FFFE'.)
94

Panasonic

CORE
Interrupts
Bus Controller
Timers 0-3
Timers 4-5
A. Chip Level
TM4BC
TM4CA
TM4CAX
TM4CB
TM4CBX
B. Block Level
11
10
9
8
7
6
TM4
TM4
TM4
TM4
TM4
UD0
TGE
ONE
MD1
MD0
0
0
0
0
0
0
MN102H75K/F75K/85K/F85K LSI User Manual
Timers
16-Bit Timer Setup Examples
/4 = 6 MHz or less)
OSC
ROM, RAM
P4
P5
Serial I/Fs
ADC
T
Q
R
(TM4OA)
Q
S
T
Q
x'00FE80'
5
4
3
2
1
TM4
TM4
TM4
TM4
TM4
ECLR
LP
ASEL
S2
S1
0
1
0
0
1
0
TM4
S0
0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn102f75kMn102f85kMn102h75kMn102h85k

Table of Contents