78K/IV Series User’s Manual - Instruction: U10905E
FEATURES
78K/IV Series
Pin-compatible with µPD78234 Subseries,
µ
PD784026 Subseries, and µPD784038
Subseries
Minimum instruction execution time: 125 ns
(@ 32-MHz operation)
I/O ports: 46
Serial interface: 3 channels
UART/IOE (3-wire serial I/O): 2 channels
2
CSI (3-wire serial I/O, 2-wire serial I/O, I
1 channel
PWM output: 2 outputs
C bus):
Timer/counter
16-bit Timer/counter x 3 units
16-bit Timer x 1 unit
Standby function
HALT/STOP/IDLE mode
Clock division function
Watchdog timer: 1 channel
A/D converter: 8-bit resolution x 8 channels
D/A converter: 8-bit resolution x 2 channels
Supply voltage: VDD = 2.7 to 5.5 V
APPLICATION FIELDS
Cellular phones, cordless phones, audio-visual systems, etc.
ORDERING INFORMATION
Part NumberPackage
µ
PD784031YGC-3B9
µ
PD784031YGC-8BT
µ
PD784031YGK-BE980-pin plastic TQFP (fine pitch) (12 x 12 mm)None2048
80-pin plastic QFP (14 x 14 mm, thickness 2.7 mm)
80-pin plastic QFP (14 x 14 mm, thickness 1.4 mm)
Internal ROM (Bytes)Internal RAM (Bytes)
None2048
None2048
Document No. U11504EJ1V0DS00 (1st edition)
Date Published July 1997 N
Printed in Japan
The information in this document is subject to change without notice.
7.3Real-time Output Port ........................................................................................................................... 29
9.5Bus Hold Function ................................................................................................................................ 49
10. STANDBY FUNCTION .................................................................................................................... 50
11. RESET FUNCTION ......................................................................................................................... 51
12. INSTRUCTION SET ........................................................................................................................ 52
A8 to A19: Address Bus
AD0 to AD7: Address/Data Bus
ANI0 to ANI7: Analog Input
ANO0, ANO1: Analog Output
ASCK, ASCK2: Asynchronous Serial Clock
ASTB: Address Strobe
DD: Analog Power Supply
AV
AVREF1 to AVREF3 : Reference Voltage
SS: Analog Ground
AV
CI: Clock Input
HLDAK: Hold Acknowledge
HLDRQ: Hold Request
INTP0 to INTP5: Interrupt from Peripherals
NMI: Non-maskable Interrupt
P00 to P07: Port0
P10 to P17: Port1
P20 to P27: Port2
P30 to P37: Port3
P60 to P63, P66, P67
: Port6
P70 to P77: Port7
PWM0, PWM1: Pulse Width Modulation Output
RD: Read Strobe
REFRQ: Refresh Request
RESET: Reset
RxD, RxD2: Receive Data
SCK0 to SCK2: Serial Clock
SCL: Serial Clock
SDA: Serial Data
SI0 to SI2: Serial Input
SO0 to SO2: Serial Output
TEST: Test
TO0 to TO3: Timer Output
TxD, TxD2: Transmit Data
• Can be used as real-time output port (4 bits x 2).
• Can be set in input or output mode bitwise.
• Pins set in input mode can be connected to internal pull-up
resistors by software.
• Can drive transistor.
Port 1 (P1):
• 8-bit I/O port
• Can be set in input or output mode bitwise.
• Pins set in input mode can be connected to internal pull-up
resistors by software.
• Can drive LEDs.
Port 2 (P2):
• 8-bit input port
• P20 cannot be used as general-purpose port pin (non-maskable
interrupt). However, its input level can be checked by interrupt
routine.
• P22 through P27 can be connected to internal pull-up resistors
by software in 6-bit units.
• P25/INTP4/ASCK/SCK1 pin can operate as SCK1 output pin if
so specified by CSIM1.
P30I/ORxD/S1
P31TxD/SO1
P32SCK0/SCL
P33SO0/SDA
P34 to P37TO0 to TO3
P60 to P63I/OA16 to A19
P66WAIT/HLDRQ
P67REFRQ/HLDAK
P70 to P77I/OAN10 to AN17
Port 3 (P3):
• 8-bit I/O port
• Can be set in input or output mode bitwise.
• Pins set in input mode can be connected to internal pull-up
resistors by software.
Port 6 (P6):
• P60 through P63 is dedicated ports for output.
• P66 and P67 can be set in input or output mode bitwise.
• Pins set in input mode can be connected to internal pull-up
resistors by software.
Port 7 (P7):
• 8-bit I/O port
• Can be set in input or output mode bitwise.
11
Page 12
µ
PD784031Y
5.2 Non-port Pins
Pin NameI/OAlternate FunctionFunction
TO0 to TO3OutputP34 to P37Timer output
CIInputP23/INTP2Count clock input to timer/counter 2
RxDInputP30/SI1Serial data input (UART0)
RxD2P13/SI2Serial data input (UART2)
TxDOutputP31/SO1Serial data output (UART0)
TxD2P14/SO2Serial data output (UART2)
ASCKInputP25/INTP4/SCK1Baud rate clock input (UART0)
ASCK2P12/SCK2Baud rate clock input (UART2)
SDAI/OP33/SO0Serial data input/output (2-wire serial I/O, I2C bus)
SI0InputP27Serial data input (3-wire serial I/O0)
SI1P30/RxDSerial data input (3-wire serial I/O1)
SI2P13/RxD2Serial data input (3-wire serial I/O2)
SO0OutputP33/SDASerial data output (3-wire serial I/O0)
SO1P31/TxDSerial data output (3-wire serial I/O1)
SO2P14/TxD2Serial data output (3-wire serial I/O2)
SCK0I/OP32/SCLSerial clock input/output (3-wire serial I/O0)
SCK1P25/INTP4/ASCKSerial clock input/output (3-wire serial I/O1)
SCK2P12/ASCK2Serial clock input/output (3-wire serial I/O2)
SCLP32/SCK0Serial clock input/output (2-wire serial I/O, I2C bus)
NMIInputP20External interrupt requests–
INTP0P21• Count clock input to timer/counter 1
• Capture trigger signal of CR11 or CR12
INTP1P22• Count clock input to timer/counter 2
• Capture trigger signal of CR22
INTP2P23/CI• Count clock input to timer/counter 2
• Capture trigger signal of CR21
INTP3P24• Count clock input to timer/counter 0
• Capture trigger signal of CR02
INTP4P25/ASCK/SCK1–
INTP5P26Conversion start trigger input to A/D converter
AD0 to AD7I/O–Time-division address/data bus (for external memory connection)
A8 to A15Output–Higher address bus (for external memory connection)
A16 to A19OutputP60 to P63Higher address when address is extended (for external memory connection)
RDOutput–Read strobe to external memory
WROutput–Write strobe to external memory
WAITInputP66/HLDRQWait insertion
REFRQOutputP67/HLDAKRefresh pulse output to external pseudo static memory
HLDRQInputP66/WAITBus hold request input
HLDAKOutputP67/REFRQBus hold acknowledge output
ASTBOutput–Latch timing output of time-division address (A0 through A7)
(when accessing external memory)
12
Page 13
Pin NameI/OAlternate FunctionFunction
RESETInput–Chip reset
X1Input–Crystal connection for system clock oscillation
X2–(Clock can also be input to X1.)
ANI0 to ANI7InputP70 to P77Analog voltage input to A/D converter
ANO0, ANO1Output–Analog voltage output from D/A converter
AVREF1––Reference voltage to A/D converter
AVREF2, AVREF3
AVDDA/D converter power supply
AVSSA/D converter GND
Note 1
VDD0
Note 1
VDD1
Note 2
VSS0
Note 2
VSS1
TESTDirectly connect to VSS0 (IC test pin).
Reference voltage to D/A converter
Power supply of port
Power supply except for port
GND of port
GND except for port
Notes 1. Provide the same potential to VDD0 and VDD1.
2. Provide the same potential to V
SS0 and VSS1.
µ
PD784031Y
13
Page 14
5.3 Types of Pin I/O Circuits and Connections for Unused Pins
Table 5-1 shows types of pin I/O circuits and the connections for unused pins.
For the input/output circuit of each type, refer to Figure 5-1.
Table 5-1. Types of Pin I/O Circuits and Connections for Unused Pins (1/2)
Pin NameI/O Circuit TypeI/ORecommended Connection for Unused Pins
P00 to P075-HI/OInput: Connect to VDD0.
P10/PWM0Output: Open
P11/PWM1
P12/ASCK2/SCK28-C
P13/RxD2/SI25-H
P14/TxD2/SO2
P15 to P17
P20/NMI2InputConnect to VDD0 or VSS0.
P21/INTP0
P22/INTP12-CConnect to VDD0.
µ
PD784031Y
P23/INTP2/CI
P24/INTP3
P25/INTP4/ASCK/SCK1 8-CI/OInput: Connect to VDD0.
Output: Open
P26/INTP52-CInputConnect to VDD0.
P27/SI0
P30/RxD/SI15-HI/OInput: Connect to VDD0.
P31/TxD/SO1Output: Open
P32/SCK0/SCL10-B
P33/SO0/SDA
P34/TO0 to P37/TO35-H
AD0 to AD7
A8 to A15Output
P60/A16 to P63/A19
RD
WR
P66/WAIT/HLDRQI/OInput: Connect to VDD0.
P67/REFRQ/HLDAKOutput: Open
P70/ANI0 to P77/ANI720-AInput: Connect to VDD0 or VSS0.
ANO0, ANO112OutputOpen
Note
Open
Output: Open
ASTB4-B
Note I/O circuit type of these pins is 5-H. However these pins perform only as output by an internal circuit.
14
Page 15
Table 5-1. Types of Pin I/O Circuits and Connections for Unused Pins (2/2)
Pin NameI/O Circuit TypeI/ORecommended Connection for Unused Pins
RESET2Input–
TEST1-ADirectly connect to VSS0.
AVREF1 to AVREF3–Connect to VSS0.
AVSS
AVDDConnect to VDD0.
µ
PD784031Y
CautionConnect an I/O pin whose input/output mode is unstable to V
DD0 via a resistor of several 10 kΩ
(especially if the voltage on the reset input pin rises higher than the low-level input level on power
application or when the mode is switched between input and output by software).
Remark Because the circuit type numbers shown in the above table are commonly used with all the models in the 78K
Series, these numbers of some models are not serial (because some circuits are not provided to some models).
15
Page 16
Figure 5-1. Types of Pin I/O Circuits
µ
PD784031Y
Type 1-A
DD0
V
P
IN
N
V
SS0
Type 2
IN
Schmitt trigger input with hysteresis characteristics
Type 4-B
data
output
disable
DD0
V
P
N
V
SS0
OUT
Type 2-C
V
DD0
P
IN
Schmitt trigger input with hysteresis characteristics
Type 5-H
pullup
enable
data
output
disable
DD0
V
P
N
V
SS0
pullup
enable
V
DD0
P
IN/OUT
Push-pull output that can go into a high-impedance
state (with both P-ch and N-ch off)
Type 8-C
pullup
enable
data
output
disable
DD0
V
P
N
V
SS0
Type 10-B
pullup
enable
DD0
V
data
open drain
output disable
P
N
V
SS0
input
enable
Type 12
V
DD0
P
P
Analog output voltage
IN/OUT
V
DD0
Type 20-A
N
data
P
OUT
DD0
V
P
IN/OUT
IN/OUT
output
disable
Comparator
+
–
AV
AV
REF
(threshold voltage)
N
V
SS0
P
N
SS
input
enable
16
Page 17
µ
PD784031Y
6. CPU ARCHITECTURE
6.1 Memory Space
A memory space of 1 Mbytes can be accessed. Mapping of the internal data area (special function registers and internal
RAM) can be specified the LOCATION instruction. The LOCATION instruction must be always executed after reset
cancellation, and must not be used more than once.
(1) When LOCATION 0 instruction is executed
The internal data area is mapped in 0F700H to 0FFFFH.
(2) When LOCATION 0FH instruction is executed
The internal data area is mapped in FF700H to FFFFFH.
17
Page 18
18
Figure 6-1. Memory Map of
µ
PD784031Y
On execution of
LOCATION 0 instruction
HFFFFF
External memory
(960 Kbytes)
H00001
HFFFF0
Special function registers (SFR)
HFDFF0
H0DFF0
H00FF0
HFFEF0
H00DF0
HFFCF0
(256 bytes)
Internal RAM
(2 Kbytes)
H007F0
HFF6F0
External memory
(63232 bytes)
H00000
Note
HFFEF0
General-purpose
registers (128 bytes)
H08EF0
HF7EF0
H13EF0
Macro service control word
area (44 bytes)
H60EF0
Data area (512 bytes)
H00DF0
HFFCF0
Program/data area
(1536 bytes)
H007F0
H00010
HFFF00
CALLF entry area
(2 Kbytes)
H00800
HFF700
H08000
HF7000
CALLT table area
(64 bytes)
H04000
HF3000
Vector table area
(64 bytes)
H00000
On execution of
LOCATION 0FH instruction
HFFFFF
Special function registers (SFR)
HFDFFF
H0DFFF
HFFEFF
H00FFF
HFFEFF
(256 bytes)
Internal RAM
(2 Kbytes)
H08EFF
HF7EFF
13
HEFF
H60EFF
H00DFF
HFFCFF
H007FF
HFF6FF
External memory
(1046272 bytes)
H007FF
HFFF00
H00800
HFF700
H08000
HF7000
H00001
HFFFF0
Note
H00000
µ
PD784031Y
Note Base area and entry area for reset or interrupt. However, the internal RAM area is not used as a reset entry area.
Page 19
µ
(
PD784031Y
6.2 CPU Registers
6.2.1 General-purpose registers
Sixteen 8-bit general-purpose registers are available. Two 8-bit registers can be also used in pairs as a 16-bit register.
Of the 16-bit registers, four can be used in combination with an 8-bit register for address expansion as 24-bit address
specification registers.
Eight banks of these registers are available which can be selected by using software or the context switching function.
The general-purpose registers except V, U, T, and W registers for address expansion are mapped to the internal RAM.
Figure 6-2. General-purpose Register Format
V
VVP (RG4)
U
UUP (RG5)
T
TDE (RG6)
W
WHL (RG7)
Parentheses
A (R1)
AX (RP0)
B (R3)
BC (RP1)
R5
R7
R9
VP (RP4)
R11
UP (RP5)
D (R13)
DE (RP6)
H (R15)
HL (RP7)
) indicate an absolute name.
X (R0)
C (R2)
R4
RP2
R6
RP3
R8
R10
E (R12)
L (R14)
8 banks
CautionRegisters 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 the PSW to 1. However, use this function only for recycling the program of
the 78K/III Series.
19
Page 20
6.2.2 Control registers
(1) Program counter (PC)
The program counter is a 20-bit register whose contents are automatically updated when the program is executed.
Figure 6-3. Program Counter (PC) Format
190
PC
(2) Program status word (PSW)
This register holds the statuses of the CPU. Its contents are automatically updated when the program is executed.
Figure 6-4. Program Status Word (PSW) Format
15141312111098
UFRBS2RBS1RBS0––––PSWH
µ
PD784031Y
PSW
76543210
SZRSS
Note
ACIEP/V0CYPSWL
Note This flag is provided to maintain compatibility with the 78K/III Series. Be sure to clear this flag to 0, except when
the software for the 78K/III Series is used.
(3) Stack pointer (SP)
This is a 24-bit pointer that holds the first address of the stack.
Be sure to write 0 to the higher 4 bits of this pointer.
Figure 6-5. Stack Pointer (SP) Format
230
SP
20
0000
20
Page 21
µ
PD784031Y
6.2.3 Special function registers (SFRs)
The special function registers, such as the mode registers and control registers of the internal peripheral hardware, are
registers to which special functions are allocated. These registers are mapped to a 256-byte space of addresses 0FF00H
Note
through 0FFFFH
Note On execution of the LOCATION 0 instruction. FFF00H through FFFFFH on execution of the LOCATION 0FH
instruction.
CautionDo not access an address in this area to which no SFR is allocated. If such an address is accessed by
mistake, the
inputting the reset signal.
Table 6-1 lists the special function registers (SFRs). The meanings of the symbols in this table are as follows:
• Symbol................................ Symbol indicating an SFR. This symbol is reserved for NEC’s assembler (RA78K4).
.
µ
PD784031Y may be in the deadlock status. This deadlock status can be cleared only by
It can be used as an sfr variable by the #pragma sfr command with the C compiler
(CC78K4).
• R/W..................................... Indicates whether the SFR is read-only, write-only, or read/write.
R/W : Read/write
R: Read-only
W: Write-only
• Bit units for manipulation .... Bit units in which the value of the SFR can be manipulated.
SFRs that can be manipulated in 16-bit units can be described as the operand
sfrp of an instruction. To specify the address of this SFR, describe an even
address.
SFRs that can be manipulated in 1-bit units can be described as the operand of a
bit manipulation instruction.
• After reset........................... Indicates the status of the register when the RESET signal has been input.
21
Page 22
µ
PD784031Y
Table 6-1. Special Function Registers (SFRs) (1/4)
Special Function Register (SFR) NameSymbolR/WBit Units for ManipulationAfter Reset
1 bit8 bits16 bits
0FF0FH
0FF10HCompare register (timer/counter 0)CR00––√
0FF12HCapture/compare register (timer/counter 0)CR01––√
0FF14HCompare register L (timer/counter 1)
0FF15HCompare register H (timer/counter 1)–––
0FF16HCapture/compare register L (timer/counter 1)
0FF17HCapture/compare register H (timer/counter 1)–––
0FF18HCompare register L (timer/counter 2)
0FF19HCompare register H (timer/counter 2)–––
0FF1AHCapture/compare register L (timer/counter 2)
0FF1BHCapture/compare register H (timer/counter 2)–––
0FF1CHCompare register L (timer 3)
0FF1DHCompare register H (timer 3)–––
0FF20HPort 0 mode registerPM0√√–FFH
0FF21HPort 1 mode registerPM1√√–
0FF23HPort 3 mode registerPM3√√–
0FF26HPort 6 mode registerPM6√√–
0FF27HPort 7 mode registerPM7√√–
Port 0 buffer register H
P0H√√–
CR10
CR11
CR20
CR21
CR30
CR10W
CR11W
CR20W
CR21W
CR30W
–√√
–√√
–√√
–√√
–√√
0FF2EHReal-time output port control registerRTPC√√–00H
0FF30HCapture/compare control register 0CRC0–√–10H
0FF31HTimer output control registerTOC√√–00H
0FF32HCapture/compare control register 1CRC1–√–
0FF33HCapture/compare control register 2CRC2–√–10H
Note When the LOCATION 0 instruction is executed. When the LOCATION 0FH instruction is executed, “F0000H” is
added to this value.
22
Page 23
µ
PD784031Y
Table 6-1. Special Function Registers (SFRs) (2/4)
Note 1
Address
0FF36HCapture register (timer/counter 0)CR02R––√0000H
0FF38HCapture register L (timer/counter 1)
0FF39HCapture register H (timer/counter 1)–––
Special Function Register (SFR) NameSymbolR/WBit Units for ManipulationAfter Reset
1 bit8 bits16 bits
CR12
CR12W
–√√
0FF3AHCapture register L (timer/counter 2)
0FF3BHCapture register H (timer/counter 2)–––
0FF41HPort 1 mode control registerPMC1R/W√√–00H
0FF43HPort 3 mode control registerPMC3√√–
0FF4EHPull-up resistor option registerPUO√√–
0FF50HTimer register 0TM0R––√0000H
0FF51H––
0FF52HTimer register 1TM1
0FF53H–––
0FF54HTimer register 2TM2
0FF55H–––
0FF56HTimer register 3TM3
0FF57H–––
0FF5CHPrescaler mode register 0PRM0R/W–√–11H
0FF5DHTimer control register 0TMC0√√ –00H
0FF5EHPrescaler mode register 1PRM1–√–11H
0FF5FHTimer control register 1TMC1√√–00H
0FF60HD/A conversion value setting register 0DACS0–√–
CR22
CR22W
TM1W
TM2W
TM3W
–√√
–√√
–√√
–√√
0FF61HD/A conversion value setting register 1DACS1–√–
0FF62HD/A converter mode registerDAM√√–03H
0FF68HA/D converter mode registerADM√√–00H
0FF6AHA/D conversion result registerADCRR–√–Undefined
0FF70HPWM control registerPWMCR/W√√–05H
0FF71HPWM prescaler registerPWPR–√–00H
0FF72HPWM modulo register 0PWM0––√Undefined
0FF74HPWM modulo register 1PWM1––√
0FF7DHOne-shot pulse output control registerOSPC√√ –00H
0FF80HI2C bus control registerIICC√√–
0FF81HPrescaler mode register for serial clockSPRM–√–04H
0FF82HClocked serial interface mode registerCSIM√√–00H
0FF83HSlave address registerSVA
Note 2√Note 3
R/W
√–01H
Notes 1. When the LOCATION 0 instruction is executed. When the LOCATION 0FH instruction is executed, “F0000H”
is added to this value.
2. Bit 0 is read-only.
3. Only bit 0 can be manipulated in bit units.
23
Page 24
µ
Table 6-1. Special Function Registers (SFRs) (3/4)
Note 1
Address
0FF84HClocked serial interface mode register 1CSIM1R/W√√–00H
0FF85HClocked serial interface mode register 2CSIM2√√–
0FF86HSerial shift registerSIO–√–
0FF88HAsynchronous serial interface mode registerASIM√√–
0FF89HAsynchronous serial interface mode register 2ASIM2√√–
0FF8AHAsynchronous serial interface status registerASISR√√–
Special Function Register (SFR) NameSymbolR/WBit Units for ManipulationAfter Reset
Notes 1. When the LOCATION 0 instruction is executed. When the LOCATION 0FH instruction is executed, “F0000H”
is added to this value.
2. Data can be written by using only dedicated instructions such as MOV STBC, #byte and MOV WDM, #byte,
and cannot be written with any other instructions.
24
Page 25
µ
PD784031Y
Table 6-1. Special Function Registers (SFRs) (4/4)
Note
Address
0FFCCHRefresh mode registerRFMR/W√√–00H
0FFCDHRefresh area specification registerRFA√√–
0FFCFHOscillation stabilization time specificationOSTS–√–
0FFD0H to External SFR area–√√––
0FFDFH
0FFE0HInterrupt control register (INTP0)PIC0√√–43H
0FFE1HInterrupt control register (INTP1)PIC1√√–
0FFE2HInterrupt control register (INTP2)PIC2√√–
0FFE3HInterrupt control register (INTP3)PIC3√√–
0FFE4HInterrupt control register (INTC00)CIC00√√ –
0FFE5HInterrupt control register (INTC01)CIC01√√ –
Special Function Register (SFR) NameSymbolR/WBit Units for ManipulationAfter Reset
1 bit8 bits16 bits
register
0FFE6HInterrupt control register (INTC10)CIC10√√ –
0FFE7HInterrupt control register (INTC11)CIC11√√ –
0FFE8HInterrupt control register (INTC20)CIC20√√ –
0FFE9HInterrupt control register (INTC21)CIC21√√ –
0FFEAHInterrupt control register (INTC30)CIC30√√ –
0FFEBHInterrupt control register (INTP4)PIC4√√–
0FFECHInterrupt control register (INTP5)PIC5√√–
0FFEDHInterrupt control register (INTAD)ADIC√√–
0FFEEHInterrupt control register (INTSER)SERIC√√–
0FFEFHInterrupt control register (INTSR)SRIC√√–
Interrupt control register (INTCSI1)CSIIC1√√–
0FFF0HInterrupt control register (INTST)STIC√√–
0FFF1HInterrupt control register (INTCSI)CSIIC√√–
0FFF2HInterrupt control register (INTSER2)SERIC2√√–
0FFF3HInterrupt control register (INTSR2)SRIC2√√–
Interrupt control register (INTCSI2)CSIIC2√√–
0FFF4HInterrupt control register (INTST2)STIC2√√–
0FFF5HInterrupt control register (INTSPC)SPCIC√√–
Note When the LOCATION 0 instruction is executed. When the LOCATION 0FH instruction is executed, “F0000H” is
added to this value.
25
Page 26
µ
PD784031Y
7. PERIPHERAL HARDWARE FUNCTIONS
7.1 Ports
The ports shown in Figure 7-1 are provided to make various control operations possible. Table 7-1 shows the function
of each port. Ports 0 through 6 can be connected to internal pull-up resistors by software when inputting.
Figure 7-1. Port Configuration
P00
Port 0
P07
P10
Port 1
P17
P20 to P27
P30
P37
P60
P63
P66
P67
P70
P77
Port 2
8
Port 3
Port 6
Port 7
26
Page 27
µ
PD784031Y
Table 7-1. Port Functions
Port NamePin NameFunctionSpecification of Pull-up Resistor
Connection by Software
Port 0P00 to P07• Can be set in input or output mode in 1-bit units. All port pins in input mode
• Can operate as 4-bit real-time output port
(P00 through P03 and P04 through P07).
• Can drive transistor.
Port 1P10 to P17• Can be set in input or output mode in 1-bit units. All port pins in input mode
• Can drive LEDs.
Port 2P20 to P27• Input portIn 6-bit units (P22 through P27)
Port 3P30 to P37• Can be set in input or output mode in 1-bit units. All port pins in input mode
Port 6P60 to P63• Output onlyAll port pins in input mode
P66, P67• Can be set in input or output mode in 1-bit units.
Port 7P70 to P77• Can be set in input or output mode in 1-bit units.–
7.2 Clock Generation Circuit
An on-chip clock generation circuit necessary for operation is provided. This clock generation circuit has a divider circuit.
If high-speed operation is not necessary, the internal operating frequency can be lowered by the divider circuit to reduce
the current consumption.
Figure 7-2. Block Diagram of Clock Generation Circuit
X1
Oscillation
circuit
X2
Remark fXX : oscillation frequency or external clock input
CautionWhen using the clock oscillation circuit, wire the dotted portion in the above figure as follows to avoid
adverse influences of wiring capacitance.
• Keep the wiring length as short as possible.
• Do not cross the wiring with other signal lines.
• Do not route the wiring in the vicinity of lines through which a high alternating current flows.
• Always keep the potential at the ground point of the capacitor in the oscillation circuit the same
SS1. Do not ground to a ground pattern through which a high current flows.
as V
• Do not extract signals from the oscillation circuit.
28
Page 29
µ
PD784031Y
7.3 Real-time Output Port
The real-time output port outputs data stored in a buffer in synchronization with the coincidence interrupt generated by
timer/counter 1 or with an external interrupt. As a result, pulses without jitter can be output.
The real-time output port is therefore ideal for applications where arbitrary patterns must be output at specific intervals
(such as open loop control of a stepping motor).
The real-time output port mainly consists of port 0 and port 0 buffer registers (P0H and P0L) as shown in Figure 7-4.
Figure 7-4. Block Diagram of Real-time Output Port
Three units of timers/counters and one unit of timer are provided.
Because a total of seven interrupt requests are supported, these timers/counters and timer can be used as seven units
One-shot pulse output
Real-time output–√––
Pulse width measurement1 input1 input2 inputs–
Number of interrupt requests2221
Note
√–––
Note The one-shot pulse output function makes a pulse output level active by software and inactive by hardware (interrupt
request signal).
This function is different in nature from the one-shot timer function of timer/counter 2.
30
Page 31
Timer/counter 0
Figure 7-5. Block Diagram of Timers/Counters
Clear control
Software trigger
µ
PD784031Y
INTP3
Timer/counter 1
INTP0
f
XX/8
Edge detection
XX/8
f
Edge detection
Prescaler
Prescaler
Event input
INTP3
INTP0
Selector
Selector
Capture/Compare register
Timer register 0
(TM0)
Compare register
(CR00)
Compare register
(CR01)
Capture register
(CR02)
Clear control
Timer register 1
(TM1/TM1W)
Compare register
(CR10/CR10W)
(CR11/CR11W)
Capture register
(CR12/CR12W)
Match
Match
Match
Match
OVF
TO0
TO1
Pulse output control
INTC00
INTC01
OVF
INTC10
To real-time output port
INTC11
Timer/counter 2
f
XX/8
INTP1
Edge detection
Edge detection
INTP2/CI
Timer 3
XX/8
f
Remark OVF: overflow flag
Prescaler
INTP2
Prescaler
INTP1
Selector
Capture/Compare register
Clear control
Timer register 2
(TM2/TM2W)
Compare register
(CR20/CR20W)
(CR21/CR21W)
Capture register
(CR22/CR22W)
Timer register 3
(TM3/TM3W)
Compare register
(CR30/CR30W)
Match
Match
Clear
Match
OVF
TO2
TO3
Pulse output control
INTC20
INTC21
CSI
INTC30
31
Page 32
µ
PD784031Y
7.5 PWM Output (PWM0, PWM1)
Two channels of PWM (pulse width modulation) output circuits with a resolution of 12 bits and a repeat frequency of
62.5 kHz (f
These outputs are ideal for controlling the speed of a DC motor.
CLK = 16 MHz) are provided. Both these PWM output channels can select a high or low level as the active level.
Figure 7-6. Block Diagram of PWM Output Unit
Internal bus
f
CLK
Prescaler
Remark n = 0 or 1
PWM modulo register
PWMn
8-bit down counter
1/256
16
0347815
8
4
Pulse control circuit
4-bit counter
8
PWM control
register (PWMC)
Reload
control
Output
control
PWMn (output pin)
32
Page 33
µ
Internal bus
ANI0
ANI1
ANI2
ANI3
ANI4
ANI5
ANI6
ANI7
INTP5
Input selector
Edge
detection
circuit
Conversion trigger
Sample & hold circuit
Voltage comparator
Successive approximation
register (SAR)
Control
Circuit
INTAD
8
Series resistor string
R/2
Tap selector
R
R/2
AV
REF1
AV
SS
8
Trigger enable
A/D converter mode
register (ADM)
8
A/D conversion result
register (ADCR)
PD784031Y
7.6 A/D Converter
An analog-to-digital (A/D) converter with eight multiplexed inputs (ANI0 through ANI7) is provided.
This A/D converter is of successive approximation type. The result of conversion is retained by an 8-bit A/D conversion
result register (ADCR). Therefore, high-speed, high-accuracy conversion can be performed (conversion time: approx. 7.5
µ
s at fCLK = 16 MHz).
A/D conversion can be started in either of the following two modes:
• Hardware start: Conversion is started by trigger input (INTP5).
• Software start: Conversion is started by setting a bit of the A/D converter mode register (ADM).
After started, the A/D converter operates in the following modes:
• Scan mode: Two or more analog inputs are sequentially selected, and data to be converted are obtained from all the
input pins.
• Select mode: Only one analog input pin is used to continuously obtain converted values.
These operation modes and whether starting or stopping the A/D converter are specified by the ADM.
When the result of conversion is transferred to the ADCR, interrupt request INTAD is generated. By using this request
and macro service, the converted values can be successively transferred to the memory.
Figure 7-7. Block Diagram of A/D Converter
33
Page 34
µ
PD784031Y
7.7 D/A Converter
Two circuits of digital-to-analog (D/A) converters are provided. These D/A converters are of voltage output type and
have a resolution of 8 bits.
The conversion method is of R-2R resistor ladder type. By writing a value to be output to an 8-bit D/A conversion value
setting register (DACSn: n = 0 or 1), an analog value is output to the ANOn (n = 0 or 1) pin. The output voltage range is
determined by the voltage applied across the AV
Because the output impedance is high, no current can be extracted from the output. If the impedance of the load is low,
insert a buffer amplifier between the load and output pin.
The ANOn pin goes into a high-impedance state while the RESET signal is low. After releasing reset, DACSn is cleared
to 0.
Figure 7-8. Block Diagram of D/A Converter
AV
REF2
REF2 and AVREF3 pins.
ANOn
2R
R
AV
REF3
2R
Selector
R
2R
R
2R
DACSnDACEn
Remark n = 0 or 1
34
Internal bus
Page 35
µ
PD784031Y
7.8 Serial Interface
Three independent serial interface channels are provided.
Asynchronous serial interface (UART)/3-wire serial I/O (IOE) x 2
Clocked serial interface (CSI) x 1
• 3-wire serial I/O (IOE)
• 2-wire serial I/O (IOE)
2
C bus interface (I2C)
• I
Therefore, communication with an external system and local communication within the system can be simultaneously
executed (refer to Figure 7-9).
Figure 7-9. Example of Serial Interface
2
C
V
DD
V
DD
PD6272 (EEPROM
µ
SDA
SCL
PD78062Y (slave)
µ
TM
)
PD4711A
µ
RS-232-C
driver/receiver
PD784031Y (master)
µ
[UART]
RxD
TxD
Port
(a) UART + I
2
C]
[I
SDA
SCL
PD4711A
µ
RS-232-C
driver/receiver
PD4711A
µ
RS-232-C
driver/receiver
[UART]
RxD2
TxD2
Port
(b) UART + 3-wire serial I/O + 2-wire serial I/O
PD784031Y (master)
µ
[3-wire serial I/O]
SI1
Note
Port
V
SCL
Note
Port
[2-wire serial I/O]
[UART]
RxD
TxD
Port
SO1
SCK1
INTPm
SDA
INTPn
SDA
SCL
PD75108 (slave)
µ
SI
SO
SCK
Port
INT
V
DD
DD
PD78014 (slave)
µ
SB0
SCK0
Port
INT
LCD
Note Handshake line
35
Page 36
µ
PD784031Y
7.8.1 Asynchronous serial interface/3-wire serial I/O (UART/IOE)
Two channels of serial interfaces that can select an asynchronous serial interface mode and 3-wire serial I/O mode are
provided.
(1) Asynchronous serial interface mode
In this mode, data of 1 byte following the start bit is transferred or received.
Because an on-chip baud rate generator is provided, a wide range of baud rates can be set.
Moreover, the clock input to the ASCK pin can be divided to define a baud rate.
When the baud rate generator is used, a baud rate conforming to the MIDI standard (31.25 kbps) can be also
obtained.
Figure 7-10. Block Diagram in Asynchronous Serial Interface Mode
Internal bus
Receive bufferRXB, RXB2
R
X
D, RXD2
T
X
D, TXD2
Baud rate generator
f
XX
/2
ASCK, ASCK2
Remark f
XX: oscillation frequency or external clock input
n = 0 through 11
m = 16 through 30
Selector
1/2
n + 1
Receive shift
register
Receive control
parity check
1/2m
1/2m
INTSR,
INTSR2
INTSER,
INTSER2
Transmit shift
register
Transmit control
parity append
TXS, TXS2
INTST, INTST2
36
Page 37
µ
PD784031Y
(2) 3-wire serial I/O mode
In this mode, the master device starts transfer by making the serial clock active and transfers 1-byte data in
synchronization with this clock.
This mode is used to communicate with a device having the conventional clocked serial interface. Basically,
communication is established by using three lines: one serial clock (SCK) and two serial data (SI and SO) lines.
Generally, to check the communication status, a handshake line is necessary.
Figure 7-11. Block Diagram in 3-wire Serial I/O Mode
Internal bus
Direction control circuit
SIO1, SIO2
SI1, SI2
Shift registerOutput latch
SO1, SO2
SCK1, SCK2
Remark f
Serial clock counter
Serial clock
control circuit
XX: oscillation frequency or external clock input
n = 0 through 11
m = 1 or 16 through 30
Interrupt signal
generation circuit
1/m1/2
Selector
INTCSI1,
INTCSI2
n + 1
fXX/2
37
Page 38
µ
PD784031Y
7.8.2 Clocked serial interface (CSI)
In this mode, the master device starts transfer by making the serial clock active and communicates 1-byte data in
synchronization with this clock.
Figure 7-12. Block Diagram of Clocked Serial Interface
Internal bus
SI0
SO0/SDA
(in 2-wire or I
SCK0/SCL
N-ch open drain output
2
C bus mode)
Selector
Direction
control
register
Shift register
Start condition
detection circuit
detection circuit
Stop condition
detection circuit
Serial clock
Slave address
register
Acknowledge
counter
Match signal
SetReset
Output latch
Interrupt signal
generation
circuit
Acknowledge
detection
control
Wake-up
control circuit
INTSPC
INTCSI
Remark f
38
Serial clock
control circuit
N-ch open drain output
(in 2-wire or I
XX: oscillation frequency or external clock input
2
C bus mode)
CLS0
CLS1
Selector
Timer 3 output
XX
/16
f
Selector
Prescaler
XX
/2
f
Page 39
µ
PD784031Y
(1) 3-wire serial I/O mode
This mode is to communicate with devices having the conventional clocked serial interface.
Basically, communication is established in this mode with three lines: one serial clock (SCK0) and two serial data
(SI0 and SO0) lines.
Generally, a handshake line is necessary to check the communication status.
(2) 2-wire serial I/O mode
This mode is to transfer 8-bit data by using two lines: serial clock (SCL) and serial data bus (SDA).
Generally, a handshake line is necessary to check the communication status.
2
C (Inter IC) bus mode
(3) I
2
This mode is to communicate with devices conforming to the I
This mode is to transfer 8-bit data with two or more devices by using two lines: serial clock (SCL) and serial data
bus (SDA).
During transfer, a “start condition”, “data”, and “stop condition” can be output onto the serial data bus. During
reception, these data can be automatically detected by hardware.
C bus format.
7.9 Edge Detection Function
The interrupt input pins (NMI and INTP0 through INTP5) are used not only to input interrupt requests but also to input
trigger signals to the internal hardware units. Because these pins operate at an edge of the input signal, they have a function
to detect an edge. Moreover, a noise reduction circuit is also provided to prevent erroneous detection due to noise.
Pin NameDetectable EdgeNoise Reduction
NMIEither of rising or falling edgeBy analog delay
INTP0 to INTP3Either or both of rising and falling edgesBy clock sampling
INTP4, INTP5By analog delay
NoteINTP0 can select a sampling clock.
Note
39
Page 40
µ
PD784031Y
7.10 Watchdog Timer
A watchdog timer is provided to detect a hang up of the CPU. This watchdog timer generates a non-maskable interrupt
unless it is cleared by software within a specified interval time. Once enabled to operate, the watchdog timer cannot be
stopped by software. Whether the interrupt by the watchdog timer or the interrupt input from the NMI pin takes precedence
can be specified.
Figure 7-13. Block Diagram of Watchdog Timer
f
CLK
Clear signal
Timer
21
f
CLK
/2
20
f
CLK
/2
19
f
CLK
/2
17
f
CLK
/2
Selector
INTWDT
40
Page 41
µ
PD784031Y
8. INTERRUPT FUNCTION
As the servicing in response to an interrupt request, the three types shown in Table 8-1 can be selected by program.
Table 8-1. Servicing of Interrupt Request
Servicing ModeEntity of ServicingServicingContents of PC and PSW
Vector interruptSoftwareBranches and executes servicing routineSaves to and restores
(servicing is arbitrary).from stack.
Context switchingAutomatically switches register bank,Saves to or restores from
branches and executes servicing routinefixed area in register bank.
(servicing is arbitrary).
Macro serviceFirmwareExecutes data transfer between memoryRetained
and I/O (servicing is fixed).
8.1 Interrupt Sources
Table 8-2 shows the interrupt sources available. As shown, interrupts are generated by 24 types of sources, execution
of the BRK instruction or BRKCS instruction, or an operand error.
The priority of interrupt servicing can be set to four levels, so that nesting can be controlled during interrupt servicing
and that which of the two or more interrupts that simultaneously occur should be serviced first. When the macro service
function is used, however, nesting always proceeds.
The default priority is the priority (fixed) of the service that is performed if two or more interrupt requests, having the same
request, simultaneously generate (refer to Table 8-2).
41
Page 42
Table 8-2. Interrupt Sources
µ
PD784031Y
TypeDefaultSourceInternal/
PriorityNameTriggerExternal
Software–BRK instructionInstruction execution––
BRKCS instruction
Operand errorIf result of exclusive OR between byte of operand and
byte is not FFH when MOV STBC, #byte, MOV WDM,
#byte, or LOCATION instruction is executed
Non-maskable
Maskable0 (highest)INTP0Detection of pin input edgeExternal√
(TM0 capture trigger, TM0 event counter input)
4INTC00Generation of TM0-CR00 match signalInternal√
5INTC01Generation of TM0-CR01 match signal
6INTC10Generation of TM1-CR10 match signal
(in 8-bit operation mode)
Generation of TM1W-CR10W match signal
(in 16-bit operation mode)
7INTC11Generation of TM1-CR11 match signal
(in 8-bit operation mode)
Generation of TM1W-CR11W match signal
(in 16-bit operation mode)
8INTC20Generation of TM2-CR20 match signal
(in 8-bit operation mode)
Generation of TM2W-CR20W match signal
(in 16-bit operation mode)
9INTC21Generation of TM2-CR21 match signal
(in 8-bit operation mode)
Generation of TM2W-CR21W match signal
(in 16-bit operation mode)
10INTC30Generation of TM3-CR30 match signal
(in 8-bit operation mode)
Generation of TM3W-CR30W match signal
(in 16-bit operation mode)
11INTP4Detection of pin input edgeExternal√
12INTP5Detection of pin input edge
13INTADEnd of A/D conversion (transfer of ADCR)Internal√
14INTSEROccurrence of ASI0 reception error–
15INTSREnd of ASI0 reception or CSI1 transfer√
INTCSI1
16INTSTEnd of ASI0 transfer
17INTCSIEnd of CSI1 transfer
18INTSER2Occurrence of ASI2 reception error–
19INTSR2End of ASI2 reception or CSI2 transfer√
INTCSI2
20INTST2End of ASI2 transfer
21 (lowest) INTSPCI2C bus stop condition interrupt
Macro Service
Remark ASI: asynchronous serial interface
CSI: clocked serial interface
42
Page 43
µ
PD784031Y
8.2 Vectored Interrupt
Execution branches to a servicing routing by using the memory contents of a vector table address corresponding to
the interrupt source as the address of the branch destination.
So that the CPU performs interrupt servicing, the following operations are performed:
• On branching : Saves the status of the CPU (contents of PC and PSW) to stack
• On returning : Restores the status of the CPU (contents of PC and PSW) from stack
To return to the main routine from an interrupt service routine, the RETI instruction is used.
The branch destination address is in a range of 0 to FFFFH.
When an interrupt request is generated or when the BRKCS instruction is executed, a predetermined register bank is
selected by hardware. Context switching is a function that branches execution to a vector address stored in advance in
the register bank, and to stack the current contents of the program counter (PC) and program status word (PSW) to the
register bank.
The branch address is in a range of 0 to FFFFH.
Figure 8-1. Context Switching Operation when Interrupt Request is Generated
0000B
<7> Transfer
PC19 to 16
<2> Save
(bits 8 through 11
of temporary register)
Temporary register
<1> Save
PSW
PC15 to 0
<6> Exchange
<5> Save
Register bank n (n = 0 to 7)
A
B
R5
R7
V
U
T
W
VP
UP
D
H
X
C
R4
R6
<3> Switching of register bank
E
L
(RBS0 to RBS2 ← n)
<4> RSS ← 0
IE←0
Register bank n
(0 to 7)
8.4 Macro Service
This function is to transfer data between memory and a special function register (SFR) without intervention by the CPU.
A macro service controller accesses the memory and SFR in the same transfer cycle and directly transfers data without
loading it.
Because this function does not save or restore the status of the CPU, or load data, data can be transferred at high
speeds.
44
CPU
Internal bus
Figure 8-2. Macro Service
Read
MemorySFR
Write
Macro service
controller
Write
Read
Page 45
8.5 Application Example of Macro Service
(1) Transfer of serial interface
Transfer data storage buffer (memory)
Data n
Data n – 1
Data 2
Data 1
Internal bus
µ
PD784031Y
TxD
Transfer shift register
Transfer controlINTST
TXS (SFR)
Each time macro service request INTST is generated, the next transfer data is transferred from memory to TXS. When
data n (last byte) has been transferred to TXS (when the transfer data storage buffer has become empty), vectored interrupt
request INTST is generated.
(2) Reception of serial interface
Receive data storage buffer (memory)
Data n
Data n – 1
Data 2
Data 1
Internal bus
RXB (SFR)
INTSR
RxD
Receive buffer
Receive shift register
Reception control
Each time macro service request INTSR is generated, the receive data is transferred from RXB to memory. When data
n (last byte) has been transferred to memory (when the receive data storage buffer has become full), vectored interrupt
request INTSR is generated.
45
Page 46
µ
(3) Real-time output port
INTC10 and INTC11 serve as the output triggers of the real-time output port. The macro services for these can
set the following output pattern and intervals simultaneously. Therefore, INTC10 and INTC11 can control two
stepping motors independently of each other. They can also be used for PWM output or to control DC motors.
PD784031Y
Output timing profile (memory)
Internal bus
Match
CR10
INTC10
T
Tn– 1
T2
T1
TM1
n
(SFR)
P00 to P03
Output pattern profile (memory)
n
P
Pn– 1
P2
P1
Internal bus
(SFR)
P0L
Output latch
Each time macro service request INTC10 is generated, the pattern and timing are transferred to the buffer register (P0L)
and compare register (CR10), respectively. When the contents of the timer register 1 (TM1) coincide with those of CR10,
INTC10 is generated again, and the contents of P0L are transferred to the output latch. When Tn (last byte) has transferred
to CR10, vectored interrupt request INTC10 is generated.
The same applies to INTC11.
46
Page 47
µ
PD784031Y
9. LOCAL BUS INTERFACE
The local bus interface can connect an external memory or I/O (memory mapped I/O) and support a memory space
of 1 Mbytes (refer to Figure 9-1).
Figure 9-1. Example of Local Bus Interface
PD784031Y
µ
A16 to A19
Decoder
RD
WR
REFRQ
AD0 to AD7
ASTB
A8 to A15
Latch
Pseudo SRAM
PD27C1001A
µ
Data bus
Address bus
Gate array
I/O expansion
Centronics I/F, etc.
PROM
Character
generator
µ
PD24C1000
9.1 Memory Expansion
The memory capacity can be expanded in seven steps, from 256 bytes to 1 Mbytes, by connecting an external program
memory and data memory.
47
Page 48
µ
PD784031Y
9.2 Memory Space
The 1-Mbyte memory space is divided into eight spaces of logical addresses. Each space can be controlled by using
the programmable wait function and pseudo static RAM refresh function.
Figure 9-2. Memory Space
HFFFFF
512 Kbytes
H00008
HFFFF7
256 Kbytes
H00004
HFFFF3
128 Kbytes
H00002
HFFFF1
64 Kbytes
H00001
HFFFF0
16 Kbytes
H000C0
HFFFB0
16 Kbytes
H00080
HFFF70
16 Kbytes
H00040
HFFF30
16 Kbytes
H00000
48
Page 49
µ
PD784031Y
9.3 Programmable Wait
The memory space can be divided into eight spaces and wait states can be independently inserted in each of these
spaces while the RD and WR signals are active. Even when a memory with a different access time is connected, therefore,
the efficiency of the entire system does not drop.
In addition, an address wait function that extends the active period of the ASTB signal is also provided so as to have
a sufficient address decode time (this function can be set to the entire space).
9.4 Pseudo Static RAM Refresh Function
The following refresh operations can be performed:
• Pulse refresh: A bus cycle that outputs a refresh pulse to the REFRQ pin at a fixed cycle is inserted. The
memory spaces is divided into eight spaces, and a refresh pulse can be output from the
REFRQ pin while a specified memory space is accessed. Therefore, the normal memory
access is not kept to wait by the refresh cycle.
• Power-down self-refresh : The low level is output to the REFRQ pin in the standby mode to retain the contents of the
pseudo static RAM.
9.5 Bus Hold Function
A bus hold function is provided to facilitate connection of a DMA controller. When a bus hold request signal (HLDRQ)
is received from an external bus master, the address bus, address/data bus, and ASTB, RD, and WR pins go into a highimpedance state when the current bus cycle has been completed. This makes the bus hold acknowledge (HLDAK) signal
active, and releases the bus to the external bus master.
Note that, while the bus hold function is used, the external wait function and pseudo static RAM refresh function cannot
be used.
49
Page 50
µ
PD784031Y
10. STANDBY FUNCTION
This function is to reduce the power dissipation of the chip, and can be used in the following modes:
• HALT mode : Stops supply of the operating clock to the CPU. This mode is used in combination with the normal
operation mode for intermittent operation to reduce the average power dissipation.
• IDLE mode : Stops the entire system with the oscillation circuit continuing operation. The power dissipation in this
mode is close to that in the STOP mode. However, the time required to restore the normal program
operation from this mode is almost the same as that from the HALT mode.
• STOP mode: Stops the oscillator and thereby to stop all the internal operations of the chip. Consequently, the power
dissipation is minimized with only leakage current flowing.
These modes are programmable.
The macro service can be started from the HALT mode.
Figure 10-1. Transition of Standby Status
Macro service request
End of one processing
End of macro service
Interrupt request
RESET input
Sets HALT mode
Note 2
HALT
(standby)
Macro
service
Macro service request
End of one processing
NMI, INTP4, INTP5 input
STOP
(standby)
Waits for
oscillation
stabilization
Note 1
Sets STOP mode
RESET input
(standby)
Oscillation stabilization
time expires
Sets IDLE mode
RESET input
NMI, INTP4, INTP5 input
IDLE
Program
operation
Note 1
Interrupt request of
masked interrupt
Notes 1. When INTP4 and INTP5 are not masked
2. Only interrupt requests that are not masked
Remark Only the externally input NMI is valid. The watchdog timer cannot be used to release the standby mode (STOP/
IDLE mode).
50
Page 51
µ
PD784031Y
11. RESET FUNCTION
When the low level is input to the RESET pin, the internal hardware is initialized (reset status).
When the RESET pin goes high, the following data are set to the program counter (PC).
• Lower 8 bits of PC : contents of address 0000H
• Middle 8 bits of PC : contents of address 0001H
• Higher 4 bits of PC : 0
Program execution is started from a branch destination address which is the contents of the PC. Therefore, the system
can be reset and started from any address.
Set the contents of each register by program as necessary.
The RESET input circuit has a noise reduction circuit to prevent malfunctioning due to noise. This noise reduction circuit
is a sampling circuit by analog delay.
Figure 11-1. Accepting Reset Signal
Executes instruction at
reset start address
RESET
(input)
Internal reset signal
Delay
Delay
Reset startsReset ends
DelayInitialize PC
Assert the RESET signal active until the oscillation stabilization time (approx. 40 ms) elapses to execute a power-ON
reset operation.
Figure 11-2. Power-ON Reset Operation
Oscillation stabilization timeDelayInitialize PC
V
DD
Executes instruction at
reset start address
RESET
(input)
Internal reset signal
Reset ends
51
Page 52
12. INSTRUCTION SET
(1) 8-bit instructions (The instructions in parentheses are combinations realized by describing A as r)
Note The operands of BNZ, BNE, BZ, BE, BNC, BNL, BL, BNV, BPO, BV, BPE, BP, BN, BLT, BGE, BLE, BGT, BNH,
and BH are the same as BC.
(6) Other instructions
ADJBA, ADJBS, CVTBW, LOCATION, SEL, NOT, EI, DI, SWRS
56
Page 57
µ
PD784031Y
13. ELECTRICAL SPECIFICATIONS
Absolute Maximum Ratings (TA = 25°C)
ParameterSymbolTest ConditionsRatingsUnit
Supply voltageVDD–0.5 to +7.0V
AVDDAVSS to VDD + 0.5V
AVSS–0.5 to +0.5V
Input voltageVI–0.5 to VDD + 0.5V
Output voltageVO–0.5 to VDD + 0.5V
Output current low-levelIOL1 pin15mA
Total of output pins100mA
Output current high-levelIOH1 pin–10mA
Total of output pins–100mA
Reference input voltageAVREF1–0.5 to VDD + 0.3V
to A/D converter
Reference input voltageAVREF2–0.5 to VDD + 0.3V
to D/A converter
Operating ambientTA–40 to +85°C
temperature
Storage temperatureTstg–65 to +150°C
AVREF3–0.5 to VDD + 0.3V
CautionThe product quality may be damaged even if a value of only one of the above parameters exceeds the
absolute maximum rating or any value exceeds the absolute maximum rating for an instant. That is,
the absolute maximum rating is a rating value which may cause a product to be damaged physically.
The absolute maximum rating values must therefore be observed in using the product.
57
Page 58
Operating Condition
• Operating ambient temperature (TA) : –40 to +85°C
• Rise, fall time (t
r, tf) (unspecified pins) : 0 to 200
• Supply voltage and clock cycle time : refer to Figure 13-1
MIN.MAX.MIN.MAX.
SCL clock frequencyfSCL01000400kHz
Low status hold time of SCLtLOW4.71.3
clock
High status hold time of SCLtHIGH4.00.6
clock
Data hold timetHD ; DAT300300900ns
Data setup timetSU ; DAT250100ns
SDA, SCL signal rise timetR100020 + 0.1Cb300ns
SDA, SCL signal fall timetF30020 + 0.1Cb300ns
Load capacitance of each bus line
Cb400400pF
µ
s
µ
s
66
Page 67
µ
PD784031Y
(3) IOE1, IOE2
ParameterSymbolTest ConditionsMIN.MAX.Unit
Serial clock cycle timetCYSK1InputVDD = +5.0 V ± 10 %250ns
(SCK1, SCK2)500ns
Output Internal 16 frequency divisionTns
Serial clock low-level widthtWSKL1InputVDD = +5.0 V ± 10 %85ns
(SCK1, SCK2)210ns
Output Internal 16 frequency division0.5T – 40ns
Serial clock high-level widthtWSKH1InputVDD = +5.0 V ± 10 %85ns
(SCK1, SCK2)210ns
Remark Dimensions and materials of ES products are the same as those of mass-produced products.
77
Page 78
80 PIN PLASTIC QFP (14×14)
µ
PD784031Y
A
B
4160
4061
detail of lead end
2180
201
F
G
H
M
I
P
N
NOTE
Each lead centerline is located within 0.13 mm (0.005 inch) of
its true position (T.P.) at maximum material condition.
C D
S
R
Q
J
K
M
L
ITEM MILLIMETERSINCHES
A17.20±0.200.677±0.008
+0.009
B14.00±0.200.551
C14.00±0.200.551
D17.20±0.200.677±0.008
F0.8250.032
G0.8250.032
H0.32±0.060.013
I0.130.005
J0.65 (T.P.)0.026 (T.P.)
K1.60±0.200.063±0.008
L0.80±0.200.031
+7°
–3°
+0.03
–0.07
M0.170.007
N0.100.004
P1.40±0.100.055±0.004
Q0.125±0.0750.005±0.003
R3°3°
S1.70 MAX.0.067 MAX.
+0.009
–0.008
–0.008
+0.009
–0.008
+0.002
–0.003
+0.009
–0.008
+0.001
–0.003
+7°
–3°
P80GC-65-8BT
Remark Dimensions and materials of ES products are the same as those of mass-produced products.
78
Page 79
80-PIN PLASTIC TQFP (FINE PITCH) (12 × 12 mm)
A
B
µ
PD784031Y
60
61
F
80
1
G
H
M
I
41
40
21
20
J
K
P
N
L
NOTE
Each lead centerline is located within 0.10 mm (0.004 inch) of
its true position (T.P.) at maximum material condition.
detail of lead end
C
S
D
Q
R
M
ITEM MILLIMETERSINCHES
A14.0±0.20.551
B12.0±0.20.472
C12.0±0.20.472
D14.0±0.20.551
F
1.25
G1.25
0.10
+0.05
–0.04
+0.055
–0.045
H0.220.009±0.002
I
J0.5 (T.P.)
K1.0±0.20.039
L0.5±0.20.020
M0.1450.006±0.002
N0.100.004
P1.050.041
Q0.05±0.05
R5°±5°5°±5°
S1.27 MAX.0.050 MAX.
+0.009
–0.008
+0.009
–0.008
+0.009
–0.008
+0.009
–0.008
0.049
0.049
0.004
0.020 (T.P.)
+0.009
–0.008
+0.008
–0.009
0.002±0.002
P80GK-50-BE9-4
Remark Dimensions and materials of ES products are the same as those of mass-produced products.
79
Page 80
µ
PD784031Y
15. RECOMMENDED SOLDERING CONDITIONS
This product should be soldered and mounted under the conditions recommended in the table below.
For details of recommended soldering conditions, refer to the information document Semiconductor Device Mounting
Technology Manual (C10535E).
For soldering methods and conditions other than those recommended below, contact an NEC sales representative.
Table 15-1. Surface Mounting Type Soldering Conditions (1/2)
Infrared reflowPackage peak temperature: 235°C, Duration: 30 sec. max. (at 210°C or above),IR35-107-2
Number of times: Twice max., Time limit: 7 days
required at 125°C)
<precaution>
Do not bake devices by packing them in non-heat resistant trays or packing materials
such as magazine cases and tapes. Use heat-resistant trays.
VPSPackage peak temperature: 215°C, Duration: 40 sec. (at 200°C or above),VP15-107-2
Number of times: Twice max., Time limit: 7 days
required at 125°C)
<precaution>
Do not bake devices by packing them in non-heat resistant trays or packing materials
such as magazine cases and tapes. Use heat-resistant trays.
Note For the storage period after dry-pack decapsulation, storage conditions are max. 25°C, 65 % RH.
CautionUse of more than one soldering method should be avoided (except in the case of partial heating).
81
Page 82
APPENDIX A. DEVELOPMENT TOOLS
The following development tools are available for supporting development of a system using the µPD784031Y.
Language Processor Software
RA78K4
CC78K4
CC78K4-L
PG-1500PROM programmer
PA-78P4026GCProgrammer adapter connected to PG-1500
PA-78P4038GK
PA-78P4026KK
PG-1500 controller
Note 1
Note 1
Note 1
PROM Writing Tool
Note 2
Assembler package common to 78K/IV Series
C compiler package common to 78K/IV Series
C compiler library source file common to 78K/IV Series
PG-1500 control program
µ
PD784031Y
Debugging Tool
IE-784000-RIn-circuit emulator common to 78K/IV Subseries
IE-784000-R-BKBreak board common to 78K/IV Series
IE-784038-R-EM1Emulation board for evaluation of
µ
PD784038Y Subseries
IE-784000-R-EM
IE-70000-98-IF-BInterface adapter when PC-9800 Series (except notebook type) is used as host machine
IE-70000-98N-IFInterface adapter and cable when notebook type PC-9800 Series is used as host
machine
IE-70000-PC-IF-BInterface adapter when IBM PC/ATTM is used as host machine
IE-78000-R-SV3Interface adapter and cable when EWS is used as host machine
EP-78230GC-REmulation probe for 80-pin plastic QFP (GC-3B9 and GC-8BT types) common to
µ
PD784038Y Subseries
EP-78054GK-REmulation probe for 80-pin plastic TQFP (fine pitch) (GK-BE9 type) common to
µ
PD784038Y Subseries
EV-9200GC-80Socket mounted on board of target system created for 80-pin plastic QFP (GC-3B9 and
GC-8BT types)
TGK-080SDWAdapter mounted on board of target system created for 80-pin plastic TQFP (fine pitch)
(GK-BE9 type)
EV-9900Jig used to remove µPD78P4038YKK-T from EV-9200GC-80
SM78K4
ID78K4
DF784038
Note 3
Note 3
Note 4
System simulator common to 78K/IV Series
Integrated debugger for IE-784000-R
Device file for µPD784038Y Subseries
Real-time OS
RX78K/IV
MX78K4
82
Note 4
Note 2
Real-time OS for 78K/IV Series
OS for 78K/IV Series
Page 83
Notes 1. • PC-9800 Series (MS-DOSTM) based
• IBM PC/AT and compatible machine (PC DOSTM, WindowsTM, MS-DOS, IBM DOSTM) based
TM
• HP9000 Series 700
• SPARCstationTM (SunOSTM) based
• NEWSTM (NEWS-OSTM) based
2. • PC-9800 Series (MS-DOS) based
• IBM PC/AT and compatible machine (PC DOS, Windows, MS-DOS, IBM DOS) based
3. • PC-9800 Series (MS-DOS + Windows) based
• IBM PC/AT and compatible machine (PC DOS, Windows, MS-DOS, IBM DOS) based
• HP9000 Series 700 (HP-UX) based
• SPARCstation (SunOS) based
4. • PC-9800 Series (MS-DOS) based
• IBM PC/AT and compatible machine (PC DOS, Windows, MS-DOS, IBM DOS) based
• HP9000 Series 700 (HP-UX) based
• SPARCstation (SunOS) based
Remarks 1. RA78K4, CC78K4, SM78K4, and ID78K4 are used in combination with DF784038.
2. TGK-080SDW is manufactured by TOKYO ELETECH Corporation. Consult your local NEC sales
representative when purchasing it.
(HP-UXTM) based
µ
PD784031Y
83
Page 84
µ
APPENDIX B. RELATED DOCUMENTS
Documents Related to Device
Document NameDocument No.
EnglishJapanese
µ
PD784031Y Data SheetThis manualU11504J
µ
PD784035Y, 784036Y, 784037Y, 784038Y Data SheetU10741EU10741J
PD784038Y Subseries Special Function Register Table–U11091J
78K/IV Series User’s Manual - InstructionU10905EU10905J
78K/IV Series Instruction Table–U10594J
78K/IV Series Instruction Set–U10595J
78K/IV Series Application Note - Software Basics–U10095J
PD784031Y
Documents Related to Development Tools (User’s Manuals)
Document NameDocument No.
EnglishJapanese
RA78K4 Assembler PackageOperationU11334EU11334J
Language–U11162J
RA78K Series Structured Assembler PreprocessorEEU-1402EEU-817
CC78K4 SeriesOperation–EEU-960
Language–EEU-961
CC78K Series Library Source File–U12322J
PG-1500 PROM ProgrammerEEU-1335U11940J
PG-1500 Controller - PC-9800 Series (MS-DOS) BasedEEU-1291EEU-704
PG-1500 Controller - IBM PC Series (PC DOS) BasedU10540EEEU-5008
IE-784000-REEU-1534EEU-5004
IE-784038-R-EM1U11383EU11383J
EP-78230EEU-1515EEU-985
EP-78054GK-REEU-1468EEU-932
SM78K4 System Simulator - Windows BasedReferenceU10093EU10093J
SM78K Series External Part User Open Interface SpecificationsU10092EU10092J
ID78K4 Integrated Debugger - Windows BasedReferenceU10440EU10440J
ID78K4 Integrated Debugger
- HP9000 Series 700 (HP-UX) Based
ReferenceTo be released soonU11960J
CautionThe above related documents are subject to change without prior notice. Be sure to use the latest
version when starting design.
84
Page 85
µ
PD784031Y
Documents Related to Embedded Software (User’s Manual)
Document NameDocument No.
EnglishJapanese
78K/IV Series Real-time OSBasicsU10603EU10603J
InstallationU10604EU10604J
Debugger–U10364J
78K/IV Series OS MX78K4Basics–U11779J
Other Documents
Document NameDocument No.
EnglishJapanese
IC Package ManualC10943X
Semiconductor Device Mounting Technology ManualC10535EC10535J
Quality Grades on NEC Semiconductor DevicesC11531EC11531J
Reliability Quality Control on NEC Semiconductor DeviceC10983EC10983J
Electric Static Discharge (ESD) Test–MEM-539
Semiconductor Devices Quality Assurance GuideMEI-1202C11893J
Microcomputer Product Series Guide–U11416J
CautionThe above related documents are subject to change without prior notice. Be sure to use the latest
version when starting design.
85
Page 86
NOTES FOR CMOS DEVICES
1PRECAUTION AGAINST ESD FOR SEMICONDUCTORS
Note: Strong electric field, when exposed to a MOS device, can cause destruction of
the gate oxide and ultimately degrade the device operation. Steps must be
taken to stop generation of static electricity as much as possible, and quickly
dissipate it once, when it has occurred. Environmental control must be
adequate. When it is dry, humidifier should be used. It is recommended to avoid
using insulators that easily build static electricity. Semiconductor devices
must be stored and transported in an anti-static container, static shielding bag
or conductive material. All test and measurement tools including work bench
and floor should be grounded. The operator should be grounded using wrist
strap. Semiconductor devices must not be touched with bare hands. Similar
precautions need to be taken for PW boards with semiconductor devices on it.
µ
PD784031Y
2HANDLING OF UNUSED INPUT PINS FOR CMOS
Note: No connection for CMOS device inputs can be cause of malfunction. If no
connection is provided to the input pins, it is possible that an internal input level
may be generated due to noise, etc., hence causing malfunction. CMOS device
behave differently than Bipolar or NMOS devices. Input levels of CMOS devices
must be fixed high or low by using a pull-up or pull-down circuitry. Each unused
pin should be connected to VDD or GND with a resistor, if it is considered to have
a possibility of being an output pin. All handling related to the unused pins must
be judged device by device and related specifications governing the devices.
3STATUS BEFORE INITIALIZATION OF MOS DEVICES
Note: Power-on does not necessarily define initial status of MOS device. Production
process of MOS does not define the initial operation status of the device.
Immediately after the power source is turned ON, the devices with reset
function have not yet been initialized. Hence, power-on does not guarantee outpin levels, I/O settings or contents of registers. Device is not initialized until the
reset signal is received. Reset operation must be executed immediately after
power-on for devices having reset function.
86
Page 87
µ
PD784031Y
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC
product in your application, please contact the NEC office in your country to obtain a list of authorized
representatives and distributors. They will verify:
• Device availability
• Ordering information
• Product release schedule
• Availability of related technical literature
• Development environment specifications (for example, specifications for third-party tools and components,
host computers, power plugs, AC supply voltages, and so forth)
• Network requirements
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from
country to country.
NEC Electronics Inc. (U.S.)
Santa Clara, California
Tel: 800-366-9782
Fax: 800-729-9288
United Square, Singapore 1130
Tel:253-8311
Fax: 250-3583
NEC Electronics Taiwan Ltd.
Taipei, Taiwan
Tel: 02-719-2377
Fax: 02-719-5951
NEC do Brasil S.A.
Sao Paulo-SP, Brasil
Tel: 011-889-1680
Fax: 011-889-1689
J96. 8
87
Page 88
µ
PD784031Y
CautionPurchase of NEC I2C components conveys a license under the Philips I2C Patent Rights to use
these components in an I
Specification as defined by Philips.
EEPROM and IEBus are trademarks of NEC Corporation.
MS-DOS and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries.
IBM DOS, PC/AT, and PC DOS are trademarks of International Business Machines Corporation.
HP9000 Series 700 and HP-UX are trademarks of Hewlett-Packard Company.
SPARCstation is a trademark of SPARC International, Inc.
SunOS is a trademark of Sun Microsystems, Inc.
NEWS and NEWS-OS are trademarks of Sony Corporation.
The related documents indicated in this publication may include preliminary versions. However, preliminary versions
are not marked as such.
2
C system, provided that the system conforms to the I2C Standard
No part of this document may be copied or reproduced in any form or by any means without the prior written consent
of NEC Corporation. NEC Corporation assumes no responsibility for any errors which may appear in this document.
NEC Corporation does not assume any liability for infringement of patents, copyrights or other intellectual property
rights of third parties by or arising from use of a device described herein or any other liability arising from use of
such device. No license, either express, implied or otherwise, is granted under any patents, copyrights or other
intellectual property rights of NEC Corporation or others.
While NEC Corporation has been making continuous effort to enhance the reliability of its semiconductor devices,
the possibility of defects cannot be eliminated entirely. To minimize risks of damage or injury to persons or property
arising from a defect in an NEC semiconductor device, customers must incorporate sufficient safety measures in
its design, such as redundancy, fire-containment, and anti-failure features.
NEC devices are classified into the following three quality grades:
“Standard”, “Special”, and “Specific”. The Specific quality grade applies only to devices developed based on a
customer designated “quality assurance program” for a specific application. The recommended applications of a
device depend on its quality grade, as indicated below. Customers must check the quality grade of each device
before using it in a particular application.
Standard: Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment and
industrial robots
Special:Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for
life support)
Specific: Aircrafts, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support
systems or medical equipment for life support, etc.
The quality grade of NEC devices is “Standard” unless otherwise specified in NEC’s Data Sheets or Data Books.
If customers intend to use NEC devices for applications other than those specified for Standard quality grade, they
should contact an NEC sales representative in advance.
Anti-radioactive design is not implemented in this product.
M4 96.5
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.