User ManualTable of ContentsCOVER1Major Revisions in This Edition6INTRODUCTION7CHAPTER 1 GENERAL211.1 Features211.2 Applications211.3 Ordering Information211.4 Pin Configuration (Top View)221.5 78K/0S Series Lineup231.6 Block Diagram261.7 Functions27CHAPTER 2 PIN FUNCTIONS282.1 List of Pin Functions282.2 Pin Functions302.2.1 P00 to P07 (Port 0)302.2.2 P10 to P17 (Port 1)302.2.3 P20 to P26 (Port 2)302.2.4 P40 to P47 (Port 4)312.2.5 RESET#312.2.6 X1, X2312.2.7 REGC312.2.8 USBDM312.2.9 USBDP312.2.10 VDD0, VDD1312.2.11 VSS0, VSS1312.2.12 VPP (uPD78F9801 only)322.2.13 IC (mask ROM version only)322.3 Pin I/O Circuits and Recommended Connection of Unused Pins33CHAPTER 3 CPU ARCHITECTURE353.1 Memory Space353.1.1 Internal program memory space373.1.2 Internal data memory (internal high-speed RAM) space373.1.3 Special function register (SFR) area373.1.4 Data memory addressing383.2 Processor Registers403.2.1 Control registers403.2.2 General-purpose registers433.2.3 Special function registers (SFRs)443.3 Instruction Address Addressing483.3.1 Relative addressing483.3.2 Immediate addressing493.3.3 Table indirect addressing503.3.4 Register addressing503.4 Operand Address Addressing513.4.1 Direct addressing513.4.2 Short direct addressing523.4.3 Special function register (SFR) addressing533.4.4 Register addressing543.4.5 Register indirect addressing553.4.6 Based addressing563.4.7 Stack addressing56CHAPTER 4 PORT FUNCTIONS574.1 Port Functions574.2 Port Configuration594.2.1 Port 0604.2.2 Port 1614.2.3 Port 2624.2.4 Port 4684.3 Registers Controlling Port Function694.4 Port Function Operation724.4.1 Writing to I/O port724.4.2 Reading from I/O port724.4.3 Arithmetic operation of I/O port72CHAPTER 5 CLOCK GENERATOR735.1 Clock Generator Functions735.2 Clock Generator Configuration735.3 Register Controlling Clock Generator745.4 System Clock Oscillators755.4.1 System clock oscillator755.4.2 Examples of incorrect resonator connection765.4.3 Frequency divider775.5 Clock Generator Operation775.6 Changing Setting of CPU Clock785.6.1 Time required for switching CPU clock785.6.2 Switching CPU clock78CHAPTER 6 8-BIT TIMER/EVENT COUNTERS 00 AND 01796.1 Functions of 8-Bit Timer/Event Counters 00 and 01796.2 Configuration of 8-Bit Timer/Event Counters 00 and 01806.3 Registers Controlling 8-Bit Timer/Event Counters 00 and 01826.4 Operation of 8-Bit Timer/Event Counters 00 and 01856.4.1 Operation as interval timer856.4.2 Operation as external event counter (timer 01 only)876.4.3 Operation as square-wave output (timer 01 only)886.5 Notes on Using 8-Bit Timer/Event Counters 00 and 0190CHAPTER 7 WATCHDOG TIMER917.1 Watchdog Timer Functions917.2 Watchdog Timer Configuration927.3 Registers Controlling Watchdog Timer937.4 Watchdog Timer Operation957.4.1 Operation as watchdog timer957.4.2 Operation as interval timer96CHAPTER 8 USB FUNCTION978.1 USB Overview978.2 USB Function Features988.3 USB Function Configuration988.4 Registers Controlling USB Function1098.5 USB Function Operation1228.5.1 USB timer operation1228.5.2 Remote wakeup control operation1258.6 Interrupt Request from USB Function1278.6.1 Interrupt sources1278.6.2 Cautions when using interrupts1298.7 USB Function Control1308.7.1 Relationship between packets and operation modes1308.7.2 Interrupt servicing flow1368.8 USB Function Internal Circuit Operations1408.8.1 Operation of transmit/receive pointer1408.8.2 Receive bank switching ID detection buffer operation1478.8.3 Sync detection/USBCLK detector operation1488.8.4 NRZI encoder operation1508.8.5 Bit stuffing/strip controller operation151CHAPTER 9 SERIAL INTERFACE 101549.1 Functions of Serial Interface 101549.2 Configuration of Serial Interface 101559.3 Register Controlling Serial Interface 101579.4 Operation of Serial Interface 101599.4.1 Operation stop mode1599.4.2 3-wire serial I/O mode160CHAPTER 10 REGULATOR162CHAPTER 11 INTERRUPT FUNCTIONS16311.1 Interrupt Function Types16311.2 Interrupt Sources and Configuration16311.3 Registers Controlling Interrupt Function16611.4 Interrupt Servicing Operation17111.4.1 Non-maskable interrupt acknowledgment operation17111.4.2 Maskable interrupt acknowledgment operation17311.4.3 Multiplexed interrupt servicing17511.4.4 Interrupt request hold177CHAPTER 12 STANDBY FUNCTION17812.1 Standby Function and Configuration17812.1.1 Standby function17812.1.2 Register controlling standby function17912.2 Standby Function Operation18012.2.1 HALT mode18012.2.2 STOP mode183CHAPTER 13 RESET FUNCTION186CHAPTER 14 uPD78F980119014.1 Flash Memory Characteristics19114.1.1 Programming environment19114.1.2 Communication mode19214.1.3 On-board pin processing19514.1.4 Connection of adapter for flash writing198CHAPTER 15 INSTRUCTION SET20015.1 Operation20015.1.1 Operand identifiers and description methods20015.1.2 Description of “operation” column20115.1.3 Description of “flag operation” column20115.2 Operation List20215.3 Instructions Listed by Addressing Type207CHAPTER 16 ELECTRICAL SPECIFICATIONS210CHAPTER 17 PACKAGE DRAWINGS219CHAPTER 18 RECOMMENDED SOLDERING CONDITIONS220A.1 Software Package223A.2 Language Processing Software223A.3 Control Software224A.4 Flash Memory Writing Tools224A.5 Debugging Tools (Hardware)225A.6 Debugging Tools (Software)226A.7 Notes on Target System Design227APPENDIX A DEVELOPMENT TOOLS221APPENDIX B REGISTER INDEX229B.1 Register Index (Alphabetic Order of Register Name)229B.2 Register Index (Alphabetic Order of Register Symbol)231APPENDIX C REVISION HISTORY233Size: 1.83 MBPages: 234Language: EnglishOpen manual
User ManualTable of ContentsCOVER1Major Revisions in This Edition6INTRODUCTION7CHAPTER 1 GENERAL211.1 Features211.2 Applications211.3 Ordering Information211.4 Pin Configuration (Top View)221.5 78K/0S Series Lineup231.6 Block Diagram261.7 Functions27CHAPTER 2 PIN FUNCTIONS282.1 List of Pin Functions282.2 Pin Functions302.2.1 P00 to P07 (Port 0)302.2.2 P10 to P17 (Port 1)302.2.3 P20 to P26 (Port 2)302.2.4 P40 to P47 (Port 4)312.2.5 RESET#312.2.6 X1, X2312.2.7 REGC312.2.8 USBDM312.2.9 USBDP312.2.10 VDD0, VDD1312.2.11 VSS0, VSS1312.2.12 VPP (uPD78F9801 only)322.2.13 IC (mask ROM version only)322.3 Pin I/O Circuits and Recommended Connection of Unused Pins33CHAPTER 3 CPU ARCHITECTURE353.1 Memory Space353.1.1 Internal program memory space373.1.2 Internal data memory (internal high-speed RAM) space373.1.3 Special function register (SFR) area373.1.4 Data memory addressing383.2 Processor Registers403.2.1 Control registers403.2.2 General-purpose registers433.2.3 Special function registers (SFRs)443.3 Instruction Address Addressing483.3.1 Relative addressing483.3.2 Immediate addressing493.3.3 Table indirect addressing503.3.4 Register addressing503.4 Operand Address Addressing513.4.1 Direct addressing513.4.2 Short direct addressing523.4.3 Special function register (SFR) addressing533.4.4 Register addressing543.4.5 Register indirect addressing553.4.6 Based addressing563.4.7 Stack addressing56CHAPTER 4 PORT FUNCTIONS574.1 Port Functions574.2 Port Configuration594.2.1 Port 0604.2.2 Port 1614.2.3 Port 2624.2.4 Port 4684.3 Registers Controlling Port Function694.4 Port Function Operation724.4.1 Writing to I/O port724.4.2 Reading from I/O port724.4.3 Arithmetic operation of I/O port72CHAPTER 5 CLOCK GENERATOR735.1 Clock Generator Functions735.2 Clock Generator Configuration735.3 Register Controlling Clock Generator745.4 System Clock Oscillators755.4.1 System clock oscillator755.4.2 Examples of incorrect resonator connection765.4.3 Frequency divider775.5 Clock Generator Operation775.6 Changing Setting of CPU Clock785.6.1 Time required for switching CPU clock785.6.2 Switching CPU clock78CHAPTER 6 8-BIT TIMER/EVENT COUNTERS 00 AND 01796.1 Functions of 8-Bit Timer/Event Counters 00 and 01796.2 Configuration of 8-Bit Timer/Event Counters 00 and 01806.3 Registers Controlling 8-Bit Timer/Event Counters 00 and 01826.4 Operation of 8-Bit Timer/Event Counters 00 and 01856.4.1 Operation as interval timer856.4.2 Operation as external event counter (timer 01 only)876.4.3 Operation as square-wave output (timer 01 only)886.5 Notes on Using 8-Bit Timer/Event Counters 00 and 0190CHAPTER 7 WATCHDOG TIMER917.1 Watchdog Timer Functions917.2 Watchdog Timer Configuration927.3 Registers Controlling Watchdog Timer937.4 Watchdog Timer Operation957.4.1 Operation as watchdog timer957.4.2 Operation as interval timer96CHAPTER 8 USB FUNCTION978.1 USB Overview978.2 USB Function Features988.3 USB Function Configuration988.4 Registers Controlling USB Function1098.5 USB Function Operation1228.5.1 USB timer operation1228.5.2 Remote wakeup control operation1258.6 Interrupt Request from USB Function1278.6.1 Interrupt sources1278.6.2 Cautions when using interrupts1298.7 USB Function Control1308.7.1 Relationship between packets and operation modes1308.7.2 Interrupt servicing flow1368.8 USB Function Internal Circuit Operations1408.8.1 Operation of transmit/receive pointer1408.8.2 Receive bank switching ID detection buffer operation1478.8.3 Sync detection/USBCLK detector operation1488.8.4 NRZI encoder operation1508.8.5 Bit stuffing/strip controller operation151CHAPTER 9 SERIAL INTERFACE 101549.1 Functions of Serial Interface 101549.2 Configuration of Serial Interface 101559.3 Register Controlling Serial Interface 101579.4 Operation of Serial Interface 101599.4.1 Operation stop mode1599.4.2 3-wire serial I/O mode160CHAPTER 10 REGULATOR162CHAPTER 11 INTERRUPT FUNCTIONS16311.1 Interrupt Function Types16311.2 Interrupt Sources and Configuration16311.3 Registers Controlling Interrupt Function16611.4 Interrupt Servicing Operation17111.4.1 Non-maskable interrupt acknowledgment operation17111.4.2 Maskable interrupt acknowledgment operation17311.4.3 Multiplexed interrupt servicing17511.4.4 Interrupt request hold177CHAPTER 12 STANDBY FUNCTION17812.1 Standby Function and Configuration17812.1.1 Standby function17812.1.2 Register controlling standby function17912.2 Standby Function Operation18012.2.1 HALT mode18012.2.2 STOP mode183CHAPTER 13 RESET FUNCTION186CHAPTER 14 uPD78F980119014.1 Flash Memory Characteristics19114.1.1 Programming environment19114.1.2 Communication mode19214.1.3 On-board pin processing19514.1.4 Connection of adapter for flash writing198CHAPTER 15 INSTRUCTION SET20015.1 Operation20015.1.1 Operand identifiers and description methods20015.1.2 Description of “operation” column20115.1.3 Description of “flag operation” column20115.2 Operation List20215.3 Instructions Listed by Addressing Type207CHAPTER 16 ELECTRICAL SPECIFICATIONS210CHAPTER 17 PACKAGE DRAWINGS219CHAPTER 18 RECOMMENDED SOLDERING CONDITIONS220A.1 Software Package223A.2 Language Processing Software223A.3 Control Software224A.4 Flash Memory Writing Tools224A.5 Debugging Tools (Hardware)225A.6 Debugging Tools (Software)226A.7 Notes on Target System Design227APPENDIX A DEVELOPMENT TOOLS221APPENDIX B REGISTER INDEX229B.1 Register Index (Alphabetic Order of Register Name)229B.2 Register Index (Alphabetic Order of Register Symbol)231APPENDIX C REVISION HISTORY233Size: 1.83 MBPages: 234Language: EnglishOpen manual