• CSYNC comparator
4 levels (programmable), vector interrupt, macro service, context switching
9 (including NMI)
19 (including software interrupt)
HALT/STOP mode/low power dissipation mode/low power dissipation HALT mode
STOP mode can be released by input of valid edge of NMI pin, watch interrupt (INTW), or
3.5Real-time Output Port ...........................................................................................................................29
3.6Super Timer Unit ...................................................................................................................................33
3.9VCR Analog Circuits .............................................................................................................................41
3.10 Watch Function .....................................................................................................................................47
3.11 Clock Output Function .........................................................................................................................48
4. INTERNAL/EXTERNAL CONTROL FUNCTION............................................................................ 49
4.1Interrupt Function .................................................................................................................................49
4.4Reset Function ......................................................................................................................................60
APPENDIX A. DEVELOPMENT TOOLS ............................................................................................... 79
APPENDIX B. RELATED DOCUMENTS ............................................................................................... 81
10
µ
PD784915B, 784916B
1. DIFFERENCES AMONG µPD784915 SUBSERIES PRODUCTS
The µPD784915 Subseries consists of the six products listed in Table 1-1. The µPD784915A is a low-cost process-
shrinked version of the µPD784915. The µPD784916A expands the internal ROM capacity of the µPD784915 to 62
µ
Kbytes. The
and 784916A.
The µPD78P4916 features writable one-time PROM instead of the mask ROM of the µPD784915, 784915A,
784916A, 784915B, and 784916B. Except for this substitution of PROM for ROM and the fact that PROM capacity
differs from the ROM capacities offered in the other products, the
products.
In switching from the PROM product, used for debugging and testing application systems, to the mask ROM
products for mass production, be careful to check the differences among these products.
For details on the CPU functions and the internal hardware, refer to
Hardware (U10444E).
PD784915B and 784916B feature improved electrical characteristics compared to the µPD784915A
and the µPD78P4916 differ with respect to the items listed below.
• P40 to P47, P50 to P57: Low-level input voltage
• VDD supply current
• Data hold current
• CTL amplifier: Phase signal elimination ratio
• CFG amplifier: CFGAMPO low-level output current
For details, refer to the data sheet of each product.
• µPD784915A/784916AData Sheet (U11022J)
• µPD784915B/784916BData Sheet (This document)
• µPD78P4916Data Sheet (U11045J)
µ
PD784916A
µ
PD784915B
µ
PD784916B
µ
PD78P4916
Note
Note
Note The internal PROM and internal RAM capacities can be changed using the internal memory selection register
(IMS).
CautionThe PROM version and mask ROM version differ in noise immunity and noise radiation, etc. When
considering replacing a PROM version with a mask ROM version when switching from preproduction
to volume production, perform sufficient evaluation using a CS version (not ES version) of the
mask ROM version.
11
2. PIN FUNCTIONS
2.1 Port Pins
µ
PD784915B, 784916B
Pin NameI/O
P00 to P07I/OReal-time8-bit I/O port (port 0).
P40 to P47I/O
P50 to P57I/O
P60I/OSTRB/CLO8-bit I/O port (port 6).
P61SCK1/BUZ• Can be set in input or output mode in 1-bit units.
P62SO1• Can be connected with software pull-up resistors.
P63SI1
P64
P65HWIN
P66PWM4
P67PWM5
P70 to P77InputANI0 to ANI78-bit input port (port 7)
P80I/OReal-timePseudo VSYNC output7-bit I/O port (port 8).
P82output portHASW output• Can be set in input or output mode in
P83ROTC output• Can be connected with software pull-
P84PWM2
P85PWM3
P86PTO10
P87PTO11
P90I/OENV7-bit I/O port (port 9).
P91 to P95KEY0 to KEY4• Can be set in input or output mode in 1-bit units.
P96
Alternate Function
output port• Can be set in input or output mode in 1-bit units.
• Can be connected with software pull-up resistors.
-
-
-
-
8-bit I/O port (port 4).
• Can be set in input or output mode in 1-bit units.
• Can be connected with software pull-up resistors.
8-bit I/O port (port 5).
• Can be set in input or output mode in 1-bit units.
• Can be connected with software pull-up resistors.
• Can be connected with software pull-up resistors.
Function
1-bit units.
up resistors.
12
2.2 Non-Port Pins (1/2)
µ
PD784915B, 784916B
Pin NameI/O
REEL0INInputINTP3Reel FG input
REEL1IN
DFGIN
DPGIN
CFGIN
CSYNCIN
CFGCPIN
CFGAMPOOutput
PTO00Output
PTO01
PTO02
PTO10P86
PTO11P87
PWM0Output
PWM1
PWM2P84
PWM3P85
PWM4P66
PWM5P67
HASWOutputP82Head amplifier switch signal output
ROTCOutputP83Chroma rotation signal output
ENVInputP90Envelope signal input
SI1InputP63Serial data input (serial interface channel 1)
SO1OutputP62Serial data output (serial interface channel 1)
SCK1I/OP61/BUZSerial clock I/O (serial interface channel 1)
SI2InputBUSYSerial data input (serial interface channel 2)
SO2Output
SCK2I/O
BUSYInputSI2Serial busy signal input (serial interface channel 2)
STRBOutputP60/CLOSerial strobe signal output (serial interface channel 2)
ANI0 to ANI7Analog inputP70 to P77Analog signal input of A/D converter
ANI8 to ANI11
CTLIN
CTLOUT1Output
CTLOUT2I/O
RECCTL+, RECCTL–I/O
CTLDLY
VREFC
NMIInput
INTP0 to INTP2Input
INTP3InputREEL0IN
KEY0 to KEY4InputP91 to P95Key input signal input
CLOOutputP60/STRBClock output
BUZOutputP61/SCK1Buzzer output
--
--
--
Alternate Function
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Function
Drum FG, PFG input (ternary)
Drum PG input
Capstan FG input
Composite SYNC input
CFG comparator input
CFG amplifier output
Programmable timer output of super timer unit
PWM output of super timer unit
Serial data output (serial interface channel 2)
Serial clock I/O (serial interface channel 2)
CTL amplifier input capacitor connection
CTL amplifier output
Logic signal input/CTL amplifier output
RECCTL signal output/PBCTL signal input
External time constant connection (for RECCTL rewriting)
VREF amplifier AC connection
Non-maskable interrupt request input
External interrupt request input
Reset input
Crystal connection for main system clock oscillation
Crystal connection for subsystem clock oscillation.
Crystal connection for watch clock oscillation
Positive power supply to analog circuits
GND of analog circuits
Reference voltage input to A/D converter
Positive power supply to digital circuits
GND of digital circuits
Internally connected. Directly connect to VSS.
14
µ
PD784915B, 784916B
2.3 I/O Circuits and Connection of Unused Pins
Table 2-1 shows the I/O circuit type of each pin and the recommended connection of unused pins. For the
configuration of each type of I/O circuit, refer to Figure 2-1.
Table 2-1. I/O Circuit Type of each Pin and Recommended Connection of Unused Pins (1/2)
PinI/O Circuit TypeI/ORecommended Connection of Unused Pins
P00 to P075-AI/OInput: Connect to VDD
P40 to P47
P50 to P57
P60/STRB/CLO
P61/SCK1/BUZ8-A
P62/SO15-A
P63/SI18-A
P645-A
P65/HWIN8-A
P66/PWM45-A
P67/PWM5
P70/ANI0 to P77/ANI79InputConnect to VSS
P805-AI/OInput: Connect to VDD
P82/HASW
P83/ROTC
P84/PWM2
P85/PWM3
P86/PTO10
P87/PTO11
P90/ENV
P91/KEY0 to P95/KEY48-A
P965-A
SI2/BUSY2-AInputConnect to VDD
SO24OutputHi-Z: Connect to VSS via a pull-down resistor
SCK28-AI/OInput: Connect to VDD
ANI8 to ANI117InputConnect to VSS
RECCTL+, RECCTL–—I/OWhen ENCTL = 0 and ENREC = 0: Connect to VSS
Output: Leave open
Output: Leave open
Others: Leave open
Output: Leave open
Remark ENCTL : bit 1 of amplifier control register (AMPC)
ENREC: bit 7 of amplifier mode register 0 (AMPM0)
15
µ
PD784915B, 784916B
Table 2-1. I/O Circuit Type of each Pin and Recommended Connection of Unused Pins (2/2)
PinI/O Circuit TypeI/ORecommended Connection of Unused Pins
DFGIN—InputWhen ENDRUM = 0: Connect to VSS
DPGINWhen ENDRUM = 0 or ENDRUM = 1 and SELPGSEPA
= 0: Connect to VSS
CFGIN, CFGCPINWhen ENCAP = 0: Connect to VSS
CSYNCINWhen ENCSYN = 0: Connect to VSS
REEL0IN/INTP3, REEL1INWhen ENREEL = 0: Connect to VSS
CTLOUT1—OutputLeave open
CTLOUT2—I/OWhen ENCTL = 0 and ENCOMP = 0: Connect to VSS
When ENCTL = 1: Leave open
CFGAMPO—OutputLeave open
CTLIN——When ENCTL = 0: Leave open
VREFCWhen ENCTL = 0 and ENCAP = 0 and ENCOMP = 0:
Leave open
CTLDLYLeave open
PWM0, PWM13OutputLeave open
PTO00 to PTO02
NMI2InputConnect to VDD
INTP0Connect to VDD or VSS
INTP1, INTP22-AInputConnect to VDD
AVDD1, AVDD2——Connect to VDD
AVREF, AVSS1, AVSS2Connect to VSS
RESET2——
XT1——Connect to VSS
XT2Leave open
ICDirectly connect to VSS
Remark ENDRUM: bit 2 of amplifier control register (AMPC)
SELPGSEPA : bit 2 of amplifier mode register 0 (AMPM0)
ENCAP: bit 3 of amplifier control register (AMPC)
ENCSYN: bit 5 of amplifier control register (AMPC)
ENREEL: bit 6 of amplifier control register (AMPC)
ENCTL: bit 1 of amplifier control register (AMPC)
ENCOMP: bit 4 of amplifier control register (AMPC)
16
Figure 2-1. I/O Circuits of Pins (1/2)
µ
PD784915B, 784916B
Type 2
IN
Schmitt trigger input with hysteresis characteristics
Type 2-A
V
DD
P-ch
pullup
enable
IN
Schmitt trigger input with hysteresis characteristics
Type 3
DD
V
P-ch
data
N-ch
OUT
Type 5-A
pullup
enable
data
output
disable
input
enable
Type 7
IN
P-ch
N-ch
DD
V
P-ch
N-ch
Comparator
+
-
V
P-ch
DD
IN/
OUT
Type 4
DD
data
output
disable
Push-pull output that can make output high
impedance (both P-ch and N-ch are off)
V
P-ch
N-ch
OUT
Type 8-A
pullup
enable
data
output
disable
V
REF
(threshold voltage)
DD
V
P-ch
N-ch
V
P-ch
DD
IN/
OUT
17
Type 9
Figure 2-1. I/O Circuits of Pins (2/2)
µ
PD784915B, 784916B
P-ch
IN
N-ch
V
Comparator
+
-
REF
(threshold voltage)
input enable
18
µ
PD784915B, 784916B
3. INTERNAL BLOCK FUNCTIONS
3.1 CPU Registers
3.1.1 General-purpose registers
µ
PD784916B has eight banks of general-purpose registers. One bank consists of sixteen 8-bit general-
The
purpose registers. Two of these 8-bit registers can be used in pairs as a 16-bit register. Four of the 16-bit generalpurpose registers can be used to specify a 24-bit address in combination with an 8-bit address expansion register.
These eight banks of general-purpose registers can be selected by software or context switching function.
The general-purpose registers, except for the address expansion registers V, U, T, and W, are mapped to the
internal RAM.
Figure 3-1. Configuration of General-Purpose Registers
A (R1)X (R0)
AX (RP0)
B (R3)C (R2)
BC (RP1)
R5R4
RP2
R7R6
RP3
R9R8V
VP (RP4)
VVP (RG4)
R11R10U
UP (RP5)
UUP (RG5)
D (R13)E (R12)T
DE (RP6)
TDE (RG6)
H (R15)L (R14)W
HL (RP7)
WHL (RG7)
( ): absolute name
8 banks
Caution Although R4, R5, R6, R7, RP2, and RP3 can be used as X, A, C, B, AX, and BC registers,
respectively, by setting the RSS bit of PSW to 1, do not use this function. The function of the
RSS bit is planned to be deleted from the future models in the 78K/IV Series.
19
µ
PD784915B, 784916B
3.1.2 Other CPU registers
(1) Program counter
µ
The program counter of the
PD784916B is 20 bits wide. The value of the program counter is automatically
updated as the program is executed.
190
PC
(2) Program status word
This is a register that holds the various statuses of the CPU. Its contents are automatically updated as the program
is executed.
12111098
PSWH UF15RBS214RBS113RBS0
PSW
PSWLS7Z
6
RSS
5AC4IE3
Note
0
P/V201CY
Note The RSS flag is provided to maintain compatibility with the microcontrollers in the 78K/III Series. Always
set this flag to 0 except when the software of the 78K/III Series is used.
(3) Stack pointer
This is a 24-bit pointer that holds the first address of the stack.
Be sure to write 0 to the high-order 4 bits.
230
SP
000200
3.2 Memory Space
The µPD784916B can access a 64 Kbyte memory space.
Table 3-1 shows the addresses of the internal ROM and internal data areas.
Table 3-1. Memory Space
Part NumberInternal ROM Area Internal Data Area
µ
PD784915B0000H-BFFFHFA00H-FFFFH
µ
PD784916B0000H-F7FFH
Caution Some products in the 78K/IV Series can access up to 1 Mbyte of memory space in an address
expansion mode which is set by the LOCATION instruction. However, the memory space of the
µ
PD784916B is 64 Kbytes (0000H to FFFFH). Therefore, be sure to execute the LOCATION 0
instruction immediately after reset to set the memory space to 64 Kbytes (the LOCATION
instruction cannot be used more than twice).
20
µ
Figure 3-2. Memory Map of µPD784915B
FEFFH
FE80H
FE7FH
PD784915B, 784916B
General-purpose
registers (128 bytes)
FFFFH
FF00H
FEFFH
Data
memory
FA00H
F9FFH
Memory space (64 Kbytes)
C000H
BFFFH
data memory
Program memory/
Special function register
(SFR) (256 bytes)
Internal RAM
(1280 bytes)
Cannot be used
Internal ROM
(49152 bytes)
0000H
FE3BH
FE06H
FD00H
FCFFH
FA00H
BFFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
Macro service control
word area (54 bytes)
Data area (512 bytes)
Program/data area
(768 bytes)
Program/data area
(49152 bytes)
CALLF entry area
(2048 bytes)
CALLT table area
(64 bytes)
Vector table area
(64 bytes)
21
Figure 3-3. Memory Map of µPD784916B
FEFFH
FE80H
FE7FH
µ
PD784915B, 784916B
General-purpose
registers (128 bytes)
FFFFH
FEFFH
Data
memory
FA00H
F9FFH
F7FFH
Memory space (64 Kbytes)
data memory
Program memory/
Special function register
FF00H
F800H
0000H
(SFR) (256 bytes)
Internal RAM
(1280 bytes)
Cannot be used
Internal ROM
(63488 bytes)
FE3BH
FE06H
FD00H
FCFFH
FA00H
F7FFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
Macro service control
word area (54 bytes)
Data area (512 bytes)
Program/data area
(768 bytes)
Program/data area
(63488 bytes)
CALLF entry area
(2048 bytes)
CALLT table area
(64 bytes)
Vector table area
(64 bytes)
22
µ
PD784915B, 784916B
3.3 Special Function Registers (SFRs)
Special function registers are assigned special functions and mapped to a 256-byte space from addresses FF00H
through FFFFH. These registers include mode registers and control registers that control the internal peripheral
hardware units.
Caution Do not access an address to which no SFR is assigned. If such an address is accessed by
µ
mistake, the
Table 3-2 lists the special function registers (SFRs). The meanings of the symbols in this table are as follows:
• Abbreviation............................ Abbreviation of an SFR. This abbreviation is reserved for NEC’s assembler
• R/W ......................................... Indicates whether the SFR in question can be read or written.
PD784916B may be deadlocked. This deadlock can be cleared only by reset input.
(RA78K4). With a C compiler (CC78K4), the abbreviation can be used as an sfr
variable by the #pragma sfr instruction.
R/W : Read/write
R: Read only
W: Write only
• Bit length ................................. Indicates the bit length (word length) of the SFR.
• Bit units for manipulation ....... Indicates bit units in which the SFR in question can be manipulated. An SFR that
can be manipulated in 16-bit units can be described as the operand sfrp of an
instruction. Specify an even address to manipulate this SFR.
An SFR that can be manipulated in 1-bit units can be described for a bit
manipulation instruction.
• After reset ............................... Indicates the status of each register after the RESET signal has been input.
23
µ
PD784915B, 784916B
Table 3-2. Special Function Registers (1/4)
BitBit Units forAfter
AddressSpecial Function Register (SFR) NameSymbolR/W LengthManipulationReleasing
1 bit8 bits 16 bitsReset
FF00H Port 0P0R/W8√√
FF04H Port 4P48√√
FF05H Port 5P58√√
FF06H Port 6P68√√
FF07H Port 7P7R8√√
FF08H Port 8P8R/W8√√
FF09H Port 9P98√√
FF0EH Port 0 buffer register LP0L8√√
FF0FH Port 0 buffer register HP0H8√√
FF10H Timer 0 compare register 0CR0016
FF11H Event counter compare register 0ECC0W8
FF12H Timer 0 compare register 1CR01R/W16
FF13H Event counter compare register 1ECC1W8
FF14H Timer 0 compare register 2CR02R/W16
FF15H Event counter compare register 2ECC2W8
FF16H Timer 1 compare register 0CR10R/W16
FF17H Event counter compare register 3ECC3W8
FF18H Timer 1 compare register 1CR11R/W16
FF1AH Timer 1 compare register 2CR12R16
FF1CH Timer 1 compare register 3CR13R/W16
FF1EH Timer 2 compare register 0CR2016
FF20H Port 0 mode registerPM0W8
FF24H Port 4 mode registerPM48
FF25H Port 5 mode registerPM58
FF26H Port 6 mode registerPM68
FF28H Port 8 mode registerPM88
FF29H Port 9 mode registerPM98
FF2EH Real-time output port 0 control registerRTPCR/W8√√
FF30H Timer register 0TM0R16
FF31H Event counterECR/W8
FF32H Timer register 1TM1R16
FF34H Free running counter (bits 0 to 15)FRCL16
FF35H Free running counter (bits 16 to 21)FRCH8
FF36H Timer register 2TM216
FF38H Timer control register 0TMC0R/W8√√
FF39H Timer control register 1TMC18√√
FF3AH Timer control register 2TMC28√√
FF3BH Timer control register 3TMC38√√
--
-
--
-
--
-
--
-
--
--
--
--
-
-
-
-
-
-
--
-
--
--
-
--
√
√
√
√
√
√
√
√
√
√
√
√
-
Undefined
-
-
-
-
-
-
-
√ Cleared to 0
-
√
-
√
-
√
-
√
√
√
√
-
-
-
-
-
-
√ Cleared to 0
-
√
√0000H
√ Cleared to 0
-
-
-
-
FFH
FDH
7FH
00H
00H
00H
00×00000
Remark Cleared to 0: Counter is initialized to 0 within 16 clocks after the reset signal has been deasserted (the
contents before initialization are undefined).
24
µ
PD784915B, 784916B
Table 3-2. Special Function Registers (2/4)
BitBit Units forAfter
AddressSpecial Function Register (SFR) NameSymbolR/W LengthManipulationReleasing