NEC PD754144 User Manual page 150

4-bit single-chip microcontrollers
Table of Contents

Advertisement

(3) Application of PWM mode
To output a pulse with a frequency of 38.0 kHz (cycle of 26.3 µ s) and a duty factor of 1/3 to the PTO2 pin
• Set the higher 4 bits of the timer counter mode register (TM2) to 0011B and select 61.0 µ s as the longest
set time.
• Set the lower 4 bits of TM2 to 1101B, and select the PWM mode and count operation, and issue the timer
start command.
• Set the timer counter output enable flag (TOE2) to "1" to enable timer output.
• Set the high-level period setting timer counter modulo register (TMOD2H) as follows.
26.3 µ s
1
.
3
238 ns
• The set value of the timer counter modulo register (TMOD2) is as follows.
26.3 µ s
2
.
3
238 ns
<Program example>
SEL
MB15
SET1
TOE2
MOV
XA, #024H
MOV
TMOD2H, XA
MOV
XA, #49H
MOV
TMOD2, XA
MOV
XA, #00111101B
MOV
TM2, XA
Note This example applies to the operation of the µ PD754244 at f
of the µ PD754244 and f
are the same.
150
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
–1 = 36.8 – 1
36 = 24H
–1 = 73.7 – 1
73 = 49H
; or CLR1 MBE
; Enables timer output
; Sets modulo (high-level period)
; Sets modulo (low-level period)
; Sets mode and starts timer
= 1.0 MHz operation of the µ PD754144, the cycles are different even if the settings
CC
User's Manual U10676EJ3V0UM
= 4.19 MHz. With f
= 6.0 MHz operation
X
X
Note

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents