NEC PD754144 User Manual page 159

4-bit single-chip microcontrollers
Table of Contents

Advertisement

(4) Application of 16-bit timer counter mode
As an interval timer that generates an interrupt at 5-second intervals
• Set the higher 4 bits of the mode register (TM1) to 0010B, and select the overflow of timer counter
count register (T2).
• Set the higher 4 bits of TM2 to 0100B and select 16.0 second as the longest set time.
• Set the lower 4 bits of TM1 to 0010B and select the 16-bit timer counter mode.
• Set the lower 4 bits of TM2 to 1110B, select the 16-bit timer counter mode and count operation. Then,
issue the timer start command.
• The set values of the timer counter modulo registers (TMOD1 and TMOD2) are as follows.
5 sec
= 20491.8 – 1
244 µ s
<Program example>
SEL
MB15
MOV
XA, #050H
MOV
TMOD1, XA
MOV
XA, #00B
MOV
TMOD2, XA
MOV
XA, #00100010B
MOV
TM1, XA
MOV
XA, #01001110B
MOV
TM2, XA
DI
IET1
EI
EI
IET2
This example applies to the operation of the µ PD754244 at f
Note
operation of the µ PD754244 and f
and interval time are different even if the settings are the same.
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
500BH
;
or CLR1 MBE
;
Sets modulo (higher 8 bits)
;
Sets modulo (lower 8 bits)
;
Sets mode
;
Sets mode and starts timer
;
Disables timer (channel 1) interrupt
;
Enables interrupts
;
Enables timer (channel 2) interrupt
= 1.0 MHz operation of the µ PD754144, the longest set time
CC
User's Manual U10676EJ3V0UM
Note
= 4.19 MHz. With f
= 6.0 MHz
X
X
159

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents