Panasonic MN10285K User Manual page 104

Panax series microcomputer
Table of Contents

Advertisement

Timers
16-Bit Timer Setup Examples
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.
MN102H75K/F75K/85K/F85K LSI User Manual
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 timer 0 under-
flows 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 timer 0 underflow by 5, write
x'0004' to timer 4 compare/capture register A (TM4CA). (The valid range
for TM4CA is x'0001' to x'FFFE'.)
TM4CA (example)
Bit:
15
14
13
12
TM4
TM4
TM4
TM4
TM4
CA15
CA14
CA13
CA12
CA11
Setting:
0
0
0
0
3.
Set the phase difference for timer 4. For a phase difference of two timer 0
underflow cycles, write x'0001' to timer 4 compare/capture register B
(TM4CB). (The valid range is -1
TM4CB (example)
Bit:
15
14
13
12
TM4
TM4
TM4
TM4
TM4
CB15
CB14
CB13
CB12
CB11
Setting:
0
0
0
0
4.
Write a dummy data word (of any value) to TM4CAX. In double-buffer
mode, TM4CA is compared to TM4CAX. The contents of TM4CA are
loaded to TM4CAX when TM4BC = TM4CAX. However, since TM4CAX
is undefined or x'0000' before this operation starts, this initial dummy write
prevents timing errors.
5.
Write a dummy data word (of any value) to TM4CBX. In double-buffer
mode, TM4CB is compared to TM4CBX. The contents of TM4CB are
loaded to TM4CBX when TM4BC = TM4CBX. However, since TM4CBX
is undefined or x'0000' before this operation starts, this initial dummy write
prevents timing errors.
103
Panasonic
11
10
9
8
7
6
TM4
TM4
TM4
TM4
TM4
UD0
TGE
ONE
MD1
MD0
0
0
0
0
0
1
11
10
9
8
7
6
TM4
TM4
TM4
TM4
TM4
CA10
CA9
CA8
CA7
CA6
0
0
0
0
0
0
TM4CB
11
10
9
8
7
6
TM4
TM4
TM4
TM4
TM4
CB10
CB9
CB8
CB7
CB6
0
0
0
0
0
0
Panasonic Semiconductor Development Company
x'00FE80'
5
4
3
2
1
TM4
TM4
TM4
TM4
TM4
TM4
ECLR
LP
ASEL
S2
S1
0
1
1
0
0
x'00FE84'
5
4
3
2
1
TM4
TM4
TM4
TM4
TM4
TM4
CA5
CA4
CA3
CA2
CA1
CA0
0
0
0
1
0
the TM4CA value.)
x'00FE88'
5
4
3
2
1
TM4
TM4
TM4
TM4
TM4
TM4
CB5
CB4
CB3
CB2
CB1
CB0
0
0
0
0
0
0
S0
0
0
0
0
1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn102f75kMn102f85kMn102h75kMn102h85k

Table of Contents