| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
Cautions Keep safety first your circuit designs! Renesas Technolo
Top Searches for this datasheetCautions Keep safety first your circuit designs! Renesas Technology Corporation puts maximum effort into making semiconductor products better more reliable, there always possibility that trouble occur with them. Trouble with semiconductors lead personal injury, fire property damage. Remember give consideration safety when making your circuit designs, with appropriate measures such placement substitutive, auxiliary circuits, (ii) nonflammable material (iii) prevention against malfunction mishap. Notes regarding these materials These materials intended reference assist customers selection Renesas Technology Corporation product best suited customer's application; they convey license under intellectual property rights, other rights, belonging Renesas Technology Corporation third party. Renesas Technology Corporation assumes responsibility damage, infringement third-party's rights, originating product data, diagrams, charts, programs, algorithms, circuit application examples contained these materials. information contained these materials, including product data, diagrams, charts, programs algorithms represents information products time publication these materials, subject change Renesas Technology Corporation without notice product improvements other reasons. therefore recommended that customers contact Renesas Technology Corporation authorized Renesas Technology Corporation product distributor latest product information before purchasing product listed herein. information described here contain technical inaccuracies typographical errors. Renesas Technology Corporation assumes responsibility damage, liability, other loss rising from these inaccuracies errors. Please also attention information published Renesas Technology Corporation various means, including Renesas Technology Corporation Semiconductor home page (http://www.renesas.com). When using information contained these materials, including product data, diagrams, charts, programs, algorithms, please sure evaluate information total system before making final decision applicability information products. Renesas Technology Corporation assumes responsibility damage, liability other loss resulting from information contained herein. Renesas Technology Corporation semiconductors designed manufactured device system that used under circumstances which human life potentially stake. Please contact Renesas Technology Corporation authorized Renesas Technology Corporation product distributor when considering product contained herein specific purposes, such apparatus systems transportation, vehicular, medical, aerospace, nuclear, undersea repeater use. prior written approval Renesas Technology Corporation necessary reprint reproduce whole part these materials. these products technologies subject Japanese export control restrictions, they must exported under license from Japanese government cannot imported into country other than approved destination. diversion reexport contrary export control laws regulations Japan and/or country destination prohibited. Please contact Renesas Technology Corporation further details these materials products contained therein. H8/3502 HD6433502 Hardware Manual 3/13/03 Notice When using this document, keep following mind: This document may, wholly partially, subject change without notice. rights reserved: permitted reproduce duplicate, form, whole part this document without Hitachi's permission. Hitachi will held responsible damage user that result from accidents other reasons during operation user's unit according this document. Circuitry other examples described herein meant merely indicate characteristics performance Hitachi's semiconductor products. Hitachi assumes responsibility intellectual property claims other problems that result from applications based examples described herein. license granted implication otherwise under patents other rights third party Hitachi, Ltd. MEDICAL APPLICATIONS: Hitachi's products authorized MEDICAL APPLICATIONS without written consent appropriate officer Hitachi's sales company. Such includes, limited life support systems. Buyers Hitachi's products requested notify relevant Hitachi sales offices when planning products MEDICAL APPLICATIONS. Preface H8/3502 high-performance single-chip microcomputer ideally suited embedded control applications. chip built around high-speed H8/300 core. On-chip supporting modules include 16-kbyte ROM, 512-byte RAM, three types timers, serial communication interface, host interface, ports, easy implementation compact, high-performance control systems. Development tools that support functionally higher-end H8/3217 Series should used H8/3502 program development. H8/3502 also available ZTAT(Zero Turn-Around Time) version functionally higher-end H8/3214. This version enables user respond quickly flexibly changing application system specifications demands transition from initial full-fledged volume production. There number differences between H8/3502 functionally higher-end H8/3217 Series. terms functions, H8/3502 available only ROM/RAM configuration, maximum operating frequency MHz, does offer guaranteed current dissipation figure standby mode, power-down states. H8/3502 single-chip microcomputer intended consumer applications. user requires ZTATversion, larger ROM/RAM capacity, processing maximum MHz, significant power reduction standby mode portable systems, etc., high reliability essential automotive industrial applications, H8/3217 Series should used. This manual describes H8/3502 hardware. Refer H8/300 Series Programming Manual detailed description instruction set, H8/3217 Series Hardware Manual details higher-end products, including ZTATversions. Note: ZTAT trademark Hitachi, Ltd. Contents Section Overview Overview Block Diagram Assignments Functions. 1.3.1 Arrangement 1.3.2 Functions. Section Overview 2.1.1 Features 2.1.2 Address Space 2.1.3 Register Configuration Register Descriptions. 2.2.1 General Registers 2.2.2 Control Registers. 2.2.3 Initial Register Values Data Formats 2.3.1 Data Formats General Registers. 2.3.2 Memory Data Formats Addressing Modes. 2.4.1 Addressing Modes. 2.4.2 Effective Address Calculation. Instruction 2.5.1 Data Transfer Instructions 2.5.2 Arithmetic Operations 2.5.3 Logic Operations 2.5.4 Shift Operations 2.5.5 Manipulations. 2.5.6 Branching Instructions 2.5.7 System Control Instructions. 2.5.8 Block Data Transfer Instruction. States. 2.6.1 Overview 2.6.2 Program Execution State 2.6.3 Exception-Handling State 2.6.4 Power-Down State Access Timing Cycle. 2.7.1 Access On-Chip Memory (RAM ROM). 2.7.2 Access On-Chip Register Field External Devices. Section Operating Modes Address Space Overview 3.1.1 Operating Modes 3.1.2 Mode System Control Registers System Control Register (SYSCR) Mode Control Register (MDCR). Mode Descriptions. Address Space Maps Each Operating Mode Section Exception Handling Overview Reset 4.2.1 Overview 4.2.2 Reset Sequence. 4.2.3 Disabling Interrupts after Reset Interrupts 4.3.1 Overview 4.3.2 Interrupt-Related Registers 4.3.3 External Interrupts. 4.3.4 Internal Interrupts. 4.3.5 Interrupt Handling 4.3.6 Interrupt Response Time 4.3.7 Precaution. Note Stack Handling. Notes Key-Sense Interrupts Section Wait-State Controller. Overview 5.1.1 Features 5.1.2 Block Diagram 5.1.3 Input/Output Pins 5.1.4 Register Configuration Register Description 5.2.1 Wait-State Control Register (WSCR) Wait Modes Section Clock Pulse Generator. Overview 6.1.1 Block Diagram 6.1.2 Wait-State Control Register (WSCR) Oscillator Circuit Duty Adjustment Circuit Prescaler Section Ports. Overview Port 7.2.1 Overview 7.2.2 Register Configuration Descriptions 7.2.3 Functions Each Mode 7.2.4 Input Pull-Ups. Port 7.3.1 Overview 7.3.2 Register Configuration Descriptions 7.3.3 Functions Each Mode 7.3.4 Input Pull-Ups. Port 7.4.1 Overview 7.4.2 Register Configuration Descriptions 7.4.3 Functions Each Mode 7.4.4 Input Pull-Up Transistors. Port 7.5.1 Overview 7.5.2 Register Configuration Descriptions 7.5.3 Functions. Port 7.6.1 Overview 7.6.2 Register Configuration Descriptions 7.6.3 Functions. Port 7.7.1 Overview 7.7.2 Register Configuration Descriptions. 7.7.3 Functions. Port 7.8.1 Overview 7.8.2 Register Configuration Descriptions 7.8.3 Functions. Section 16-Bit Free-Running Timer Overview 8.1.1 Features 8.1.2 Block Diagram 8.1.3 Input Output Pins. 8.1.4 Register Configuration Register Descriptions. 8.2.1 Free-Running Counter (FRC)-H'FF92. Output Compare Registers (OCRA OCRB)-H'FF94 H'FF96. 8.2.3 Input Capture Register (ICR)-H'FF98. 8.2.4 Timer Control Register (TCR)-H'FF90. 8.2.5 Timer Control/Status Register (TCSR)-H'FF91 Interface Operation 8.4.1 Incrementation Timing 8.4.2 Output Compare Timing 8.4.3 Clear Timing. 8.4.4 Input Capture Timing. 8.4.5 Timing Input Capture Flag (ICF) Setting 8.4.6 Setting Overflow Flag (OVF) Interrupts Sample Application Application Notes. 8.2.2 Section 8-Bit Timers Overview 9.1.1 Features 9.1.2 Block Diagram 9.1.3 Input Output Pins. 9.1.4 Register Configuration Register Descriptions. 9.2.1 Timer Counter (TCNT)-H'FFCC (TMR0), H'FFD4 (TMR1), H'FF9E (TMRX) 9.2.2 Time Constant Registers (TCORA TCORB)-H'FFCA H'FFCB (TMR0), H'FFD2 H'FFD3 (TMR1), H'FF9C H'FF9D (TMRX). 9.2.3 Timer Control Register (TCR)-H'FFC8 (TMR0), H'FFD0 (TMR1), H'FF9A (TMRX). 9.2.4 Timer Control/Status Register (TCSR)-H'FFC9 (TMR0), H'FFD1 (TMR1), H'FF9B (TMRX) 9.2.5 Serial/Timer Control Register (STCR) Operation 9.3.1 TCNT Incrementation Timing 9.3.2 Compare Match Timing 9.3.3 External Reset TCNT. 9.3.4 Setting TCSR Overflow Flag. Interrupts Sample Application Application Notes. 9.6.1 Contention between TCNT Write Clear. 9.6.2 9.6.3 9.6.4 9.6.5 Contention between TCNT Write Increment Contention between TCOR Write Compare-Match Contention between Compare-Match Compare-Match Incrementation Caused Changing Internal Clock Source. Section Watchdog Timer 10.1 Overview 10.1.1 Features 10.1.2 Block Diagram 10.1.3 Register Configuration 10.2 Register Descriptions. 10.2.1 Timer Counter (TCNT) 10.2.2 Timer Control/Status Register (TCSR) 10.2.3 Register Access 10.3 Operation 10.3.1 Watchdog Timer Mode 10.3.2 Interval Timer Mode 10.3.3 Setting Overflow Flag 10.4 Application Notes. 10.4.1 Contention between TCNT Write Increment 10.4.2 Changing Clock Select Bits (CKS2 CKS0) 10.4.3 Recovery from Software Standby Mode Section Serial Communication Interface 11.1 Overview 11.1.1 Features 11.1.2 Block Diagram 11.1.3 Input Output Pins. 11.1.4 Register Configuration 11.2 Register Descriptions. 11.2.1 Receive Shift Register (RSR). 11.2.2 Receive Data Register (RDR) 11.2.3 Transmit Shift Register (TSR) 11.2.4 Transmit Data Register (TDR). 11.2.5 Serial Mode Register (SMR). 11.2.6 Serial Control Register (SCR). 11.2.7 Serial Status Register (SSR). 11.2.8 Rate Register (BRR). 11.2.9 Serial Communication Mode Register (SCMR) 11.3 Operation 11.3.1 Overview 11.3.2 Asynchronous Mode 11.3.3 Synchronous Mode. 11.4 Interrupts 11.5 Application Notes. Section Host Interface. 12.1 Overview 12.1.1 Block Diagram 12.1.2 Input Output Pins. 12.1.3 Register Configuration 12.2 Register Descriptions. 12.2.1 System Control Register (SYSCR) 12.2.2 Host Interface Control Register (HICR) 12.2.3 Input Data Register (IDR1). 12.2.4 Output Data Register (ODR1). 12.2.5 Status Register (STR1). 12.2.6 Input Data Register (IDR2). 12.2.7 Output Data Register (ODR2). 12.2.8 Status Register (STR2). 12.3 Operation 12.3.1 Host Interface Operation 12.3.2 Control States 12.3.3 Gate 12.4 Interrupts 12.4.1 IBF1, IBF2 12.4.2 HIRQ11, HIRQ1, HIRQ12 12.5 Application Note Section 13.1 13.2 13.3 13.4 Overview Block Diagram. Enable (RAME). Operation 13.4.1 Expanded Modes (Modes 13.4.2 Single-Chip Mode (Mode Section 14.1 Overview 14.1.1 Block Diagram Section Power-Down State 15.1 Overview 15.1.1 System Control Register (SYSCR) 15.2 Sleep Mode. 15.2.1 Transition Sleep Mode 15.2.2 Exit from Sleep Mode 15.3 Software Standby Mode 15.3.1 Transition Software Standby Mode 15.3.2 Exit from Software Standby Mode. 15.3.3 Clock Settling Time Exit from Software Standby Mode 15.3.4 Sample Application Software Standby Mode. 15.3.5 Note Current Dissipation. 15.4 Hardware Standby Mode. 15.4.1 Transition Hardware Standby Mode 15.4.2 Recovery from Hardware Standby Mode. 15.4.3 Timing Relationships Section Electrical Specifications 16.1 Absolute Maximum Ratings. 16.2 Electrical Characteristics. 16.2.1 Characteristics 16.2.2 Characteristics 16.3 Operational Timing 16.3.1 Timing. 16.3.2 Control Signal Timing 16.3.3 16-Bit Free-Running Timer Timing. 16.3.4 8-Bit Timer Timing 16.3.5 Serial Communication Interface Timing. 16.3.6 Port Timing 16.3.7 Host Interface Timing 16.3.8 External Clock Output Timing. Appendix Instruction Set. Instruction List. Operation Code Number States Required Execution. Appendix Internal Register Addresses. B.1.1 Registers Function. Appendix Port Block Diagrams. Port Block Diagram. Port Block Diagram. Port Block Diagram. Port Block Diagrams Port Block Diagrams Port Block Diagrams Port Block Diagrams Appendix States Appendix Timing Transition Recovery from Hardware Standby Mode Appendix Product Code Lineup Appendix Package Dimensions Section Overview Overview H8/3502 series single-chip microcomputers integrating core together with variety peripheral functions needed control systems. H8/300 high-speed processor featuring powerful bit-manipulation instructions, ideally suited realtime control applications. On-chip supporting modules necessary system configuration include 16-kbyte ROM, 512-byte RAM, three types timers (16-bit free-running timer, 8-bit timer, watchdog timer), serial communication interface (SCI), host interface (HIF), ports. H8/3502 operate single-chip mode expanded modes, depending memory requirements application. Development tools that support functionally higher-end H8/3217 Series should used H8/3502 program development. ZTATversion, ZTATversion H8/3214. Registers related higher-level functions should accessed this case. particular, must written IICS, IICX1, IICX0, SYNCE, PWCKE, PWCKS bits serial/timer control register (STCR). Note: ZTAT trademark Hitachi, Ltd. Table lists features H8/3502. Table Feature Features Description General register architecture Eight 16-bit general registers, Sixteen 8-bit general registers High speed Maximum clock rate: MHz/5 clock) Add/subtract: operation) Multiply/divide: 1400 operation) Concise, streamlined instruction instructions bytes long Register-register arithmetic logic operations Register-memory data transfer instruction Instruction features Multiply instruction bits bits) Divide instruction bits bits) Bit-accumulator instructions Register-indirect specification positions Memory 16-Bit free-running timer (FRT: channel) 8-bit timer (TMR: channels) Watchdog timer (WDT: channel) ROM: kbytes RAM: bytes 16-bit free-running counter (also usable external event counting) compare outputs capture input Each channel has: 8-bit up-counter (also usable external event counting) time constant registers Reset generation overflow switched interval timer mode Table Feature Features (cont) Description Selection asynchronous synchronous modes Simultaneous transmit receive (full duplex operation) On-chip baud rate generator 8-bit host interface port Three host interrupt requests (HIRQ HIRQ11, HIRQ12) Normal fast gate output register sets (each comprising data registers status register) Serial communication interface (SCI: channels) Host interface (HIF) Keyboard controller ports Interrupts Controls matrix keyboard using keyboard scan with wake-up interrupt sense port configuration input/output pins which drive large current loads) Four external interrupt pins: NMI, IRQ0 IRQ2 Eight key-sense interrupt pins: KEYIN0 KEYIN7 Twenty-one on-chip interrupt sources Mode expanded mode with on-chip disabled Mode expanded mode with on-chip enabled Mode single-chip mode Sleep mode Software standby mode Hardware standby mode On-chip clock oscillator Product Name H8/3502 Type Code HD6433502P10 HD6433502F10 Package 64-pin shrink (DP-64S) 64-pin (FP-64A) Mask Operating modes Power-down state Other features Product lineup Block Diagram Figure shows block diagram H8/3502. table 1-2, Assignments Each Operating Mode, differences functions. EXTAL Clock pulse generator STBY H8/300 XTAL P10/A0 P11/A1 P12/A2 P13/A3 P14/A4 P15/A5 P16/A6 P17/A7 Data (low) Data (high) Address Port Port Port KEYIN0/P60/FTCI KEYIN1/P61/FTOA KEYIN2/P62/FTOB KEYIN3/P63/FTI P64/IRQ0 P65/IRQ1 P66/IRQ2 Port P40/TMCI0 P41/TMO0 P42/TMRI0 HIRQ11/P43/TMCI1 HIRQ1/P44/TMO1 HIRQ12/P45/TMRI1 GA20/P47 Watchdog timer Host interface P70/KEYIN4 P71/KEYIN5 P72/KEYIN6 P73/KEYIN7 P74/AS/CS1 P75/WR/IOW P76/RD/IOR P77/WAIT/HA0 Port 16-bit free-running timer P20/A8 P21/A9 P22/A10 P23/A11 P24/A12 P25/A13 P26/A14 P27/A15 Serial communication interface channels) 8-bit timer channels) (TMR0, TMR1) P30/D0/HDB0 P31/D1/HDB1 P32/D2/HDB2 P33/D3/HDB3 P34/D4/HDB4 P35/D5/HDB5 P36/D6/HDB6 P37/D7/HDB7 Port Port P50/TxD0 P51/RxD0 P52/SCK0 P53/TxD1 P54/RxD1 P55/SCK1 Figure Block Diagram 1.3.1 Assignments Functions Arrangement Figure shows arrangement H8/3502 DP-64S packages. Figure shows arrangement FP-64A package. KEYIN0/P60/FTCI KEYIN1/P61/FTOA KEYIN2/P62/FTOB KEYIN3/P63/FTI P64/IRQ0 P65/IRQ1 P66/IRQ2 XTAL EXTAL STBY P40/TMCI0 P41/TMO0 P42/TMRI0 HIRQ11/P43/TMCI1 HIRQ1/P44/TMO1 HIRQ12/P45/TMRI1 GA20/P47 P50/TxD0 P51/RxD0 P52/SCK0 P53/TxD1 P54/RxD1 P55/SCK1 KEYIN4/P70 KEYIN5/P71 P37/D7/HDB7 P36/D6/HDB6 P35/D5/HDB5 P34/D4/HDB4 P33/D3/HDB3 P32/D2/HDB2 P31/D1/HDB1 P30/D0/HDB0 P10/A0 P11/A1 P12/A2 P13/A3 P14/A4 P15/A5 P16/A6 P17/A7 P20/A8 P21/A9 P22/A10 P23/A11 P24/A12 P25/A13 P26/A14 P27/A15 P77/WAIT/HA0 P76/RD/IOR P75/WR/IOW P74/AS/CS1 P73/KEYIN7 P72/KEYIN6 Figure Arrangement (DP-64S, View) P22/A10 P23/A11 P24/A12 P25/A13 P30/D0/HDB0 P31/D1/HDB1 P32/D2/HDB2 P33/D3/HDB3 P34/D4/HDB4 P35/D5/HDB5 P36/D6/HDB6 P37/D7/HDB7 P60/FTCI/KEYIN0 P61/FTOA/KEYIN1 P62/FTOB/KEYIN2 P63/FTI/KEYIN3 P64/IRQ0 P65/IRQ1 P66/IRQ2 P26/A14 P10/A0 P11/A1 P12/A2 P13/A3 P14/A4 P15/A5 P16/A6 P17/A7 P20/A8 P21/A9 P27/A15 HA0/P77/WAIT IOR/P76/RD IOW/P75/WR CS1/P74/AS KEYIN7/P73 KEYIN6/P72 KEYIN5/P71 KEYIN4/P70 P55/SCK1 P54/RxD1 P53/TxD1 P52/SCK0 P51/RxD0 P50/TxD0 HIRQ11/P43/TMCI1 HIRQ12/P45/TMRI1 HIRQ1/P44/TMO1 P40/TMCI0 P41/TMO0 P42/TMRI0 Figure Arrangement (FP-64A, View) GA20/P47 XTAL EXTAL STBY 1.3.2 Functions Assignments Each Operating Mode: Table list assignments pins DP-64S FP-64A packages each operating mode. Table Assignments Each Operating Mode Expanded Modes Mode P60/FTCI/KEYIN0 P61/FTOA/KEYIN1 P62/FTOB/KEYIN2 P63/FTI/KEYIN3 P64/IRQ0 P65/IRQ1 P66/IRQ2 XTAL EXTAL STBY P40/TMCI0 P41/TMO0 P42/TMRI0 P43/TMCI1 P44/TMO1 P45/TMRI1 P50/TxD0 P51/RxD0 P52/SCK0 Mode P60/FTCI/KEYIN0 P61/FTOA/KEYIN1 P62/FTOB/KEYIN2 P63/FTI/KEYIN3 P64/IRQ0 P65/IRQ1 P66/IRQ2 XTAL EXTAL STBY P40/TMCI0 P41/TMO0 P42/TMRI0 P43/TMCI1 P44/TMO1 P45/TMRI1 P50/TxD0 P51/RxD0 P52/SCK0 Single-Chip Mode Mode P60/FTCI/KEYIN0 P61/FTOA/KEYIN1 P62/FTOB/KEYIN2 P63/FTI/KEYIN3 P64/IRQ0 P65/IRQ1 P66/IRQ2 XTAL EXTAL STBY P40/TMCI0 P41/TMO0 P42/TMRI0 P43/TMCI1/HIRQ11 P44/TMO1/HIRQ1 P45/TMRI1/HIRQ12 P47/GA P50/TxD0 P51/RxD0 P52/SCK0 DP-64S FP-64A Table Assignments Each Operating Mode (cont) Expanded Modes Mode P53/TxD1 P54/RxD1 P55/SCK1 P70/KEYIN4 P71/KEYIN5 P72/KEYIN6 P73/KEYIN7 P77/WAIT Mode P53/TxD1 P54/RxD1 P55/SCK1 P70/KEYIN4 P71/KEYIN5 P72/KEYIN6 P73/KEYIN7 P77/WAIT P27/A P26/A P25/A P24/A P23/A P22/A P21/A P20/A P17/A P16/A P15/A P14/A P13/A P12/A P11/A P10/A Single-Chip Mode Mode P53/TxD1 P54/RxD1 P55/SCK1 P70/KEYIN4 P71/KEYIN5 DP-64S FP-64A P72/KEYIN6 P73/KEYIN7 P74/CS P75/IOW P76/IOR P77/HA0 Table Assignments Each Operating Mode (cont) Expanded Modes Mode Mode Single-Chip Mode Mode P30/HDB0 P31/HDB1 P32/HDB2 P33/HDB3 P34/HDB4 P35/HDB5 P36/HDB6 P37/HDB7 DP-64S FP-64A Functions: Table gives concise description function each pin. Table Functions Type Power Symbol DP-64S FP-64A Name Function Power: Connected power supply. Connect both pins system power supply. Ground: Connected ground Connect pins system power supply Crystal: Connected crystal oscillator. crystal frequency must same desired system clock frequency. external clock input EXTAL pin, reversephase clock should input XTAL pin. External crystal: Connected crystal oscillator external clock. frequency external clock must same desired system clock frequency. section Clock Pulse Generator, examples connections crystal external clock. System clock: Supplies system clock peripheral devices. Reset: input causes chip reset. Standby: transition hardware standby mode power-down state) occurs when input received STBY pin. Address bus: Address output pins. Clock XTAL EXTAL System control STBY Address Table Functions (cont) Type Data control Symbol WAIT DP-64S FP-64A Name Function Data bus: 8-bit bidirectional data bus. Wait: Requests insert states into cycle when offchip address accessed. Read: Goes indicate that reading external address. Write: Goes indicate that writing external address. Address strobe: Goes indicate that there valid address address bus. maskable interrupt: Highestpriority interrupt request. NMIEG system control register determines whether interrupt requested rising falling edge input. Interrupt request Maskable interrupt request pins. Mode: Input pins setting operating mode according table below. Mode Mode Description Expanded mode with on-chip disabled Expanded mode with on-chip enabled Single-chip mode Interrupt signals IRQ0 IRQ2 Operating mode control MD1, Mode Mode Table Functions (cont) Type 16-bit freerunning timer Symbol FTCI DP-64S FP-64A Name Function counter clock input: Input external clock signal freerunning counter. output compare Output pins controlled comparator freerunning timer. output compare Output pins controlled comparator freerunning timer. input capture: Input capture free-running timer. 8-bit timer output (channels Compare- match output pins 8-bit timers. 8-bit timer clock input (channels External clock input pins 8-bit timer counters. 8-bit timer reset input (channels High input these pins resets 8-bit timers. Serial transmit data (channels Data output pins serial communication interface. Serial receive data (channels Data input pins serial communication interface. Serial clock (channels Input/output pins serial clock signals. FTOA FTOB 8-bit timer TMO0, TMO1 TMCI0, TMCI1 TMRI0, TMRI1 Serial communication interface (SCI) TxD0 TxD1 RxD0 RxD1 Table Functions (cont) Type Generalpurpose Symbol DP-64S FP-64A Name Function Port 8-bit input/output port with programmable input pull-ups driving capability. direction each selected port data direction register (P1DDR). Port 8-bit input/output port with programmable input pull-ups driving capability. direction each selected port data direction register (P2DDR). Port 8-bit input/output port with programmable input pull-ups drive capability. direction each selected port data direction register (P3DDR). Port 8-bit input/output port. direction each (except selected port data direction register (P4DDR). Port 6-bit input/output port. direction each selected port data direction register (P5DDR). Port 7-bit input/output port. direction each selected port data direction register (P6DDR). Port 8-bit input/output port. direction each selected port data direction register (P7DDR). Table Functions (cont) Type Host interface (HIF) Symbol HDB0 HDB7 DP-64S FP-64A Name Function Host interface data bus: Bidirectional 8-bit host interface access host. Chip select Input pins selecting host interface channel channel read: Input that enables reads host interface. write: Input that enables writes host interface. Command/data: Input that indicates data access command access. GATE A20: GATE control signal output pin. Host interrupt Output pins interrupt requests host. Keyboard input: Input pins matrix keyboard. normally used keyboard scan outputs, enabling maximum 16output 8-input, 128-key matrix configured. number keys increased using other port outputs.) GA20 HIRQ1 HIRQ11 HIRQ12 Keyboard control KEYIN0 KEYIN7 Section Overview H8/3502 generic H8/300 CPU: 8-bit central processing unit with speed-oriented architecture featuring sixteen general registers. This section describes features functions, including concise description addressing modes instruction set. further details instructions, H8/300 Series Programming Manual. 2.1.1 Features main features H8/300 listed below. Two-way register configuration Sixteen 8-bit general registers, Eight 16-bit general registers Instruction with basic instructions, including: Multiply divide instructions Powerful bit-manipulation instructions Eight addressing modes Register direct (Rn) Register indirect (@Rn) Register indirect with displacement (@(d:16, Rn)) Register indirect with post-increment pre-decrement (@Rn+ @-Rn) Absolute address (@aa:8 @aa:16) Immediate (#xx:8 #xx:16) PC-relative (@(d:8, PC)) Memory indirect (@@aa:8) Maximum 64-kbyte address space High-speed operation frequently-used instructions executed four states maximum clock rate MHz/5 clock) 16-bit register-register subtract: MHz) 8-bit multiply: 1400 MHz) 8-bit divide: 1400 MHz) Power-down mode SLEEP instruction 2.1.2 Address Space H8/300 supports address space kbytes storing program code data. memory different each mode (modes section 3.5, Address Space Maps Each Operating Mode, details. 2.1.3 Register Configuration Figure shows register structure CPU. There groups registers: general registers control registers. General registers (Rn) (SP) Stack pointer Control registers (CR) UHUNZ Program counter CCR: Condition code register Carry flag Overflow flag Zero flag Negative flag Half-carry flag Interrupt mask User User Figure Registers 2.2.1 Register Descriptions General Registers general registers used both data registers address registers. When used address registers, general registers accessed 16-bit registers R7). When used data registers, they accessed 16-bit registers, high bytes accessed separately 8-bit registers. also functions stack pointer, used implicitly hardware processing interrupts subroutine calls. assembly-language coding, also denoted letters indicated figure 2-2, (SP) points stack. Unused area (R7) Stack area Figure Stack Pointer 2.2.2 Control Registers control registers include 16-bit program counter (PC) 8-bit condition code register (CCR). Program Counter (PC): This 16-bit register indicates address next instruction will execute. Each instruction accessed bits word), least significant ignored (always regarded Condition Code Register (CCR): This 8-bit register contains internal status information, including carry (C), overflow (V), zero (Z), negative (N), half-carry flags interrupt mask (I). 7-Interrupt Mask (I): When this interrupts except masked. This automatically reset start interrupt handling. 6-User (U): This written read software purposes (using LDC, STC, ANDC, ORC, XORC instructions). 5-Half-Carry (H): This when ADD.B, ADDX.B, SUB.B, SUBX.B, NEG.B, CMP.B instruction causes carry borrow cleared otherwise. Similarly, when ADD.W, SUB.W, CMP.W instruction causes carry borrow cleared otherwise. used implicitly instructions. 4-User (U): This written read software purposes (using LDC, STC, ANDC, ORC, XORC instructions). 3-Negative (N): This indicates most significant (sign bit) result instruction. 2-Zero (Z): This indicate zero result cleared indicate nonzero result. 1-Overflow (V): This when arithmetic overflow occurs, cleared other times. 0-Carry (C): This used subtract instructions, indicate carry borrow most significant result Shift rotate instructions, store value shifted most significant least significant manipulation load instructions, accumulator LDC, STC, ANDC, ORC, XORC instructions enable load store CCR, clear selected bits logic operations. flags used conditional branching instructions (Bcc). Some instructions leave some flag bits unchanged. action each instruction flag bits shown Appendix A.1, Instruction List. H8/300 Series Programming Manual further details. 2.2.3 Initial Register Values When reset, program counter (PC) loaded from vector table interrupt mask other bits general registers initialized. particular, stack pointer (R7) initialized. prevent program crashes stack pointer should initialized software, first instruction executed after reset. Data Formats H8/300 process 1-bit data, 4-bit (BCD) data, 8-bit (byte) data, 16-bit (word) data. manipulation instructions operate 1-bit data specified byte operand. arithmetic logic instructions except ADDS SUBS operate byte data. instruction perform decimal arithmetic adjustments byte data packed form. Each nibble byte treated decimal digit. MOV.W, ADD.W, SUB.W, CMP.W, ADDS, SUBS, MULXU bits bits), DIVXU bits bits) instructions operate word data. 2.3.1 Data Formats General Registers Data sizes above stored general registers shown figure 2-3. Data Type Register Data Format 1-bit data Don't care 1-bit data Don't care Byte data Don't care Byte data Don't care Word data Upper digit Lower digit 4-bit data Don't care Upper digit Lower digit 4-bit data Don't care Legend RnH: Upper digit general register RnL: Lower digit general register MSB: Most significant LSB: Least significant Figure Register Data Formats 2.3.2 Memory Data Formats Figure indicates data formats memory. Word data stored memory must always begin even address. word access least significant address regarded address specified, address error occurs access performed preceding even address. This rule affects MOV.W instructions branching instructions, implies that only even addresses should stored vector table. Data Type Address Data Format 1-bit data Byte data Address Address Even address address Even address address Even address address Word data Upper bits Lower bits Byte data (CCR) stack CCR* Word data stack Note: Ignored returning Legend CCR: Condition code register Figure Memory Data Formats stack must always accessed word time. When pushed stack, identical copies pushed make complete word. When they returned, lower byte ignored. 2.4.1 Addressing Modes Addressing Modes H8/300 supports eight addressing modes. Each instruction uses subset these addressing modes. Register Direct-Rn: register field instruction specifies 16-bit general register containing operand. most cases general register accessed 8-bit register. Only MOV.W, ADD.W, SUB.W, CMP.W, ADDS, SUBS, MULXU bits bits), DIVXU bits bits) instructions have 16-bit operands. Register indirect-@Rn: register field instruction specifies 16-bit general register containing address operand. Register Indirect with Displacement-@(d:16, Rn): This mode, which used only instructions, similar register indirect instruction second word (bytes which added contents specified general register obtain operand address. MOV.W instruction, resulting address must even. Register Indirect with Post-Increment Pre-Decrement-@Rn+ @-Rn: Register indirect with Post-Increment-@Rn+ @Rn+ mode used with instructions that load registers from memory. similar register indirect mode, 16-bit general register specified register field instruction incremented after operand accessed. size increment depending size operand: MOV.B; MOV.W. MOV.W, original contents 16-bit general register must even. Register Indirect with Pre-Decrement-@-Rn @-Rn mode used with instructions that store register contents memory. similar register indirect mode, 16-bit general register specified register field instruction decremented before operand accessed. size decrement depending size operand: MOV.B; MOV.W. MOV.W, original contents 16-bit general register must even. Absolute Address-@aa:8 @aa:16: instruction specifies absolute address operand memory. MOV.B instruction uses 8-bit absolute address form H'FFxx. upper bits assumed possible address range H'FF00 H'FFFF (65280 65535). MOV.B, MOV.W, JMP, instructions 16-bit absolute addresses. Immediate-#xx:8 #xx:16: instruction contains 8-bit operand second byte, 16-bit operand third fourth bytes. Only MOV.W instructions contain 16-bit immediate values. ADDS SUBS instructions implicitly contain value immediate data. Some manipulation instructions contain 3-bit immediate data (#xx:3) second fourth byte instruction, specifying number. PC-Relative-@(d:8, PC): This mode used generate branch addresses instructions. 8-bit value byte instruction code added sign-extended value program counter contents. result must even number. possible branching range -126 +128 bytes (-63 words) from current address. Memory Indirect-@@aa:8: This mode used instructions. second byte instruction code specifies 8-bit absolute address from H'0000 H'00FF 255). word located this address contains branch address. Note that part this area located vector table. section 3.5, Address Space Maps Each Operating Mode, details. address specified branch destination operand address MOV.W instruction, least significant regarded causing word access performed address preceding specified address. section 2.3.2, Memory Data Formats, further information. 2.4.2 Effective Address Calculation Table shows effective address (EA) calculated each addressing mode. Arithmetic logic instructions (ADD.B, ADDX.B, SUBX.B, CMP.B, AND.B, OR.B, XOR.B instructions) register direct immediate addressing modes. Data transfer instructions addressing modes except program-counter relative memory indirect. manipulation instructions register direct, register indirect absolute (@aa:8) addressing mode specify operand, register direct (BSET, BCLR, BNOT, BTST instructions) immediate (3-bit) addressing mode specify number operand. Effective Address Calculation Table Effective Address Calculation Effective Address (EA) regm Addressing Mode Instruction Format Register direct, (Rn) regn regm regn Operand regm/n contents contents bits) Register indirect (@Rn) contents bits) disp Register indirect with displacement (@d:16, disp Register indirect with post-increment pre-decrement Register indirect with post-increment, @Rn+ contents bits) Register indirect with pre-decrement, @-Rn contents bits) Incremented decremented operand byte size, word size Table Effective Address Calculation (cont) Effective Address Calculation H'FF Addressing Mode Instruction Format Effective Address (EA) Absolute address @aa:8 @aa:16 Immediate #xx:8 Operand 2-byte immediate data #xx:16 Program-counter relative @(d:8, contents Sign extension disp disp Effective Address Calculation Effective Address (EA) Table Effective Address Calculation (cont) Addressing Mode Instruction Format Memory indirect, @@aa:8 H'00 Memory contents bits) Legend reg, regm, regn: disp: IMM: abs: Register field Operation field Displacement Immediate data Absolute address Instruction Table lists H8/300 instruction set. Table Function Data transfer Arithmetic operations Logic operations Shift manipulation Branch System control Block data transfer Notes: Instruction Classification Instructions MOV, MOVTPE MOVFPE*1, PUSH*2, POP*2 Types Total These instructions cannot used with H8/3502. PUSH equivalent MOV.W @-SP. equivalent MOV.W @SP+, conditional branch instruction which represents condition code. ADD, SUB, ADDX, SUBX, INC, DEC, ADDS, SUBS, DAA, DAS, MULXU, DIVXU, CMP, AND, XOR, SHAL, SHAR, SHLL, SHLR, ROTL, ROTR, ROTXL, ROTXR BSET, BCLR, BNOT, BTST, BAND, BIAND, BOR, BIOR, BXOR, BIXOR, BLD, BILD, BST, BIST Bcc*3, JMP, BSR, JSR, RTE, SLEEP, LDC, STC, ANDC, ORC, XORC, EEPMOV following sections give concise summary instructions each category, indicate patterns their object code. notation used defined next. Operation Notation <EAs> (EAd) (EAs) #imm #xx:3 #xx:8 #xx:16 General register (destination) General register (source) General register General register field Effective address: general register memory location Destination operand Source operand Stack pointer Program counter Condition code register (negative) (zero) (overflow) (carry) Immediate data 3-bit immediate data 8-bit immediate data 16-bit immediate data disp Operation field Displacement Absolute address Byte Word Addition Subtraction Multiplication Division Logical Logical Exclusive logical Move Exchange (logical complement) Condition field 2.5.1 Data Transfer Instructions Table describes data transfer instructions. Figure shows their object code formats. Table Instruction Data Transfer Instructions Size* Function (EAs) (EAd) Moves data between general registers between general register memory, moves immediate data general register. @Rn, @(d:16, Rn), @aa:16, #xx:8 #xx:16, @-Rn, @Rn+ addressing modes available byte word data. @aa:8 addressing mode available byte data only. @-R7 @R7+ modes require word operands. specify byte size these modes. Cannot used with H8/3502. Cannot used with H8/3502. @-SP Pushes 16-bit general register onto stack. Equivalent MOV.W @-SP. @SP+ Pops 16-bit general register from stack. Equivalent MOV.W @SP+, MOVTPE MOVFPE PUSH Note: Size: operand size Byte Word @Rm, disp @(d:16, @(d:16, @Rm+ @-Rm @aa:8 @aa:8 @aa:16 @aa:16 #imm #xx:8 #imm #xx:16 MOVFPE, MOVTPE Legend Operation field Register field disp: Displacement abs: Absolute address #imm: Immediate data PUSH, Figure Data Transfer Instruction Codes 2.5.2 Arithmetic Operations Table describes arithmetic instructions. figure section 2.5.4, Shift Operations their object codes. Table Instruction Arithmetic Instructions Size* Function #imm Performs addition subtraction data general registers, addition immediate data data general register. Immediate data cannot subtracted from data general register. Word data added subtracted only when both words general registers. #imm Performs addition subtraction with carry borrow byte data general registers, addition subtraction immediate data data general register. Increments decrements general register. #imm Adds subtracts immediate data from data general register. immediate data must decimal adjust Decimal-adjusts (adjusts packed BCD) addition subtraction result general register referring CCR. Performs 8-bit 8-bit unsigned multiplication data general registers, providing 16-bit result. Performs 16-bit 8-bit unsigned division data general registers, providing 8-bit quotient 8-bit remainder. #imm Compares data general register with data another general register with immediate data. Word data compared only between general registers. Obtains two's complement (arithmetic complement) data general register. ADDX SUBX ADDS SUBS MULXU DIVXU Note: Size: operand size Byte Word 2.5.3 Logic Operations Table describes four instructions that perform logic operations. figure section 2.5.4, Shift Operations their object codes. Table Instruction Logic Operation Instructions Size* Function #imm Performs logical operation general register another general register immediate data. #imm Performs logical operation general register another general register immediate data. #imm Performs logical exclusive operation general register another general register immediate data. (Rd) Obtains one's complement (logical complement) general register contents. Note: Size: operand size Byte 2.5.4 Shift Operations Table describes eight shift instructions. Figure shows object code formats arithmetic, logic, shift instructions. Table Instruction SHAL SHAR SHLL SHLR ROTL ROTR ROTXL ROTXR Shift Instructions Size* Function shift Performs arithmetic shift operation general register contents. shift Performs logical shift operation general register contents. rotate Rotates general register contents. rotate through carry Rotates general register contents through (carry) bit. Note: Size: operand size Byte ADD, SUB, CMP, ADDX, SUBX (Rm) ADDS, SUBS, INC, DEC, DAA, DAS, NEG, MULXU, DIVXU #imm ADD, ADDX, SUBX, (#xx:8) AND, (Rm) #imm AND, (#xx:8) Legend Operation field Register field #imm: Immediate data SHAL, SHAR, SHLL, SHLR, ROTL, ROTR, ROTXL, ROTXR Figure Arithmetic, Logic, Shift Instruction Codes 2.5.5 Manipulations Table describes bit-manipulation instructions. Figure shows their object code formats. Table Instruction BSET Bit-Manipulation Instructions Size* Function (<bit-No.> <EAd>) Sets specified general register memory specified number, given 3-bit immediate data lower three bits general register. (<bit-No.> <EAd>) Clears specified general register memory specified number, given 3-bit immediate data lower three bits general register. <EAd>) (<bit-No.> <EAd>) Inverts specified general register memory. specified number, given 3-bit immediate data lower three bits general register. (<bit-No.> <EAd>) Tests specified general register memory sets clears flag accordingly. specified number, given 3-bit immediate data lower three bits general register. (<bit-No.> <EAd>) ANDs flag with specified general register memory. (<bit-No.> <EAd>)] ANDs flag with inverse specified general register memory. number specified 3-bit immediate data. (<bit-No.> <EAd>) flag with specified general register memory. (<bit-No.> <EAd>)] flag with inverse specified general register memory. number specified 3-bit immediate data. (<bit-No.> <EAd>) XORs flag with specified general register memory. (<bit-No.> <EAd>)] XORs flag with inverse specified general register memory. number specified 3-bit immediate data. BCLR BNOT BTST BAND BIAND BIOR BXOR BIXOR Table Instruction BILD Bit-Manipulation Instructions (cont) Size* Function (<bit-No.> <EAd>) Copies specified general register memory flag. (<bit-No.> <EAd>) Copies inverse specified general register memory flag. number specified 3-bit immediate data. (<bit-No.> <EAd>) Copies flag specified general register memory. (<bit-No.> <EAd>) Copies inverse flag specified general register memory. number specified 3-bit immediate data. BIST Note: Size: operand size Byte Notes Manipulation Instructions: BSET, BCLR, BNOT, BST, BIST readmodify-write instructions. They read byte data, modify byte, then write byte back. Care required when these instructions applied registers with write-only bits port registers. Order Read Modify Write Operation Read data byte specified address Modify data byte Write modified data byte back specified address Example: BCLR executed clear port data direction register (P1DDR) under following conditions. Input pin, Input pin, High 5-P1 Output pins, intended purpose this BCLR instruction switch from output input. Before Execution BCLR Instruction Input/output state Input Input High Output Output Output Output Output Output Execution BCLR Instruction BCLR.B @P1DDR Clear data direction register After Execution BCLR Instruction Input/output state Output Output Output Output Output Input High Output Output High Explanation: execute BCLR instruction, begins reading P1DDR. Since P1DDR write-only register, read H'FF, even though true value H'3F. Next clears read data, changing value H'FE. Finally, writes this value (H'FE) back P1DDR complete BCLR instruction. result, P10DDR cleared making input pin. addition, P17DDR P16DDR making output pins. BSET, BCLR, BNOT, BTST #imm Operand: register direct (Rn) No.: immediate (#xx:3) Operand: register direct (Rn) No.: register direct (Rm) #imm Operand: register indirect (@Rn) No.: immediate (#xx:3) Operand: register indirect (@Rn) No.: register direct (Rm) #imm Operand: absolute (@aa:8) No.: immediate (#xx:3) Operand: absolute (@aa:8) No.: register direct (Rm) BAND, BOR, BXOR, BLD, #imm Operand: register direct (Rn) No.: immediate (#xx:3) #imm Operand: register indirect (@Rn) No.: immediate (#xx:3) #imm Operand: absolute (@aa:8) No.: immediate (#xx:3) Legend Operation field Register field abs: Absolute address #imm: Immediate data Figure Manipulation Instruction Codes BIAND, BIOR, BIXOR, BILD, BIST #imm Operand: register direct (Rn) No.: immediate (#xx:3) #imm Operand: register indirect (@Rn) No.: immediate (#xx:3) #imm Operand: absolute (@aa:8) No.: immediate (#xx:3) Legend Operation field Register field abs: Absolute address #imm: Immediate data Figure Manipulation Instruction Codes (cont) 2.5.6 Branching Instructions Table describes branching instructions. Figure shows their object code formats. Table Instruction Branching Instructions Size Function Branches condition true. Mnemonic (BT) (BF) (BHS) (BLO) Field 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Description Always (true) Never (false) High same Carry clear (high same) Carry (low) equal Equal Overflow clear Overflow Plus Minus Greater equal Less than Greater than Less equal Condition Always Never CZ=0 CZ=1 NV=0 NV=1 Branches unconditionally specified address. Branches subroutine specified address. Branches subroutine specified displacement from current address. Returns from subroutine disp (@Rm) (@aa:16) (@@aa:8) disp (@Rm) (@aa:16) (@@aa:8) Legend Operation field Condition field Register field disp: Displacement abs: Absolute address Figure Branching Instruction Codes 2.5.7 System Control Instructions Table describes system control instructions. Figure shows their object code formats. Table Instruction SLEEP System Control Instructions Size* Function Returns from exception-handling routine. Causes transition power-down state. CCR, #imm Moves immediate data general register contents condition code register. Copies condition code register specified general register. #imm Logically ANDs condition code register with immediate data. #imm Logically condition code register with immediate data. #imm Logically exclusive-ORs condition code register with immediate data. Only increments program counter. ANDC XORC Note: Size: operand size Byte RTE, SLEEP, LDC, (Rn) #imm ANDC, ORC, XORC, (#xx:8) Legend Operation field Register field #imm: Immediate data Figure System Control Instruction Codes 2.5.8 Block Data Transfer Instruction Table describes EEPMOV instruction. Figure 2-10 shows object code format. Table Instruction EEPMOV Block Data Transfer Instruction Size Function then repeat until else next; Moves data block according parameters general registers R4L, R4L: size block (bytes) starting source address starting destination address Execution next instruction starts soon block transfer completed. @R5+ @R6+ Legend Operation field Figure 2-10 Block Data Transfer Instruction Notes EEPMOV Instruction EEPMOV instruction block data transfer instruction. moves number bytes specified from address specified address specified When setting make sure that final destination address R4L) does exceed H'FFFF. value must change from H'FFFF H'0000 during execution instruction. H'FFFF allowed 2.6.1 States Overview three states: program execution state, exception-handling state, power-down state. power-down state further divided into three modes: sleep mode, software standby mode, hardware standby mode. Figure 2-11 summarizes these states, figure 2-12 shows state transitions. State Program execution state executes successive program instructions. Exception-handling state transient state which changes processing flow reset interrupt Power-down state state which some chip functions stopped conserve power. Sleep mode Software standby mode Hardware standby mode Figure 2-11 Operating States Interrupt request Exceptionhandling state Program execution state Exception handing Interrupt request SLEEP instruction with SSBY SLEEP instruction Sleep mode IRQ0 IRQ2 IRQ6 Software standby mode Reset state STBY Hardware standby mode Power-down state Notes: transition reset state occurs when goes low, except when chip hardware standby mode. transition from state hardware standby mode occurs when STBY goes low. Figure 2-12 State Transitions 2.6.2 Program Execution State this state executes program instructions sequence. main program, subroutines, interrupt-handling routines executed this state. 2.6.3 Exception-Handling State exception-handling state transient state that occurs when reset interrupted changes normal processing flow. interrupt exception handling, references stack pointer (R7) saves program counter condition code register stack. further details section Exception Handling. 2.6.4 Power-Down State power-down state includes three modes: sleep mode, software standby mode, hardware standby mode. Sleep Mode: sleep mode entered when SLEEP instruction executed. halts, register contents remain unchanged on-chip supporting modules continue function. When interrupt reset signal received, returns through exception-handling state program execution state. Software Standby Mode: software standby mode entered SLEEP instruction executed while SSBY (Software Standby) system control register (SYSCR) set. on-chip supporting modules halt. on-chip supporting modules initialized, contents on-chip registers remain unchanged. port outputs also remain unchanged. Hardware Standby Mode: hardware standby mode entered when input STBY goes low. chip functions halt, including port output. on-chip supporting modules initialized, on-chip contents held. section Power-Down State, further information. Access Timing Cycle driven system clock period from rising edge system clock next referred "state." Memory access performed two- three-state cycle described below. Different accesses performed on-chip memory, on-chip register field, external devices. more detailed timing diagrams cycles, section Electrical Specifications. 2.7.1 Access On-Chip Memory (RAM ROM) On-chip accessed cycle states designated Either byte word data accessed, 16-bit data bus. Figure 2-13 shows on-chip memory access cycle. Figure 2-14 shows associated states. cycle state state Internal address Address Internal read signal Internal data (read) Read data Internal write signal Internal data (write) Write data Figure 2-13 On-Chip Memory Access Cycle cycle state state Address Address High High High Data bus: High impedance state Figure 2-14 States during On-Chip Memory Access Cycle 2.7.2 Access On-Chip Register Field External Devices on-chip register field (I/O ports, dual-port RAM, on-chip supporting module registers, etc.) external devices accessed cycle consisting three states: Only byte data accessed cycle, 8-bit data bus. Access word data instruction codes requires consecutive cycles (six states). Figure 2-15 shows access cycle on-chip register field. Figure 2-16 shows associated states. Figures 2-17 show read write access timing external devices. cycle state Internal address Internal read signal Internal data (read) Internal write signal Internal data (write) state state Address Read data Write data Figure 2-15 On-Chip Register Field Access Cycle cycle state state state Address Address High High High Data bus: high impedance state Figure 2-16 States during On-Chip Supporting Module Access Read cycle state state state Address Address High Data Read data Figure 2-17 External Device Access Timing (Read) Write cycle state state state Address Address High Data Write data Figure 2-17 External Device Access Timing (Write) Section Operating Modes Address Space 3.1.1 Overview Operating Modes H8/3502 operates three modes numbered mode selected inputs mode pins (MD1 table 3-1. Table Mode Mode Mode Mode Mode Operating Modes High High High High Address Space Expanded Expanded Single-chip On-Chip Disabled Enabled Enabled On-Chip Enabled* Enabled* Enabled Note: RAME system control register (SYSCR) cleared off-chip memory accessed instead. Modes expanded modes that permit access off-chip memory peripheral devices. maximum address space supported these externally expanded modes kbytes. mode (single-chip mode), only on-chip on-chip register field used. ports available general-purpose input output. Mode inoperative H8/3502. Avoid setting mode pins mode 3.1.2 Mode System Control Registers Table lists registers related chip's operating mode: system control register (SYSCR) mode control register (MDCR). mode control register indicates inputs mode pins MD0. Table Name System control register Mode control register Mode System Control Registers Abbreviation SYSCR MDCR Read/Write Address H'FFC4 H'FFC5 System Control Register (SYSCR) SSBY STS2 STS1 STS0 XRST NMIEG RAME Initial value Read/Write system control register (SYSCR) 8-bit register that controls operation chip. 7-Software Standby (SSBY): Enables transition software standby mode. details, section Power-Down State. recovery from software standby mode external interrupt, SSBY remains cleared writing SSBY Description SLEEP instruction causes transition sleep mode. SLEEP instruction causes transition software standby mode. (Initial value) Bits 4-Standby Timer Select (STS2 STS0): These bits select clock settling time when chip recovers from software standby mode external interrupt. During selected time on-chip supporting modules continue stand These bits should according clock frequency that settling time least specific settings, section 18.3.3, Clock Settling Time Exit from Software Standby Mode. STS2 STS1 STS0 Description Settling time 8,192 states Settling time 16,384 states Settling time 32,768 states Settling time 65,536 states Settling time 131,072 states Unused (Initial value) 3-External Reset (XRST): Indicates source reset. reset generated input external reset signal, watchdog timer overflow when watchdog timer used. XRST read-only bit. external reset, cleared watchdog timer overflow. XRST Description Reset caused watchdog timer overflow. Reset caused external input. (Initial value) 2-NMI Edge (NMIEG): Selects valid edge input. NMIEG Description interrupt requested falling edge input. interrupt requested rising edge input. (Initial value) 1-Host Interface Enable (HIE): Enables disables host interface function. When enabled, host interface processes host-slave data transfers, operating slave mode. Description host interface disabled. host interface enabled (slave mode). (Initial value) 0-RAM Enable (RAME): Enables disables on-chip RAM. RAME initialized reset, initialized software standby mode. RAME Description on-chip disabled. on-chip enabled. (Initial value) Mode Control Register (MDCR) MDS1 MDS0 Initial value Read/Write Note: Initialized according inputs. mode control register (MDCR) 8-bit register that indicates operating mode chip. Bits 5-Reserved: These bits cannot modified always read Bits 3-Reserved: These bits cannot modified always read 2-Reserved: This cannot modified always read Bits 0-Mode Select (MDS1 MDS0): These bits indicate values mode pins (MD1 MD0), thereby indicating current operating mode chip. MDS1 corresponds MDS0 MD0. These bits read written. When mode control register read, levels mode pins (MD1 latched these bits. Mode Descriptions Mode (Expanded Mode without On-Chip ROM): Mode supports 64-kbyte address space most which off-chip. particular, interrupt vector table located off-chip memory. on-chip used. Software select whether on-chip RAM. Ports used address data lines control signals follows: Ports Address Port Data Port (partly): control signals Mode (Expanded Mode with On-Chip ROM): Mode supports 64-kbyte address space which includes on-chip ROM. Software select whether on-chip RAM, select usage pins ports Ports Address (see note) Port Data Port (partly): control signals Note: mode ports initially general-purpose input ports. Software must change desired pins output before using them address bus. section Ports details. Mode (Single-Chip Mode): this mode memory on-chip. Since off-chip memory accessed, there external address bus. ports available general-purpose input output. Address Space Maps Each Operating Mode Figure shows memory maps H8/3502 each three operating modes. Mode Expanded mode without on-chip H'0000 Vector table H'0063 H'0064 H'0063 H'0064 H'0000 Mode Expanded mode with on-chip H'0000 Vector table H'0063 H'0064 Mode Single-chip mode Vector table On-chip ROM, 16384 bytes On-chip ROM, 16384 bytes External address space H'3FFF H'4000 Reserved*2 H'7FFF H'8000 External address space H'FB7F H'FB80 Reserved*1, H'FD7F H'FD80 H'FF7F H'FF80 H'FF8F H'FF90 H'FFFF H'FD7F H'FD80 H'FF7F H'FF80 H'FF8F H'FF90 H'FFFF H'FB7F H'FB80 Reserved*1, H'FD7F H'FD80 On-chip RAM, bytes H'FF7F External address space H'FF90 On-chip register field H'FFFF On-chip register field H'FB80 Reserved*2 H'7FFF H'3FFF Reserved*2 On-chip RAM*1, bytes External address space On-chip register field On-chip RAM*1, bytes Notes: External memory accessed these addresses when RAME system control register (SYSCR) cleared access reserved areas. Figure Address Space Section Exception Handling Overview H8/3502 recognizes only kinds exceptions: interrupts reset. Table indicates their priority timing their hardware exception-handling sequence. Table Priority High Reset Interrupt Exceptions Type Exception Reset Detection Timing Clock synchronous Timing Exception-Handling Sequence When goes low, chip enters reset state immediately. hardware exceptionhandling sequence (reset sequence) begins soon goes high again. When interrupt requested, hardware exception-handling sequence (interrupt sequence) begins current instruction, current hardware exception-handling sequence. Interrupt completion instruction execution* Note: detected case ANDC, ORC, XORC, instructions. 4.2.1 Reset Overview reset highest exception-handling priority. When goes watchdog reset started (watchdog timer overflow which reset option selected), current processing stops chip enters reset state. internal state registers on-chip supporting modules initialized. When returns from high watchdog reset pulse ends, chip comes reset state reset exception-handling sequence. 4.2.2 Reset Sequence reset state begins when goes watchdog reset occurs. ensure correct resetting, power-on should held least reset during operation, should held least system clock cycles. watchdog reset pulse width always system clock cycles. details states reset, appendix States. When reset exception handling started, hardware carries following reset sequence. condition code register (CCR), mask interrupts. registers ports on-chip supporting modules initialized. loads program counter with first word vector table (stored addresses H'0000 H'0001) starts program execution. should held when power switched off, well when power switched Figure indicates timing reset sequence when vector table reset routine located on-chip (mode Figure indicates timing when they off-chip memory (mode Vector fetch RES/watchdog reset (internal) Internal address Internal read signal Internal write signal Internal data bits) Internal Instruction processing prefetch Reset exception handling vector address (H'0000) Program start address First instruction program Figure Reset Sequence (Mode Program Area On-Chip ROM) Vector fetch Internal processing Instruction prefetch Reset exception handling vector address: H'0000, H'0001 Start address (contents reset exception handling vector address): upper byte, lower byte Start address: (4), First instruction program: first byte, second byte RES/watchdog reset (internal) Figure Reset Sequence (Mode bits) (1), (2), (5), (6), 4.2.3 Disabling Interrupts after Reset interrupts, including NMI, disabled immediately after reset. first program instruction, located address specified vector table, therefore always executed. prevent program crashes, this instruction should initialize stack pointer (example: MOV.W #xx:16, SP). After execution this instruction, interrupt enabled. Other interrupts remain disabled until their enable bits After reset exception handling, manipulation instruction executed contents before instruction that initializes stack pointer. After manipulation instruction executed, interrupts, including NMI, disabled. next instruction should instruction that initializes stack pointer. 4.3.1 Interrupts Overview There twelve input pins five external interrupt sources (NMI, IRQ0 IRQ2, IRQ6). There also internal interrupts originating on-chip. features these interrupts are: internal external interrupts except masked CCR. IRQ0 IRQ2 falling-edge-sensed level-sensed. type sensing selected each interrupt individually. edge-sensed, either rising falling edge selected. Interrupts individually vectored. software interrupt-handling routine does have determine what type interrupt occurred. IRQ6 requested eight external sources (KEYIN0 KEYIN7). KEYIN0 KEYIN7 masked individually user program. watchdog timer made generate interrupt interrupt according use. details, section Watchdog Timer. Table lists interrupts their order priority gives their vector numbers addresses their entries vector table. Table Interrupts (KEYIN0 KEYIN Address Entry Vector Table Priority H'0006 H'0007 H'0008 H'0009 H'000A H'000B H'000C H'000D H'000E H'0013 H'0014 H'0015 High Interrupt Source IRQ0 IRQ1 IRQ2 Reserved IRQ6 Reserved Host interface IBF1 (IDR1 reception complete) IBF2 (IDR2 reception complete) 16-bit free-running timer 8-bit timer OCIA OCIB FOVI (Input capture) (Output compare (Output compare (Overflow) H'0016 H'0021 H'0022 H'0023 H'0024 H'0025 H'0026 H'0027 H'0028 H'0029 H'002A H'002B H'002C H'002D H'002E H'002F H'0030 H'0031 H'0032 H'0033 H'0034 H'0035 H'0036 H'0037 H'0038 H'0039 H'003A H'003B H'003C H'003D H'003E H'003F H'0040 H'0041 H'0042 H'0043 H'0044 H'0045 H'0046 H'0047 H'0048 H'0049 CMI0A (Compare-match CMI0B (Compare-match OVI0 (Overflow) CMI1A (Compare-match CMI1B (Compare-match OVI1 (Overflow) ERI0 RXI0 TXI0 TEI0 ERI1 RXI1 TXI1 TEI1 (Receive error) (Receive end) (TDR empty) (TSR empty) (Receive error) (Receive end) (TDR empty) (TSR empty) 8-bit timer Serial communication interface Serial communication interface Reserved Watchdog timer Reserved Notes: H'004A H'0057 WOVF (WDT overflow) H0058 H'0059 H'005A H'0063 H'0000 H'0001 contain reset vector. H'0002 H'0005 reserved H8/3502 available user. 4.3.2 Interrupt-Related Registers interrupt-related registers system control register (SYSCR), sense control register (ISCR), enable register (IER), keyboard matrix interrupt mask register (KMIMR). Table Name System control register sense control register enable register Keyboard matrix interrupt mask register Registers Read Interrupt Controller Abbreviation SYSCR ISCR KMIMR Read/Write Address H'FFC4 H'FFC6 H'FFC7 H'FFF1 System Control Register (SYSCR)-H'FFC4 Initial value Read/Write SSBY STS2 STS1 STS0 XRST NMIEG RAME 2-Nonmaskable Interrupt Edge (NMIEG): Determines whether nonmaskable interrupt generated falling rising edge input signal. NMIEG Description interrupt generated falling edge interrupt generated rising edge (Initial value) section 3.2, System Control Register (SYSCR), information other SYSCR bits. Sense Control Register (ISCR)-H'FFC6 Initial value Read/Write IRQ6SC IRQ2SC IRQ1SC IRQ0SC Bits 6-IRQ0 IRQ2, IRQ6 Sense Control (IRQ0SC IRQ2SC, IRQ6SC): These bits select input pins IRQ0 IRQ2 KEYIN0 KEYIN7 sensed. IRQiSC Description level IRQ0 IRQ2 KEYIN0 KEYIN7 generates interrupt request falling edge IRQ0 IRQ2 KEYIN0 KEYIN7 generates interrupt request (Initial value) Enable Register (IER)-H'FFC7 Initial value Read/Write IRQ6E IRQ2E IRQ1E IRQ0E Bits 6-IRQ0 IRQ2 IRQ6 Enable (IRQ0E IRQ2E, IRQ6E): These bits enable disable IRQ1, IRQ2, IRQ6 interrupts individually. IRQiE Description IRQ0 IRQ6 disabled IRQ0 IRQ6 enabled (Initial value) When edge sensing selected setting bits IRQ0SC IRQ2SC IRQ6SC possible interrupt-handling routine executed even though corresponding enable (IRQ0E IRQ2E IRQ6E) cleared interrupt disabled. interrupt requested while enable (IRQ0E IRQ2E IRQ6E) request will held pending until served. enable cleared while request still pending, request will remain pending, although requests will recognized. interrupt mask cleared interrupt-handling routine executed even though enable execution interrupt-handling routines under these conditions desired, avoided using following procedure disable clear interrupt requests. CCR, masking interrupts. Note that automatically when execution jumps interrupt vector. Clear desired bits from IRQ0E, IRQ1E, IRQ2E, IRQ6E disable interrupt requests. Clear corresponding bits from IRQ0SC, IRQ1SC, IRQ2SC, IRQ6SC then them again. Pending IRQn interrupt requests cleared when CCR, IRQnSC IRQnE Keyboard Matrix Interrupt Mask Register (KMIMR) KMIMR 8-bit readable/writable register used keyboard matrix scanning sensing. enable key-sense input interrupts from more pins during keyboard scanning sensing, clear corresponding mask bits Initial value Read/Write KMIMR7 KMIMR6 KMIMR5 KMIMR4 KMIMR3 KMIMR2 KMIMR1 KMIMR0 Bits 0-Keyboard Matrix Interrupt Mask (KMIMR7 KMIMR0): These bits control key-sense input interrupt requests KEYIN7 KEYIN0. Bits KMIMR7 KMIMR0 Description Key-sense input interrupt request enabled. Key-sense input interrupt request disabled. (Initial value) Figure shows relationship between IRQ6 interrupt KMIMR. KMIMR0 P60/KEYIN0 IRQ6 internal signal KMIMR1 P61/KEYIN1 Edge/level select enable/ disable control IRQ6E IRQ6 interrupt KMIMR6 P72/KEYIN6 IRQ6SC KMIMR7 P73/KEYIN7 Initial values given parentheses Figure KMIMR IRQ6 Interrupt 4.3.3 External Interrupts There five external interrupts: NMI, IRQ2, IRQ6. These used return from software standby mode. NMI: highest-priority interrupt, always accepted regardless value CCR. Interrupts from edge-sensed: rising edge falling edge specified NMIEG SYSCR. exception handling vector number exception handling sets IRQ0 IRQ2 IRQ6: Interrupts IRQ0 IRQ2 requested input signals pins IRQ0 IRQ2. IRQ6 interrupt requested input signals pins KEYIN0 KEYIN7. Interrupts IRQ2 specified falling-edge-sensed level-sensed bits IRQ0SC IRQ2SC IRQ6SC ISCR. Interrupt requests enabled bits IRQ0E IRQ2E IRQ6E IER. Interrupts masked setting CCR. IRQ6 input signal generated logical key-sense inputs. When pins KEYIN0 KEYIN7 (P60 P73) used key-sense inputs, corresponding KMIMR bits should cleared enable corresponding key-sense interrupts. KMIMR bits corresponding unused key-sense inputs should disable those interrupts. eight key-sense input interrupts combined into single IRQ6 interrupt. When these interrupts accepted, IRQ0 IRQ2 have interrupt vector numbers They prioritized order from IRQ6 (low) IRQ0 (high). details, table 4-2. Interrupts IRQ2 depend whether pins IRQ0 IRQ2 KEYIN0 KEYIN7 used input pins output pins. When interrupts IRQ2 requested external signal, clear corresponding bits pins input/output pins. 4.3.4 Internal Interrupts Twenty-one internal interrupts requested on-chip supporting modules. them masked when set. addition, they enabled disabled bits control registers on-chip supporting modules. When these interrupts accepted, mask further interrupts (except NMI). vector numbers these interrupts priority order these interrupts, table 4-2. 4.3.5 Interrupt Handling Interrupts controlled interrupt controller that arbitrates between simultaneous interrupt requests, commands start hardware interrupt exception-handling sequence, furnishes necessary vector number. Figure shows block diagram interrupt controller. interrupt IRQ0 flag IRQ0E IRQ0 interrupt Priority decision Interrupt controller Interrupt request Vector number OVIE WOVF interrupt (CCR) Note: edge-sensed interrupts, these gates change circuit shown below. IRQ0 edge IRQ0E IRQ0 flag IRQ0 interrupt Figure Block Diagram Interrupt Controller interrupts interrupts from on-chip supporting modules (except reset selected watchdog timer overflow) have corresponding enable bits. When enable cleared interrupt signal sent interrupt controller, interrupt ignored. These interrupts also masked setting CPU's interrupt mask Accordingly, these interrupts accepted only when their enable cleared nonmaskable interrupt (NMI) always accepted, except reset state hardware standby mode. When another enabled interrupt requested, interrupt controller transfers interrupt request indicates corresponding vector number. (When more interrupts requested, interrupt controller selects vector number interrupt with highest priority.) When notified interrupt request, current instruction current hardware exception-handling sequence, starts hardware exception-handling sequence interrupt latches vector number. Figure flowchart interrupt (and reset) operations. Figure shows interrupt timing sequence case which software interrupt-handling routine on-chip stack on-chip RAM. interrupt request sent interrupt controller when interrupt occurs, when interrupt occurs input line on-chip supporting module provided enable that interrupt interrupt controller checks accepts interrupt request cleared only requests accepted; other interrupt requests remain pending. Among accepted interrupt requests, interrupt controller selects request with highest priority passes CPU. Other interrupt requests remain pending. When receives interrupt request, waits until completion current instruction hardware exception-handling sequence, then starts hardware exceptionhandling sequence interrupt latches interrupt vector number. hardware exception-handling sequence, first pushes onto stack. figure 4-6. stacked indicates address first instruction that will executed return from software interrupt-handling routine. Next masking further interrupts except NMI. vector address corresponding vector number generated, vector table entry this vector address loaded into program counter, execution branches software interrupt-handling routine address indicated that entry. Program execution Interrupt requested? NMI? IRQ0? IRQ1? WOVF? Pending Latch vector Save Reset Save Read vector address Branch software interrupt-handling routine Figure Hardware Interrupt-Handling Sequence (R7) Stack area SP(R7) CCR* (upper byte) (lower byte) Even address Before interrupt accepted Pushed onto stack After interrupt accepted Program counter CCR: Condition code register Stack pointer Notes: contains address first instruction executed after return. Registers must saved restored word access even address. Ignored return. Figure Usage Stack Interrupt Handling Although consists only byte, treated word data when pushed stack. hardware interrupt exception-handling sequence, identical bytes pushed onto stack make complete word. When popped from stack instruction, loaded from byte stored even address. byte stored address ignored. Interrupt accepted Interrupt priority decision. Wait Instruction Internal instruction prefetch processing Interrupt request signal Vector table fetch Stack Instruction prefetch (first instruction Internal interrupt-handling process- routine) Internal address Internal read signal Internal write signal Internal 16-bit data (10) Instruction prefetch address (Instruction executed. Address saved contents, becoming return address.) Instruction code (Not executed) Instruction prefetch address (Not executed) SP-2 SP-4 Vector address Start address interrupt-handling routine (contents vector) (10) First instruction interrupt-handling routine Figure Timing Interrupt Sequence 4.3.6 Interrupt Response Time Table indicates time that elapses from interrupt request signal until first instruction software interrupt-handling routine executed. Since H8/3502 accesses on-chip memory bits time, very fast interrupt service obtained placing interrupt-handling routines on-chip stack on-chip RAM. Table Number States before Interrupt Service Number States Reason wait Interrupt priority decision Wait completion current instruction*1 Save Fetch vector Fetch instruction Internal processing Total Notes: On-Chip Memory External Memory 12*2 12*2 These values apply current instruction EEPMOV instruction. wait states inserted external memory access, these values longer. internal interrupts. 4.3.7 Precaution Note that following type contention occur interrupt handling. When software clears enable interrupt disable interrupt, interrupt becomes disabled after execution clearing instruction. enable cleared BCLR instruction, example, interrupt requested during execution that instruction, instant when instruction ends interrupt still enabled, after execution instruction, hardware exception-handling sequence executed interrupt. higher-priority interrupt requested same time, however, hardware exception-handling sequence executed higher-priority interrupt interrupt that disabled ignored. Similar considerations apply when interrupt request flag cleared Figure shows example which OCIAE cleared write cycle TIER Internal address TIER address OCIA interrupt handling Internal write signal OCIAE OCFA OCIA interrupt signal Figure Contention between Interrupt Disabling Instruction above contention does occur enable flag cleared while interrupt mask Note Stack Handling word access, least significant address always assumed stack always accessed word access. Care should taken keep even value stack pointer (general register R7). PUSH MOV.W @-SP MOV.W @SP+, instructions push registers stack. Setting stack pointer value cause programs crash. Figure shows example damage caused when stack pointer contains address. H'FEFC H'FEFD H'FEFF instruction MOV.B R1L, @-R7 H'FEFF Stack accessed beyond lost PCH: PCL: R1L: Upper byte program counter Lower byte program counter General register Stack pointer Figure Example Damage Caused Setting Address Notes Key-Sense Interrupts H8/3502 incorporates key-sense interrupt function which used operating mode. When used mode other than slave mode (when host interface disabled), following points must noted. order key-sense interrupt function, necessary write KMIMR unmask relevant KEYIN pins. pull-up transistors provided pins P60, KMPCR must also written KMIMR KMPCR only accessed when SYSCR Consequently, chip slave mode during this period. slave mode, states vary. When KMIMR KMPCR initialization routine directly after reset External circuitry must used such that problem will caused irrespective whether host interface output pins retain high-impedance state output state. There four host interface output pins-GA20, HIRQ12, HIRQ1, HIRQ11-all which port function (input state) initially. There eight host interface pins, HDB7 HDB0; single-chip mode, these outputs when P76/IOR either one, both, P75/CS1 P45/CS2 pins low. expanded mode, these pins function data pins D0), therefore states vary. When KMIMR KMPCR other than initialization routine states host interface input pins, pins with which they multiplexed, vary result setting bit. P77/HA0, P76/IOR, P75/IOW, 5/CS1, P46/CS2, P37/HDB7 P30/HDB0 automatically become input pins pins. When particular used, designated port input expanded control pin, single-chip mode, necessary prevent occurrence level P76/IOR together with level P75/CS1 P46/CS2 pin, both. expanded mode, external space accessed when both 6/IOR/RD P75/CS1/AS driven automatically. Note that output values P44/HIRQ12, P43/HIRQ1, P42/HIRQ11 vary result. Section Wait-State Controller Overview H8/3502 on-chip wait-state controller that enables insertion wait states into cycles interfacing low-speed external devices. 5.1.1 Features Features wait-state controller listed below. Three selectable wait modes: programmable wait mode, auto-wait mode, wait mode Automatic insertion zero three wait states 5.1.2 Block Diagram Figure shows block diagram wait-state controller. Internal data Wait request signal WAIT Wait-state controller (WSC) WSCR Legend WSCR: Wait-state control register Figure Block Diagram Wait-State Controller 5.1.3 Input/Output Pins Table summarizes wait-state controller's input pin. Table Name Wait Wait-State Controller Pins Abbreviation WAIT Input Function Wait request signal access external addresses 5.1.4 Register Configuration Table summarizes wait-state controller's register. Table Name Wait-state control register Register Configuration Abbreviation WSCR Initial Value H'C8 Address H'FFC2 5.2.1 Register Description Wait-State Control Register (WSCR) WSCR 8-bit readable/writable register that selects wait mode wait-state controller (WSC) specifies number wait states. also controls frequency division clock signals supplied supporting modules. Initial value Read/Write CKDBL WMS1 WMS0 WSCR initialized H'C8 reset hardware standby mode. initialized software standby mode. Bits 6-Reserved: These bits cannot modified always read 5-Clock Double (CKDBL): Controls frequency division clock signals supplied supporting modules. details, section Clock Pulse Generator. 4-Reserved: This reserved, written read. initial value Bits 2-Wait Mode Select (WMS1 WMS0): These bits select wait mode. WMS1 WMS0 Description Programmable wait mode wait states inserted wait-state controller wait mode auto-wait mode (Initial value) Bits 0-Wait Count (WC1 WC0): These bits select number wait states inserted access external address areas. Description wait states inserted wait-state controller state inserted states inserted states inserted (Initial value) Wait Modes Programmable Wait Mode: number wait states selected bits inserted accesses external addresses. Figure shows timing when wait count (WC1 Address External address Read access Data Read data Write access Data Write data Figure Programmable Wait Mode Wait Mode: accesses external addresses, number wait states (TW) selected bits inserted. WAIT fall system clock last these wait states, additional wait state inserted. WAIT remains low, wait states continue inserted until WAIT signal goes high. wait mode useful inserting four more wait states, inserting different numbers wait states different external devices. Figure shows timing when wait count (WC1 additional wait state inserted WAIT input. Inserted wait count Inserted WAIT WAIT Address External address Read access Read data Data Write access Data Write data Note: Arrows indicate time sampling WAIT pin. Figure Wait Mode Auto-Wait Mode: WAIT low, number wait states (TW) selected bits inserted. auto-wait mode, WAIT fall system clock state, number wait states selected bits inserted. additional wait states inserted even WAIT remains low. auto-wait mode used easy interface low-speed memory, simply routing chip select signal WAIT pin. Figure shows timing when wait count WAIT Address External address External address Read access Data Read data Read data Write access Data Write data Write data Note: Arrows indicate time sampling WAIT pin. Figure Auto-Wait Mode Section Clock Pulse Generator Overview H8/3502 built-in clock pulse generator (CPG) consisting oscillator circuit, duty adjustment circuit, prescaler that generates clock signals on-chip supporting modules. 6.1.1 Block Diagram Figure shows block diagram clock pulse generator. XTAL EXTAL Oscillator circuit Duty adjustment circuit (system clock) (for supporting modules) Prescaler Frequency divider (1/2) CKDBL Figure Block Diagram Clock Pulse Generator Input external clock signal EXTAL pin, connect crystal resonator XTAL EXTAL pins. system clock frequency will same input frequency. This same system clock frequency supplied timers other supporting modules, divided two. selection made software, controlling CKDBL bit. 6.1.2 Wait-State Control Register (WSCR) WSCR 8-bit readable/writable register that controls frequency division clock signals supplied supporting modules. also controls wait-state insertion. WSCR initialized H'C8 reset hardware standby mode. initialized software standby mode. Initial value Read/Write CKDBL WMS1 WMS0 Bits 6-Reserved: These bits cannot modified always read 5-Clock Double (CKDBL): Controls frequency division clock signals supplied supporting modules. CKDBL Description undivided system clock supplied clock supporting modules (Initial value) system clock divided supplied clock supporting modules 4-Reserved: This reserved, written read. initial value Bits 2-Wait Mode Select (WMS1 WMS0) Bits 0-Wait Count (WC1 WC0) These bits control wait-state insertion. details, section Wait-State Controller. Oscillator Circuit external crystal connected across EXTAL XTAL pins, on-chip oscillator circuit generates system clock signal. Alternatively, external clock signal applied EXTAL pin. Connecting External Crystal Circuit Configuration: external crystal connected shown example figure Table indicates appropriate damping resistance AT-cut parallel resonance crystal should used. EXTAL XTAL Figure Connection Crystal Oscillator (Example) Table Damping Resistance Frequency (MHz) Crystal Oscillator: Figure shows equivalent circuit crystal resonator. crystal resonator should have characteristics listed table 6-2. XTAL EXTAL AT-cut parallel resonating crystal Figure Equivalent Circuit External Crystal Table External Crystal Parameters Frequency (MHz) (pF) crystal with same frequency desired system clock frequency Note Board Design: When external crystal connected, other signal lines should kept away from crystal circuit prevent induction from interfering with correct oscillation. figure 6-4. crystal load capacitors should placed close possible XTAL EXTAL pins. allowed Signal Signal XTAL EXTAL Figure Notes Board Design around External Crystal Input External Clock Signal Circuit Configuration: external clock signal input shown examples figure 6-5. example figure 6-5, external clock signal should kept high during standby. XTAL left open, make sure stray capacitance does exceed EXTAL External clock input XTAL Open Connections with XTAL left open EXTAL 74HC04 XTAL External clock input Connections with inverted clock input XTAL Figure External Clock Input (Example) External Clock Input: external clock signal should have same frequency desired system clock Clock timing parameters given table figure 6-6. Table Clock Timing ±10% Item pulse width external clock input High pulse width external clock input External clock rise time External clock fall time Clock pulse width Symbol Clock pulse width high Unit Figure 16-4 Test Conditions Figure tEXH tEXL EXTAL tEXr tEXf Figure External Clock Input Timing Table shows external clock output settling delay time, figure shows external clock output settling delay timing. oscillator circuit duty adjustment circuit have function adjusting waveform external clock input EXTAL pin. When specified clock signal input EXTAL pin, internal clock signal output fixed after elapse external clock output settling delay time (tDEXT). clock signal output fixed during tDEXT period, reset signal should driven maintain reset state during this time. Table External Clock Output Settling Delay Time (Conditions: Item External clock output settling delay time Symbol DEXT Unit Notes Figure Note: DEXT includes pulse width RESW) STBY EXTAL (internal external) tDEXT* Note: tDEXT includes pulse width (tRESW) tcyc Figure External Clock Output Settling Delay Time Timing Duty Adjustment Circuit When clock frequency above, duty adjustment circuit adjusts duty cycle signal from oscillator circuit generate system clock Prescaler frequency divider generates on-chip supporting module clock from system clock according setting CKDBL bit. prescaler divides frequency generate internal clock signals with frequencies from Section Ports Overview H8/3502 five 8-bit input/output ports, 7-bit input/output port, 6-bit input/output port. Table lists functions each port each operating mode. table indicates, port pins multiplexed, functions differ depending operating mode. Each port data direction register (DDR) that selects input output, data register (DR) that stores output data. manipulation instructions will executed port data direction registers, "Notes Manipulation Instructions" section 2.5.5, Manipulations. Ports drive load 90-pF capacitive load. Port (excluding port drive load 30-pF capacitive load. Ports drive LEDs (with 10-mA current sink). Ports drive Darlington transistor. Ports pins have built-in pull-ups. block diagrams ports, appendix Port Block Diagrams. Table Port Functions Expanded Modes Single-Chip Mode Mode General input/ output Port Port Description 8-bit port drive LEDs Built-in input pull-ups 8-bit port drive LEDs Built-in input pull-ups 8-bit port drive LEDs Built-in input pull-ups 8-bit port Pins Mode Lower address output Mode Lower address output general input Port Upper address output Upper address output general input General input/ output Port Data HDB7 Host interface data (HDB7 HDB0) general input/ output Port P47/GA Host interface control output (GA20) general input/ output output Host interface control input general input, output P45/TMRI1/ HIRQ12 P44/TMO1/ HIRQ1 P43/TMCI1/ HIRQ11 P42/TMRI0 P41/TMO0 P40/TMCI0 Host interface host interrupt request output (HIRQ12, HIRQ1, HIRQ11), 8-bit timer input/ output (TMCI0, TMO0, TMRI0, TMCI1, TMO1, TMRI1), general input/output Table Port Functions (cont) Expanded Modes Single-Chip Mode Mode Port Port Description 6-bit port Pins P55/SCK1 P54/RxD1 P53/TxD1 P52/SCK0 P51/RxD0 P50/TxD0 P66/IRQ2 P65/IRQ1 P64/IRQ0 P63/FTI/ KEYIN3 P62/FTOB/ KEYIN2 P61/FTOA/ KEYIN1 P60/FTCI/ KEYIN0 Mode Mode Serial communication interface input/output (TxD0, RxD0, TxD1, RxD1, 6-bit general input/output Port 7-bit port Built-in input pull-ups (P63 P60) IRQ2 IRQ0 general input/output 16-bit free-running timer input/output (FTCI, FTOA, FTOB, FTI) general input/output (Can also used key-scanning key-sense input (KEYIN3 KEYIN0)) Port 8-bit port buffer drive capability (P73 Built-in input pull-ups (P73 P70) P77/WAIT/ Expanded data control input/ output (WAIT, P76/RD/IOR P75/WR/IOW P74/AS/CS Host interface control input (HA0, IOR, IOW, general input/output P73/KEYIN7 P72/KEYIN6 P71/KEYIN5 P70/KEYIN4 General input/output (Can also used key-scanning key-sense input (KEYIN7 KEYIN4)) 7.2.1 Port Overview Port 8-bit input/output port with configuration shown figure 7-1. functions differ depending operating mode. Port built-in programmable input pull-ups that used modes Pins port drive load 90-pF capacitive load. They also drive LEDs Darlington transistors. Port pins P17/A7 P16/A6 P15/A5 Port P14/A4 P13/A3 P12/A2 P11/A1 P10/A0 configuration mode (expanded mode with on-chip disabled) (output) (output) (output) (output) (output) (output) (output) (output) configuration mode (expanded mode with on-chip enabled) (output)/P17 (input) (output)/P16 (input) (output)/P15 (input) (output)/P14 (input) (output)/P13 (input) (output)/P12 (input) (output)/P11 (input) (output)/P10 (input) configuration mode (single-chip mode) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) Figure Port Configuration 7.2.2 Register Configuration Descriptions Table summarizes port registers. Table Name Port data direction register Port data register Port input pull-up control register Port Registers Abbreviation P1DDR P1DR P1PCR Read/Write Initial Value Address H'FF (mode H'FFB0 H'00 (modes H'00 H'00 H'FFB2 H'FFAC Port Data Direction Register (P1DDR) Mode Initial value Read/Write Modes Initial value Read/Write P17DDR P16DDR P15DDR P14DDR P13DDR P12DDR P11DDR P10DDR P1DDR controls input/output direction each port Mode P1DDR values fixed Port consists lower address output pins. P1DDR values cannot modified always read hardware standby mode, address high-impedance state. Mode port used address output corresponding P1DDR general input this cleared Mode port used general output corresponding P1DDR general input this cleared modes P1DDR write-only register. Read data invalid. read, bits always read P1DDR initialized H'00 reset hardware standby mode. software standby mode retains existing values, transition software standby mode occurs while P1DDR corresponding remains output state. Port Data Register (P1DR) Initial value Read/Write P1DR 8-bit register that stores data pins P10. When P1DDR port read, value P1DR obtained directly, regardless actual state. When P1DDR cleared port read state obtained. P1DR initialized H'00 reset hardware standby mode. software standby mode retains existing values. Port Input Pull-Up Control Register (P1PCR) Initial value Read/Write P17PCR P16PCR P15PCR P14PCR P13PCR P12PCR P11PCR P10PCR P1PCR 8-bit readable/writable register that controls input pull-ups port P1DDR cleared (designating input) corresponding P1PCR input pull-up turned P1PCR initialized H'00 reset hardware standby mode. software standby mode retains existing values. 7.2.3 Functions Each Mode Port different functions different modes. separate description each mode given below. Functions Mode mode (expanded mode with on-chip disabled), port automatically used lower address output A0). Figure shows functions mode (output) (output) (output) Port (output) (output) (output) (output) (output) Figure Functions Mode (Port Mode mode (expanded mode with on-chip enabled), port provide lower address output pins, general input pins. Each becomes lower address output P1DDR general input this cleared Following reset, pins input pins. used address output output, their P1DDR bits must Figure shows functions mode When P1DDR (output) (output) (output) Port (output) (output) (output) (output) (output) When P1DDR (input) (input) (input) (input) (input) (input) (input) (input) Figure Functions Mode (Port Mode mode (single-chip mode), port provide general input/output pins. When used general input/output, input output direction each selected individually. becomes general input when P1DDR cleared When this corresponding becomes general output pin. Figure shows functions mode When P1DDR (input pin) when P1DDR (output pin) (input/output) (input/output) (input/output) Port (input/output) (input/output) (input/output) (input/output) (input/output) Figure Functions Mode (Port 7.2.4 Input Pull-Ups Port built-in programmable input pull-ups that available modes pull-up each turned individually. turn input pull-up mode corresponding P1PCR clear corresponding P1DDR P1PCR cleared H'00 reset hardware standby mode, turning input pull-ups off. software standby mode, previous state maintained. Table indicates states input pull-ups each operating mode. Table Mode States Input Pull-Ups (Port Reset Hardware Standby Software Standby On/off On/off Other Operating Modes On/off On/off Notes: Off: input pull-up always off. On/off: input pull-up P1PCR P1DDR otherwise. 7.3.1 Port Overview Port 8-bit input/output port with configuration shown figure 7-5. functions differ depending operating mode. Port built-in, software-controllable input pull-ups that used modes Pins port drive load 90-pF capacitive load. They also drive LEDs Darlington transistors. Port pins P27/A15 P26/A14 P25/A13 Port P24/A12 P23/A11 P22/A10 P21/A9 P20/A8 configuration mode (expanded mode with on-chip disabled) (output) (output) (output) (output) (output) (output) (output) (output) configuration mode (expanded mode with on-chip enabled) (output)/P27 (input) (output)/P26 (input) (output)/P25 (input) (output)/P24 (input) (output)/P23 (input) (output)/P22 (input) (output)/P21 (input) (output)/P20 (input) configuration mode (single-chip mode) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) Figure Port Configuration 7.3.2 Register Configuration Descriptions Table summarizes port registers. Table Name Port data direction register Port data register Port input pull-up control register Port Registers Abbreviation P2DDR P2DR P2PCR Read/Write Initial Value Address H'FF (mode H'FFB1 H'00 (modes H'00 H'00 H'FFB3 H'FFAD Port Data Direction Register (P2DDR) Mode Initial value Read/Write Modes Initial value Read/Write P27DDR P26DDR P25DDR P24DDR P23DDR P22DDR P21DDR P20DDR P2DDR controls input/output direction each port Mode P2DDR values fixed Port consists upper address output pins. P2DDR values cannot modified always read hardware standby mode, address high-impedance state. Mode port used address output corresponding P2DDR general input this cleared Mode port used general output corresponding P2DDR general input this cleared modes P2DDR write-only register. Read data invalid. read, bits always read P2DDR initialized H'00 reset hardware standby mode. software standby mode retains existing values, transition software standby mode occurs while P2DDR corresponding remains output state. Port Data Register (P2DR) Initial value Read/Write P2DR 8-bit register that stores data pins P20. When P2DDR port read, value P2DR obtained directly, regardless actual state. When P2DDR cleared port read state obtained. P2DR initialized H'00 reset hardware standby mode. software standby mode retains existing values. Port Input Pull-Up Control Register (P2PCR) Initial value Read/Write P27PCR P26PCR P25PCR P24PCR P23PCR P22PCR P21PCR P20PCR P2PCR 8-bit readable/writable register that controls input pull-ups port P2DDR cleared (designating input) corresponding P2PCR input pull-up turned P2PCR initialized H'00 reset hardware standby mode. software standby mode retains existing values. 7.3.3 Functions Each Mode Port different functions different modes. separate description each mode given below. Functions Mode mode (expanded mode with on-chip disabled), port automatically used upper address output (A15 A8). Figure shows functions mode (output) (output) (output) Port (output) (output) (output) (output) (output) Figure Functions Mode (Port Mode mode (expanded mode with on-chip enabled), port provide upper address output pins, general input pins. Each becomes upper address output P2DDR general input this cleared Following reset, pins input pins. used address output, their P2DDR bits must Figure shows functions mode When P2DDR (output) (output) (output) Port (output) (output) (output) (output) (output) When P2DDR (input) (input) (input) (input) (input) (input) (input) (input) Figure Functions Mode (Port Mode mode (single-chip mode) port provide general input/output pins. When used general input/output, input output direction each selected individually. becomes general input when P2DDR cleared When this corresponding becomes general output pin. Figure shows functions mode When P2DDR (input pin) when P2DDR (output pin) (input/output) (input/output) (input/output) Port (input/output) (input/output) (input/output) (input/output) (input/output) Figure Functions Mode (Port 7.3.4 Input Pull-Ups Port built-in programmable input pull-ups that available modes pull-up each turned individually. turn input pull-up mode corresponding P2PCR clear corresponding P2DDR P2PCR cleared H'00 reset hardware standby mode, turning input pull-ups off. software standby mode, previous state maintained. Table indicates states input pull-up transistors each operating mode. Table Mode States Input Pull-Ups (Port Reset Hardware Standby Software Standby On/off On/off Other Operating Modes On/off On/off Notes: Off: input pull-up always off. On/off: input pull-up P2PCR P2DDR otherwise. 7.4.1 Port Overview Port 8-bit input/output port that multiplexed with data host interface data bus. configuration shown figure 7-9. functions differ depending operating mode. Port built-in programmable input pull-ups that used mode Pins port drive load 90-pF capacitive load. They also drive Darlington transistor. Port pins P37/D7/HDB7 P36/D6/HDB6 P35/D5/HDB5 Port P34/D4/HDB4 P33/D3/HDB3 P32/D2/HDB2 P31/D1/HDB1 P30/D0/HDB0 configuration mode (single-chip mode) Master mode (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) configuration mode (expanded mode with on-chip disabled) mode (expanded mode with on-chip enabled) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) (input/output) configuration mode (single-chip mode) Slave mode HDB7 (input/output) HDB6 (input/output) HDB5 (input/output) HDB4 (input/output) HDB3 (input/output) HDB2 (input/output) HDB1 (input/output) HDB0 (input/output) Figure Port Configuration 7.4.2 Register Configuration Descriptions Table summarizes port registers. Table Name Port data direction register Port data register Port input pull-up control register Port Registers Abbreviation P3DDR P3DR P3PCR Read/Write Initial Value H'00 H'00 H'00 Address H'FFB4 H'FFB6 H'FFAE Port Data Direction Register (P3DDR) Initial value Read/Write P3DDR 8-bit readable/writable register that controls input/output direction each port P3DDR write-only register. Read data invalid. read, bits always read Modes mode (expanded mode with on-chip disabled) mode (expanded mode with on-chip enabled), input/output directions designated P3DDR ignored. Port automatically consists input/output pins 8-bit data D0). data high-impedance state during reset, during hardware software standby. Mode port used general output corresponding P3DDR general input this cleared P3DDR initialized H'00 reset hardware standby mode. software standby mode retains existing values, transition software standby mode occurs while P3DDR corresponding remains output state. Port Data Register (P3DR) Initial value Read/Write P3DR 8-bit register that stores data pins P30. When P3DDR port read, value P3DR obtained directly, regardless actual state. When P3DDR cleared port read state obtained. P3DR initialized H'00 reset hardware standby mode. software standby mode retains existing values. Port Input Pull-Up Control Register (P3PCR) Initial value Read/Write P37PCR P36PCR P35PCR P34PCR P33PCR P32PCR P31PCR P30PCR P3PCR 8-bit readable/writable register that controls input pull-ups port P3DDR cleared (designating input) corresponding P3PCR input pull-up turned P3PCR initialized H'00 reset hardware standby mode. software standby mode retains existing values. input pull-ups cannot used slave mode (when host interface enabled). 7.4.3 Functions Each Mode Port different functions different modes. separate description each mode given below. Functions Modes mode (expanded mode with on-chip disabled) mode (expanded mode with on-chip enabled), port automatically used input/output pins data D0). Figure 7-10 shows functions modes Modes (input/output) (input/output) (input/output) Port (input/output) (input/output) (input/output) (input/output) (input/output) Figure 7-10 Functions Modes (Port Mode mode (single-chip mode), port input/output port when host interface enable (HIE) system control register (SYSCR) cleared transition made slave mode, port becomes host interface data (HDB7 HDB0). slave mode, P3DR P3DDR should cleared H'00. Figure 7-11 shows functions mode (input/output)/HDB7 (input/output) (input/output)/HDB6 (input/output) (input/output)/HDB5 (input/output) Port (input/output)/HDB4 (input/output) (input/output)/HDB3 (input/output) (input/output)/HDB2 (input/output) (input/output)/HDB1 (input/output) (input/output)/HDB0 (input/output) Figure 7-11 Functions Mode (Port 7.4.4 Input Pull-Up Transistors Port built-in programmable input pull-ups that available mode pull-up each turned individually. turn input pull-up mode corresponding P3PCR clear corresponding P3DDR P3PCR cleared H'00 reset hardware standby mode, turning input pull-ups off. software standby mode, previous state maintained. Table indicates states input pull-ups each operating mode. Table Mode States Input Pull-Ups (Port Reset Hardware Standby Software Standby On/off On/off Other Operating Modes On/off On/off Notes: Off: input pull-up always off. On/off: input pull-up P3PCR P3DDR otherwise. 7.5.1 Port Overview Port 8-bit input/output port that multiplexed with host interface (HIF) input/output pins (GA20, CS2), host interrupt request output pins (HIRQ12, HIRQ1, HIRQ11), 8-bit timer input/output pins (TMRI0, TMRI1, TMCI0, TMCI1, TMO0, TMO1) clock output pin. Pins have same functions operating modes, slave mode function which enables host interface only valid single-chip mode. function differs depending operating mode. Figure 7-12 shows configuration port Pins port (except drive load 30-pF capacitive load. clock output drive load 90-pF capacitive load. Port pins also drive Darlington transistor. Port pins P47/GA20 P45/TMRI1/HIRQ12 Port P44/TMO1/HIRQ1 P43/TMCI1/HIRQ11 P42/TMRI0 P41/TMO0 P40/TMCI0 configuration mode (expanded mode with on-chip disabled) mode (expanded mode with on-chip enabled) (input/output) (output) (input/output)/TMRI1 (input) (input/output)/TMO1 (output) (input/output)/TMCI1 (input) (input/output)/TMRI0 (input) (input/output)/TMO0 (output) (input/output)/TMCI0 (input) configuration mode (single-chip mode) Master mode (input/output) (output) (input/output)/TMRI1 (input) (input/output)/TMO1 (output) (input/output)/TMCI1 (input) (input/output)/TMRI0 (input) (input/output)/TMO0 (output) (input/output)/TMCI0 (input) configuration mode (single-chip mode) Slave mode (input/output)/GA20 (output) (input) (input)/HIRQ12 (output)/TMRI1 (input) (input)/HIRQ1 (output)/TMO1 (output) (input)/HIRQ11 (output)/TMCI1 (input) (input/output)/TMRI0 (input) (input/output)/TMO0 (output) (input/output)/TMCI0 (input) Figure 7-12 Port Configuration 7.5.2 Register Configuration Descriptions Table summarizes port registers. Table Name Port data direction register Port data register Notes: Port Registers Abbreviation P4DDR P4DR Read/Write R/W*1 Initial Value H'40 (mode H'00 (mode Undetermined Address H'FFB5 H'FFB7 read-only. only undetermined; other bits Port Data Direction Register (P4DDR) Mode Initial value Read/Write Mode Initial value Read/Write P4DDR 8-bit register that controls input/output direction each port functions output corresponding P4DDR input this cleared However, modes P46DDR fixed cannot modified. P4DDR write-only register. Read data invalid. read, bits always read P4DDR initialized-to H'40 modes H'00 mode 3-by reset hardware standby mode. software standby mode retains existing values, transition software standby mode occurs while P4DDR corresponding remains output state. transition software standby mode occurs while port being used on-chip supporting module (for example, 8-bit timer output), on-chip supporting module will initialized, will revert general-purpose input/output, controlled P4DDR P4DR. Port Data Register (P4DR) Initial value Read/Write Note: Depends state pin. P4DR 8-bit register that stores data port pins P40. With exception P46, when P4DDR port read, value P4DR obtained directly. When P4DDR cleared port read state obtained. When read, state always obtained. This also applies clock output pins used on-chip supporting modules. P4DR bits other than initialized reset hardware standby mode. software standby mode, P4DR retains values prior mode transition. 7.5.3 Functions Port pins used 8-bit timer host interface input/output output. Table indicates functions port Table P47/GA Port Functions Functions Selection Method FGA20E HICR, 7DDR, operating mode select function follows P47DDR FGA20E Operating mode function input Other than slave mode output Slave mode GA20 output P46DDR operating mode select function follows Operating mode Modes P46DDR function clock output Mode Other than slave mode input clock output Slave mode input P45/TMRI1/ HIRQ12 P45DDR Operating mode function input Other than slave mode output TMRI1 input Slave mode HIRQ12 output TMRI1 input usable when bits CCLR1 CCLR0 both 8-bit timer Table P44/TMO1/ HIRQ1 Port Functions (cont) Functions Selection Method Bits TCSR 8-bit timer 4DDR, operating mode select function follows P44DDR Operating mode function input Other than slave mode output Slave mode HIRQ1 output TMO1 output P43/TMCI1/ HIRQ11 P43DDR Operating mode function input Other than slave mode output TMCI1 input Slave mode HIRQ11 output TMCI1 input usable when bits CKS2 CKS0 8-bit timer select external clock source P42/TMRI0 P42DDR function input TMRI0 input output TMRI0 input usable when bits CCLR1 CCLR0 both 8-bit timer Table P41/TMO0 Port Functions (cont) Functions Selection Method Bits TCSR 8-bit timer 1DDR select function follows P41DDR function input output TMO0 output P40/TMCI0 P40DDR function input TMCI0 input output TMCI0 input usable when bits CKS2 CKS0 8-bit timer select external clock source 7.6.1 Port Overview Port 6-bit input/output port that multiplexed with input/output pins (TxD RxD0, SCK0, TxD1, RxD1, SCK1) serial communication interfaces port functions same operating modes. Figure 7-13 shows configuration port Pins port drive load 30-pF capacitive load. They also drive Darlington transistor. Port pins (input/output)/SCK1 (input/output) (input/output)/RxD1 (input) Port (input/output)/TxD1 (output) (input/output)/SCK0 (input/output) (input/output)/RxD0 (input) (input/output)/TxD0 (output) Figure 7-13 Port Configuration 7.6.2 Register Configuration Descriptions Table 7-10 summarizes port registers. Table 7-10 Port Registers Name Port data direction register Port data register Abbreviation P5DDR P5DR Read/Write Initial Value H'C0 H'C0 Address H'FFB8 H'FFBA Port Data Direction Register (P5DDR) Initial value Read/Write P55DDR P54DDR P53DDR P52DDR P51DDR P50DDR P5DDR 8-bit register that controls input/output direction each port functions output corresponding P5DDR input this cleared P5DDR write-only register. Read data invalid. Bits reserved. read, bits always read P5DDR initialized H'C0 reset hardware standby mode. software standby mode retains existing values, transition software standby mode occurs while P5DDR corresponding remains output state. transition software standby mode occurs while port being used SC Other recent searchesTPS40190 - TPS40190 TPS40190 Datasheet MOS200904 - MOS200904 MOS200904 Datasheet M29F512B - M29F512B M29F512B Datasheet LBN05802 - LBN05802 LBN05802 Datasheet IDTQS3251 - IDTQS3251 IDTQS3251 Datasheet AP410 - AP410 AP410 Datasheet
Privacy Policy | Disclaimer |