General Notice When using this document, keep the following in mind: ntial 1. This document is confidential. By accepting this document you acknowledge that you are bound by the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in the possession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA immediately and return this document to SEGA. 2. This document may include technical inaccuracies or typographical errors. Changes are periodi- cally made to the information herein; these changes will be incorporated in new versions of the program(s) described in this document at any time. de document. SEGA may make improvements and/or changes in the product(s) and/or the 3. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document without SEGA’S written permission. Request for copies of this document and for technical information about SEGA products must be made to your authorized SEGA Technical Services representative. nfi 4. No license is granted by implication or otherwise under any patents, copyrights, trademarks, or other intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third party. describe herein. Co 5. Software, circuitry, and other examples described herein are meant merely to indicate the character- istics and performance of SEGA’s products. SEGA assumes no responsibility for any intellectual property claims or other problems that may result from applications based on the examples 6. It is possible that this document may contain reference to, or information about, SEGA products (development hardware/software) or services that are not provided in countries other than Japan. Such references/information must not be construed to mean that SEGA intends to provide such SEGA products or services in countries other than Japan. Any reference of a SEGA licensed prod- GA uct/program in this document is not intended to state or simply that you can use only SEGA’s licensed products/programs. Any functionally equivalent hardware/software can be used instead. 7. SEGA will not be held responsible for any damage to the user that may result from accidents or any other reasons during operation of the user’s equipment, or programs according to this document. NOTE: A reader's comment/correction form is provided with this document. Please address comments to : SE SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt) 150 Shoreline Drive, Redwood City, CA 94065 SEGA may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. (6/27/95- 002) TM ntial de nfi Co GA SCU User's Manual SE Third version Doc. # ST-97-R5-072694 © 1994 SEGA. All Rights Reserved. READER CORRECTION/COMMENT SHEET Keep us updated! nti If you should come across any incorrect or outdated information while reading through the attached document, or come up with any questions or comments, please let us know so that we can make the al required changes in subsequent revisions. Simply fill out all information below and return this form to the Developer Technical Support Manager at the address below. Please make more copies of this form if more space is needed. Thank you. General Information: Your Name Phone Document number Document name Corrections: Chpt. pg. # ST-97-R5-072694 SCU User's Manual Correction de Date nfi Co GA Questions/comments: SE Fax: Where to send your corrections: (415) 802-3963 Attn: Manager, Developer Technical Support Mail: SEGA OF AMERICA Attn: Manager, Developer Technical Support 275 Shoreline Dr. Ste 500 Redwood City, CA 94065 REFERENCES with the assistance of the technical literature listed below. nti In translating/creating this document, certain technical words and/or phrases were interpreted al 1. KenKyusha New Japanese-English Dictionary 1974 Edition 2. 3. 4. Nelson’s Japanese-English Character Dictionary 2nd revised version Microsoft Computer Dictionary Japanese-English Computer Terms Dictionary de Nichigai Associates 4th version nfi Co GA SE Version History Version 1: Version 2: April 7, 1994 • New draft May 31, 1994 ntial • Revisions according to April 28, 1994 meeting Version 3: July 15, 1994 • Revisions requested on June 30 and July 11, 1994 de nfi Co GA SE Introduction This manual explains functions of the system controller and how they are used. The system Explanation of Terms nti controller transfers data rapidly and smoothly by means of the bus controls. The following terms are used in this manual. al SCU System Control Unit. The SCU contains the CPU I/F, A-Bus IF, B-BUS I/F, and smoothly effects data transfers between several processors connected through Main CPU control, and processing of operations. de their respective I/F and bus. It also internally houses the DMA controller, interrupt controller, and DSP, and makes possible rapid DMA control, interrupt Uses a RISC type CPU SH2 that controls the overall system. SH2 contains 32-bit internal and external buses. VDP1 VDP2 nfi Video Display Processor 1. Functions include character and line painting, color indication, Gouraud Shading color operations, screen output coordinate indica- tion, and frame buffer display control. Video Display Processor 2. Functions include scrolling the screen up/down/ SCSP offset. Co left/right, rotating the screen, determining priority order of multiple screens, and a priority function that controls the image process of color operations and color Acronym for Saturn Custom Sound Processor. This is a sound source LSI for multi-functional games that combines a PCM sound source and sound used for the DSP. GA SE i SMPC System Manager and Peripheral Control. Has the functions of managing system resets, control of interfacing with output devices (control pads, mouse, etc.), time display by a real time clock, and battery backup. Data A_Bus nti A bit is the smallest unit for expressing 1 or 0. 8 bits is a byte. 16 bits (or 2 bytes) is a word. 32 bits (or 4 bytes) is a 9 long word. al Bus that connects external devices such as a ROM cassette or CD. B_Bus Bus that connects VDP1, VDP2, and SCSP. de nfi Co GA SE ii Manual Notations This manual contains the following notations. Binary Hexadecimal nti Represented by “B” at the end as in 100B. However, “B” may be omitted for 1 bit. Represented by H at the end as in 00H and FFH. al Unit 1 KByte is 1,024 bytes. 1 Mbit is 1,048,576 bits. MSB, LSB The configuration of byte and word shows at the left the high order bit Undefined Bit significant bit). de (MSB, most significant bit), and atthe right the low order bit (LSB, least A bit not defined by an instruction word is represented by “—” (R) (W) (R/W) nfi Represents read only data. Represents write only data. Represents data that can be read and written. ++ x=2-0 Co Shows increments. For example, when the CT0 register is incremented, it is shown as CT0++. This indicates that 3 types exist, 2,1, and 0. For example, DxR26-0[x=2-0] in the read address in section 3.2 “DMA Control Register” means that D2R26-0, D1R26-0, and D0R26-0 exist. Similarly, D2R26-0 indicates that D2R26 ~ D2R0 exist. GA SE iii CONTENTS INTRODUCTION nti Explanation of Terms .............................................................................. (i) Manual Notations .................................................................................. (iii) al List of Figures ................................................................................ (vii) List of Tables .................................................................................... (x) CHAPTER 1 OVERVIEW .......................................................................... 1 de 1.1 SCU Overview ........................................................................ 2 System Diagram ............................................................................. 2 Block Diagram ................................................................................ 3 1.2 SCU Mapping ......................................................................... 4 nfi Operation of Cache Hit ................................................................... 5 1.3 SCU Register Map ................................................................. 7 Level 2-0DMA Set Register ........................................................... 8 DMA Forced-Stop Register ........................................................... 8 DMA Status Register ......................................................................9 Co DSP Program Control Port ............................................................ 9 DSP Program RAM Data Port ..................................................... 10 DSP Data RAM Address Port ...................................................... 10 DSP Data RAM Data Port ............................................................ 10 Timer 0 Compare Register ........................................................... 11 Timer 1 Set Data Register ............................................................ 11 GA Timer 1 Mode Register ................................................................. 11 Interrupt Mask Register ................................................................ 12 Interrupt Status Register ...............................................................12 A-Bus Interrupt Acknowledge Register ........................................ 12 A-Bus Set Register ....................................................................... 13 A-Bus Refresh Register ................................................................ 13 SE SCU SDRAM Select Register ...................................................... 14 SCU Version Register ................................................................... 14 iv CHAPTER 2 OPERATION ............................................................... 15 2.1 DMA Transfer ....................................................................... 16 Basic Operation of DMA ...............................................................16 nti DMA Mode.................................................................................... 18 Example of a Specific Use ............................................................ 21 al 2.2 Interrupt Control .................................................................. 27 Blanking Interrupt ......................................................................... 29 Timer Interrupt .............................................................................. 30 DSP-End Interrupt ........................................................................ 33 Sound-Request Interrupt .............................................................. 33 de SMPC Interrupt ............................................................................. 33 PAD Interrupt ................................................................................ 33 DMA End Interrupt ........................................................................ 33 DMA-Illegal Interrupt ..................................................................... 33 Sprite Draw End Interrupt .............................................................33 nfi 2.3 DSP ....................................................................................... 34 DSP Control from the Main CPU ................................................. 34 CHAPTER 3 REGISTERS ............................................................... 39 Co 3.1 Register List ......................................................................... 40 3.2 DMA Control Registers ....................................................... 41 Level 2-0 DMA Set Register ........................................................ 41 DMA Mode, Address Update, Start Factor Select Register ......... 46 DMA Force-Stop Register ............................................................ 47 DMA Status Register ....................................................................47 3.3 DSP Control Ports ............................................................... 51 GA DSP Program Control Port .......................................................... 51 DSP Program RAM Data Port ..................................................... 53 DSP Data RAM Address Port ...................................................... 53 DSP Data RAM Data Port ............................................................ 54 3.4 Timer Registers ................................................................... 55 Timer 0 Compare Register .......................................................... 55 SE Timer 1 Set Data Register ............................................................ 55 Timer 1 Mode Register ................................................................. 56 v 3.5 Interrupt Control Registers ..................................................... 57 Interrupt Mask Register ................................................................ 57 nti Interrupt Status Register ...............................................................58 3.6 A-Bus Control Registers .......................................................... 61 A-Bus Interrupt Acknowledge Register ........................................ 61 al A-Bus Set Register ...................................................................... 62 A-Bus Refresh Register ................................................................ 72 3.7 SCU Control Registers .............................................................. 73 SCU SDRAM Select Register ...................................................... 73 SCU Version Register ................................................................... 73 de CHAPTER 4 DSP CONTROL .......................................................... 75 4.1 DSP Internal BLOCK MAP .................................................. 76 4.2 List of Commands ..................................................................... 80 4.3 Operand Execution Methods .............................................. 85 nfi Jump Command Execution ......................................................... 85 Loop Command Execution .......................................................... 86 DMA Command Execution .......................................................... 87 End Command Execution .............................................................88 Co 4.4 Special Process Execution ..................................................... 89 Loading a Program by the DMA Command ................................. 89 Repeating One Command ............................................................ 89 Executing a Subroutine Program ................................................. 90 4.5 More About Commands ............................................................ 91 Operation Commands .................................................................. 91 GA Load Immediate Command ....................................................... 120 DMA Command .......................................................................... 132 Jump Commands ....................................................................... 141 Loop Bottom Commands ............................................................ 153 END Command .......................................................................... 156 SE vi List of Figures (Chapter 1 Overview) nti Figure 1.1 Diagram of System .................................................................................... 2 Figure 1.2 Block Diagram ........................................................................................... 3 al Figure 1.3 SCU Mapping (Cache_address) ............................................................. 4 Figure 1.4 Explanation of Cache Hit Operation ........................................................ 5 Figure 1.5 SCU Mapping (Cache_through_address) ................................................. 6 Figure 1.6 SCU Register Map .................................................................................... 7 Figure 1.7 Level 2-0 DMA Set Register Map ............................................................. 8 de Figure 1.8 DMA Force-Stop Register Map .................................................................8 Figure 1.9 DMA Status Register Map ......................................................................... 9 Figure 1.10 DSP Program Control Port Map ............................................................. 9 Figure 1.11 DSP Program RAM Data Port Map ....................................................... 10 Figure 1.12 DSP Data RAM Address Port Map ....................................................... 10 nfi Figure 1.13 DSP Data RAM Data Port Map .............................................................10 Figure 1.14 Timer 0 Compare Register Map ............................................................ 11 Figure 1.15 Timer 1 Set Data Register Map ............................................................. 11 Figure 1.16 Timer 1 Mode Register Map .................................................................. 11 Figure 1.20 A-Bus Set Register Map Co Figure 1.17 Interrupt Mask Register Map ................................................................. 12 Figure 1.18 Interrupt Status Register Map ................................................................ 12 Figure 1.19 A-Bus Interrupt Acknowledge Map ....................................................... 12 .................................................................. 13 Figure 1.21 A-Bus Refresh Register Map ................................................................. 13 Figure 1.22 SCU SDRAM Select Register Map ....................................................... 14 Figure 1.23 SCU Version Register Map .................................................................. 14 GA (Chapter 2 Operation) Figure 2.1 DMA Transfer Basic Operation ................................................................ 16 Figure 2.2 DMA Transferable Area when Activacted from the Main CPU ................ 17 Figure 2.3 DMA Transferable Area when Activacted from the DSP ......................... 17 Figure 2.4 Direct Mode DMA Transfer Operation .................................................... 18 SE Figure 2.5 Indirect Mode DMA Transfer Flow .......................................................... 19 Figure 2.6 Indirect Mode DMA Transfer Operation Details ...................................... 20 Figure 2.7 Differences in DMA Operations according to the Address Update Bit .... 22 vii Figure 2.8 Example of Data Write ............................................................................ 23 Figure 2.9 Work RAM Area Contents ...................................................................... 24 Figure 2.12 Timer 0 Interrupt Process (compare register = when 19 is set) ........... 30 nti Figure 2.10 DMA Transfer by Setting Address Add Value ........................................ 26 Figure 2.11 Blanking Interrupt .................................................................................... 29 al Figure 2.13 Timer 1 Interrupt Process (In sync with Timer 0) .................................. 31 Figure 2.14 Timer 1 Interrupt Process (not in sync with Timer 0) ............................ 32 Figure 2.15 DSP Program Load Step 1 ....................................................................34 Figure 2.16 DSP Program Load Step 2 ....................................................................35 Figure 2.17 DSP Program Load Step 3 ....................................................................35 de Figure 2.18 DSP Data Access Step 1 ....................................................................... 36 Figure 2.19 DSP Data Access Step 2 ...................................................................... 37 Figure 2.20 DSP Data Access Step 3 ...................................................................... 37 Figure 2.21 DSP Program Execution Start Control from CPU ................................. 38 Figure 2.22 DSP Program Forced Stop Control from CPU ...................................... 38 (Chapter 3 Registers) nfi Figure 3.1 Level 2-0 Read Address (Register: D0R, D1R, D2R) ........................... 41 Figure 3.2 Level 2-0 Write Address (Register: D0W, D1W, D2W) ......................... 41 Co Figure 3.3 Level 0 Transfer Byte Number (Register: D0C) .................................... 42 Figure 3.4 Level 2-1 Transfer Byte Number (Register: D1C, D2C) ........................ 42 Figure 3.5 Level 2-0 Address Add Value (Register: D0AD, D1AD, D2AD) ............. 42 Figure 3.6 Communication Units between the SCU and Processor ........................ 44 Figure 3.7 Specific Example of Transfer between the SCU and Processor ............. 44 Figure 3.8 Write Address Add Value Indication ........................................................ 45 Figure 3.9 Level 2-0 DMA Authorization Bit (Register: D0EN, D1EN, D2EN) ....... 45 GA Figure 3.10 Level 2-0 DMA Mode, Address Update, Start Up Factor Select Register (Register: D0MP, D1MP, D2MP) ................................ 46 Figure 3.11 DMA Force-Stop Register (Register: DSTP) ...................................... 47 Figure 3.12 High and Low Level DMA Operation .................................................... 48 Figure 3.13 DMA Status Register (Register: DSTA) .............................................. 48 SE viii Figure 3.14 DSP Program Control Port (Register: PPAF) ..................................... 51 Figure 3.15 DSP Program RAM Data Port (Register: PPD) ................................... 53 Figure 3.18 Time 0 Compare Register nti Figure 3.16 DSP Data RAM Address Port (Register: PDA) .................................... 53 Figure 3.17 DSP Data RAM Data Port (Register: PDD) ........................................ 54 (Register: T0C) ....................................... 55 al Figure 3.19 Timer 1 Set Data Register (Register: T1S) ......................................... 55 Figure 3.20 Timer 1 Mode Register (Register: T1MD) ........................................... 56 Figure 3.21 Interrupt Mask Register (Register: IMS) ............................................. 57 Figure 3.22 Interrupt Status Register (Register: IST) ........................................... 58 Figure 3.23 A-Bus Interrupt Acknowledge Register (Register: AIAK) ...................... 61 de Figure 3.24 A-Bus Set [CS0, 1 Space] (Register: ASR0) ........................................ 62 Figure 3.25 A-Bus Set [CS2, Dummy Space] (Register: ASR1) ............................. 62 Figure 3.26 Result of Previous Read Process ......................................................... 63 Figure 3.27 Timing when Setting the Pre-Charge Insert Bit after Write ................... 63 Figure 3.28 Timing when Setting the Pre-Charge Insert Bit after Read .................. 64 nfi Figure 3.29 Differences in Timing by Setting External Wait Effective Bit ................. 64 Figure 3.30 A-Bus Refresh Register (Register: AREF) .......................................... 72 Figure 3.31 SCU SDRAM Select Bit (Register: RSEL) .......................................... 73 Figure 3.32 SCU Version Register (Register: VER) ................................................ 73 Chapter 4 DSP Control) Co Figure 4.1 DSP Internal Block Map ........................................................................... 77 Figure 4.2 Jump Command Execution ..................................................................... 85 Figure 4.3 Loop Program Execution ......................................................................... 86 Figure 4.4 Subroutine Program Execution ................................................................ 91 Figure 4.5 Operation Command Format ................................................................... 92 GA Figure 4.6 Load Immediate Command Format 1 (Unconditional Transfer) ........... 120 Figure 4.7 Load Immediate Command Format 2 (Conditional Transfer) ............... 120 Figure 4.8 DMA Command Format 1...................................................................... 132 Figure 4.9 DMA Command Format 2...................................................................... 132 Figure 4.10 Jump Command Format ...................................................................... 141 Figure 4.11 Loop Bottom Command Format ......................................................... 153 SE Figure 4.12 End Command Format ........................................................................ 156 ix List of Tables (Chapter 2 Operation) nti Table 2.1 Interrupt Factors ................................................................. 27 Table 2.2 Interrupt Factor General Names ........................................ 28 (Chapter 3 Registers) al Table 3.1 Register List ....................................................................... 40 Table 3.2 Read Address Add Value ................................................... 43 Table 3.3 Write Address Add Value ................................................... 43 de Table 3.4 Starting Factors .................................................................. 46 Table 3.5 RAM Page Select ...............................................................53 Table 3.6 Timer 1 Occurrence Selection Contents ............................ 56 Table 3.7 Timer Operation Contents ................................................. 56 Table 3.8 Interrupt Status Bit Contents ............................................. 59 nfi Table 3.9 A-Bus Interrupt Acknowledge Contents .............................. 61 Table 3.10 CS0 Space Burst Cycle Set Values .................................. 65 Table 3.11 CS0 Space Normal Cycle Set Values ............................... 65 Table 3.12 CS0 Space Burst Length Set Values ................................ 65 Co Table 3.13 CS0 Space Bus Size Set Values ...................................... 66 Table 3.14 CS1 Space Burst Cycle Set Values .................................. 67 Table 3.15 CS1 Space Normal Cycle Set Values ............................... 67 Table 3.16 CS1 Space Burst Length Set Values ................................ 68 Table 3.17 CS1 Space Bus Size Set Values ...................................... 68 Table 3.18 CS2 Space Burst Cycle Set Values .................................. 69 Table 3.19 CS2 Space Bus Size Set Values ...................................... 70 GA Table 3.20 Dummy Space Burst Cycle Set Values ............................. 71 Table 3.21 Dummy Space Normal Cycle Set Values ......................... 71 Table 3.22 Dummy Space Burst Length Set Values ........................... 71 Table 3.23 Dummy Space Bus Size Set Values ................................. 72 Table 3.24 A-Bus Refresh Wait Number ............................................. 72 SE x (Chapter 4 DSP Control) Table 4.1 List of Commands (1) ........................................................ 80 nti Table 4.2 List of Commands (2) ........................................................ 81 Table 4.3 List of Commands (3) ........................................................ 82 Table 4.4 List of Commands (4) ........................................................ 83 al Table 4.5 Descriptions of Constants .................................................. 84 Table 4.6 Features of Data Transfer from D0 Bus to DSP ................ 87 Table 4.7 Features of Data Transfer from DSP to D0 Bus ................ 88 de nfi Co GA SE xi CHAPTER 1 OVERVIEW Chapter 1 Contents ntial 1.1 SCU Overview ......................................................................2 1.2 1.3 de System Diagram ..................................................2 Block Diagram .....................................................3 SCU Mapping .......................................................................4 Operation of Cache Hit ......................................5 SCU Register Map................................................................ 7 nfi Level 2-0DMA Set Register ................................8 DMA Forced-Stop Register ................................8 DMA Status Register ..........................................9 DSP Program Control Port ................................9 Co DSP Program RAM Data Port .........................10 DSP Data RAM Address Port ..........................10 DSP Data RAM Data Port ................................10 Timer 0 Compare Register ............................... 11 Timer 1 Set Data Register ................................. 11 Timer 1 Mode Register ..................................... 11 Interrupt Mask Register ...................................12 GA Interrupt Status Register ..................................12 A-Bus Interrupt Acknowledge Register ........12 A-Bus Set Register .............................................13 A-Bus Refresh Register .....................................13 SCU SDRAM Select Register ...........................14 SCU Version Register ........................................14 SE SCU User's Manual 1 1.1 SCU Overview The SCU (System Control Unit) contains a CPU I/F, A-Bus I/F, and B-Bus I/F. It nti smoothly interfaces multiple processors connected through their respective I/Fs and buses. Also contained inside are the DMA controller, interrupt controller, and DSP. al The DMA controller controls the internal level 2-0 as well as DSP total 4 channel DMA transfer, and allows the free transfer of data between the CPU, A-Bus, and B- Bus. Using the CPU-Bus, the CPU can access the work area while executing the DMA of the A-Bus and B-Bus. The DSP region must be used in data transfer request from the DSP. For instance, DMA transfer with the A-Bus and B-Bus not using the DSP region cannot request that data be transfered from the DSP. de The interrupt controller includes interrupts from the A-Bus, B-Bus, and System Manager, and controls all interrupts within the SCU. It also supports interrupt by timers and can produce interrupts that are in sync with the screen. DSP can handle processes that cannot be handled by the main CPU when its load has been exceeded. DSP operates at half the frequency of the main CPU. As a result, one step takes about 70 nsec. System Diagram nfi A diagram of the system is shown in Figure 1.1. The Work RAM-H, Work RAM-L, Backup RAM, IPL ROM, and SMPC are connected to the CPU-Bus. The CPU-Bus controls the system reset signal and control pad. The medium that supplies the CD Co or cartridge software is an external system connected to the A-Bus. VDP1, VDP2, and SCSP are connected to the B-Bus and control picture and sound. INT Signal A-Bus Main SCU CPU GA CPU-Bus WORK WORK BACKUP RAM-H RAM-L RAM IPL ROM SMPC VDP1 B-Bus VDP2 SCSP SE Figure 1.1 Diagram of System 2 Block Diagram A block diagram of the SCU is shown in Figure 1.2. As previously mentioned, the CPU interface, A-Bus, and B-Bus interfaces, and the DMA controller, interrupt con- nected by buses, making transfer of data possible. nti troller, and DSP are contained in the SCU. All interfaces and controllers are con- al The CPU I/F and A-Bus I/F connections are through two buses. The upper bus is connected through the register. The lower bus is a connection used in transferring data. Therefore, DMA transfer is done using the lower bus. Main CPU SCU de INT nfi TIMER CPU CPU-Bus Co I/F A-Bus I/F A-Bus DSP DMA B-Bus GA I/F B-Bus SE Figure 1.2 Block Diagram SCU User's Manual 3 1.2 SCU Mapping Figure 1.3 shows the mapping operation. 00000000 H 00080000 H 00100000 H 00100080 H ROM Access Region SMPC Region ntial 512 Kbyte 128 byte 00180000 H Backup-RAM Region 64 Kbyte 00190000 H ~ External Area 1 Region ~ 00200000 H Work-RAM-L Region 1 Mbyte 00300000 H 01000000 H 01000004 H 01800000 H 01800004 H 02000000 H MINIT Region SINIT Region A-Bus CS0 Region de 4 byte 4 byte 32 Mbyte 04000000 H 05000000 H 05800000 H 05900000 H nfi A-Bus CS1 Region A-Bus Dummy Region A-Bus CS2 Region 16 Mbyte 8 Mbyte 1 Mbyte 1 Mbyte 05A00000 H 05B00EE4 H 05C00000 H 05CC0000 H 05D00000 H 05D00018 H 05E00000 H 05E80000 H Co Sound Region VDP 1 Region VDP 1 Region VDP 2 Region about 1 Mbyte 192 Kbyte 24 byte 512 Kbyte 05F00000 H VDP 2 Region 4 Kbyte 05F01000 H GA 05F80000 H VDP 2 Region 288 byte VDP 2 Region 05F80120 H 05FC0000 H 05FE0000 H SCU Register Region 208 byte 05FE00D0 H 06000000 H SCU Register Region Region Work RAM-H 1 Mbyte 06100000 H 07FFFFFF H Indicates areas that can't be accessed SE Figure 1.3 SCU Mapping (Cache_address) 4 Operation of Cache Hit If a hit is made to the cache during access to an area that is rewritable by non-CPU devices such as the work RAM of an I/O port, an external device, or a SCU register, cache-through area must be accessed. nti a value different from the actual value could be returned. When this happens, the al Figure 1.4 explains cache hit operations, and Figure 1.5 shows cach-through opera- tions. Data read from device B Cache CPU SCU A Device B Device de Reads address 5C00000 H. Data is FFFFFFFF H CPU can write data to cache Write from device A to B (DMA) Cache SCU nfiA Device B Device Cache does not change. Address 5C00000H clears to 0 CPU Co Accesses cache address area Cache A Device Accesses cache-through area Cache A Device SCU SCU B Device B Device GA CPU Address 5C00000H is read again. Data FFFFFFFF H inside cache becomes valid. CPU Reads again from device B without accessing the cache. Data is 0. Address is 25C00000H. arrow indicates the flow of data SE Figure 1.4 Explanation of Cache Hit Operation SCU User's Manual 5 20000000 H ROM Access Region 512 Kbyte 20080000 H 20100000 H 20100080 H 20180000 H 20190000 H 20200000 H 20300000 H SMPC Region Backup-RAM Region External Area 1 Region Work-RAM-L Region ~ ~ nti 128 byte al 64 Kbyte 1 Mbyte 21000000 H MINIT Region 4 byte 21000004 H 21800000 H SINIT Region 4 byte 21800004 H 22000000 H 24000000 H 25000000 H 25800000 H A-Bus CS0 A-Bus CS1 A-Bus Dummy de 32 Mbyte 16 Mbyte 8 Mbyte 25900000 H 25A00000 H 25B00EE4 H 25C00000 H 25CC0000 H 25D00000 H A-Bus CS2 nfi Sound Region VDP 1 Region 1 Mbyte 1 Mbyte about 1 Mbyte 192 Kbyte Co VDP 1 Region 24 byte 25D00018 H 25E00000 H VDP 2 Region 512 Kbyte 25E80000 H 25F00000 H VDP 2 Region 4 Kbyte 25F01000 H 25F80000 H VDP 2 Region 288 byte VDP 2 Region 25F80120 H 05FC0000 H 25FE0000 H SCU Register Region 208 byte 25FE00D0 H 26000000 H SCU Register Region Region Work RAM-H 1 Mbyte GA 26100000 H 27FFFFFF H Indicates areas that can't be accessed Figure 1.5 SCU Mapping (Cache_through_address) SE 6 1.3 SCU Register Map Figure 1.6 shows a map of the SCU register. The SCU register is assigned to the 25FE0000 H nti highest address in the SCU mapping region and, as shown in Figure 1.3, maintains a 208 byte area. Next, a map of each register region is shown. Level 0 DMA Set Register al 32 byte 25FE0020 H Level 1 DMA Set Register 32 byte 25FE0040 H 25FE0060 H de Level 2 DMA Set Register DMA Forced Stop 32 byte 16 byte 25FE0070 H 25FE0080 H 25FE0084 H 25FE0088 H nfi DMA Status Register DSP Program Control Port DSP Program RAM DataPort DSP Data RAM Address Port 16 byte 4 byte 4 byte 4 byte 25FE008C H 25FE0090 H 25FE0094 H 25FE0098 H 25FE009C H 25FE00A0 H CoDSP Data RAM DataPort Timer 0 Compare Register Timer 1 Set Data Register Timer 1 Mode Register Free Interrupt Mask Register 4 byte 4 byte 4 byte 4 byte 4 byte 4 byte 25FE00A4 H Interrupt Status Register 4 byte 25FE00A8 H A-Bus Interrupt Acknowledge 4 byte GA 25FE00AC H 25FE00B0 H 25FE00B8 H 25FE00BC H Free A-Bus Set Register A-Bus Refresh Register Free 4 byte 8 byte 4 byte 8 byte 25FE00C4 H SCU SDRAM Select Register 4 byte SE 25FE00C8 H SCU Version Register 25FE00CC H 25FE00CF H Free Figure 1.6 SCU Register Map 4 byte 4 byte SCU User's Manual 7 Level 2-0 DMA Set Register Figure 1.7 is a map of the Level 2-0 DMA set register. Parameters required for DMA transfer are stored in this register. There are three DMA levels (from level 0 to level Figure 1.7 are shown as relative addresses. nti 2), as there are in the SCU register map (Figure 1.6). As a result, the addresses in 00 H 04 H 31 24 16 Read Address (in bytes) Write Address (in bytes) 8 al 0 (R/W) (R/W) 08 H Transfer byte number (in bytes) (R/W) 0C H 1 2 (W) 10 H 14 H 18 H 1C H 5 6 3 7 de 8 4 (W) (W) Inside graphic: nfi 1. Read address add value 5. DMA mode bit (=0:Direct Mode / =1:Indirect Mode) 2. Write address add value 6. Read address update bit (=0:Save / =1:Revise) 3. DMA enable bit (=0:Disable / =1:Enable) 7. Write address update bit (=0:Save / =1:Update ) 4. DMA starting bit 8. DMA start factor select bit DMA Force-Stop Register Co Figure 1.7 Level 2-0 DMA Set Register Map Figure 1.8 is a map of the DMA force-stop register. This register has a bit that forces the DMA operation to stop. However, if the DMA is forced to stop, it can no longer be used. This register should not be used except for debugging. 25FE0060 H GA 31 Inside graphic: 1. DMA force-stop bit (=1:DMA force-stop) 0 1 (W) Figure 1.8 DMA Force-Stop Register Map SE 8 DMA Status Register Figure 1.9 is a map of the DMA status register. This register shows level 2-0 condition status. 25FE007C H Inside graphic: 31 24 1 2 3 16 4 5 1. DMA DSP-Bus access flag (=0: no access /=1:access) 6 7 nti 8 8 9 al 1011 0 1213 (R) 2. DMA B-Bus access flag (=0: no access / =1:access) 8. Level 1 DMA standby (=0:stop/=1:standby) 3. DMA A-Bus access flag (=0: no access / =1:access) 9. Level 1 DMA in operation (=0:stop/=1:operate) 4. Level 1 DMA interrupt(=0:stop/=1:interrupt) 10. Level 0 DMA stand by (=0:stop/=1:standby) 5. Level 0 DMA interrupt(=0:stop/=1:interrupt) 11. Level 0 DMA in operation (=0:stop/=1:operate) 6. Level 2 DMA standby (=0:stop/=1:standby) 7. Level 2 DMA in operation (=0:stop/=1:operate) DSP Program Control Port de 12. DSP side DMA in stand by (=0:stop/=1:standby) 13. DSP side DMA in operation (=0:stop/=1:operate) Figure 1.9 DMA Status Register Map 31 nfi Figure 1.10 is a map of the DSP program control port. This is the DSP control register. It stores both the DSP operation start address and end address. 26 24 16 15 7 0 25FE0080 H Inside graphic: Co 12 3 4 5 6 7 8 91011 Prog RAM address (R/W) 1. EX = cancels pause briefly (=0: no execute/=1:execute) 7. Overflow flag 2. EX = executes pause briefly (=0: no execute/=1:execute) 8. Program end interrupt flag 3. D0 bus use DMA transfer execution flag 4. Sine flag 9. Program step execute control bit (=0:no execute/=1:execute) 5. Zero flag 10. Program execute control (=0:stop/=1:execute) 6. Carry flag 11. Program counter load authorization (=0:no execute/=1:execute) GA Figure 1.10 DSP Program Control Port Map SE SCU User's Manual 9 DSP Program RAM Data Port Figure 1.11 is a map of the DSP program RAM data port. This port is used as a go-between when transferring program data from the CPU to the DSP. 05FE0084 H 31 Program RAM Data Figure 1.11 DSP Program RAM Data Port Map ntial 0 (W) DSP Data RAM Address Port Figure 1.12 is a map of the DSP data RAM address port. This port indicates the data RAM address while accessing the data RAM inside DSP from the CPU. 05FE0088 H 31 de Figure 1.12 DSP Data RAM Address Port Map 7 0 Data RAM Address (W) DSP Data RAM Data Port nfi Figure 1.13 is a map of the DSP data RAM data port. The content of the address shown by the DSP data RAM address port is stored. Data written from the CPU is stored in the DSP data RAM and data read from the CPU can fetch RAM data inside the DSP. 05FE008C H 31 Co Data RAM Data Figure 1.13 DSP Data RAM Data Port Map 0 (R/W) GA SE 10 Timer 0 Compare Register Figure 1.14 is the map of the timer 0 compare register. Timer 0 gets in sync with V- Blank-IN interrupt (See 2.2 Interrupt Control) and causes interrupt to occur. The opera- 05FE0090 H 31 nti tion is explained in section 2.2 and the register contents are explained in chapter 3. al 9 Figure 1.14 Timer 0 Compare Register Map Counter Value 0 (W) Timer 1 Set Data Register Figure 1.15 is the map timer 1 set data register. Timer 1 is data-set by H-Blank-IN inter- explained in chapter 3. de rupt (See 2.2 Interrupt Control) and decremented by 7 MHz cycles. Interrupt occurs when data is 0. The operation is explained in section 2.2 and the register contents are 05FE0094 H 31 8 Set Data 0 (W) Timer 1 Mode Register nfi Figure 1.15 Timer 1 Set Data Register Map Figure 1.16 is a map of the timer 1 mode register. This register indicates the timing by 05FE0098 H 31 Co which Time 1 is generated. The operation is explained in section 2.2 and the register contents are explained in chapter 3. 8 0 2 (W) Inside graphic: 1. Timer 1 mode bit =0:occurs at each line GA 2. Time operation enable bit =1:occurs only for lines designated by timer 0 =0: Timer operation OFF =1 : Timer operation ON Figure 1.16 Timer 1 Mode Register Map SE SCU User's Manual 11 Interrupt Mask Register Figure 1.17 shows the map of the interrupt mask register. When this bit is 0, interrupt is not masked and occurs as needed. When the bit is 1, interrupt will not occur be- to bit 13 (inside graphic, no. 2). nti cause it is masked. Chapter 3 has more information about bit 0 (inside graphic, no. 15) 05FE00A0 H 31 15 1 al 0 2 3 4 5 6 7 8 9 10 1112131415 (W) Inside graphic: 1. A-Bus interrupt mask bit 2~15 Interrupt mask bit Interrupt Status Register de Figure 1.17 Interrupt Mask Register Map Figure 1.18 shows the map of the interrupt status register. Because this register is able to read and write, when reading it shows that interrupt won’t occur when bit data is 0, about this register. nfi and will occur when bit data is 1. When writing, interrupt is reset if 0 is written, and maintains the current interrupt status when 1 is written. See chapter 3 for details 31 0 Co 05FE00A4 H 1 2 3 4 5 6 7 8 9 10 1112131415 16 1718192021222324252627282930 (R/W) Inside graphic: 1~30 Interrupt status bit Figure 1.18 Interrupt Status Register Map GA A-Bus Interrupt Acknowledge Register Figure 1.19 shows a map of the A-Bus interrupt acknowledge. This is a read/write bit that has different meanings when reading vs. when writing. See chapter 3 for details. 31 0 25FE00A8 H 1 (R/W) SE Inside graphic: 1. READ: A-Bus interrupt acknowledge significant bit (=0:insignificant / =1:significant) WRITE: A-Bus interrupt acknowledge significant bit (=0:insignificant / =1:significant) Figure 1.19 A-Bus Interrupt Acknowledge Register Map 12 A-Bus Set Register Figure 1.20 shows the map of the A-Bus set register. Each pre-read significant bit, significant at 1. See chapter 3 for more information. nti precharge insertion bit, and external wait significant bit is insignificant at 0 and 31 25FE00B0 H 1 2 3 4 5 6 7 8 9 10 1112 1314 25FE00B4 H 31323334 3536 al 1516171819 20 212223242526272829 3738394041424344 454647484950 51 0 30 (W) 52 (W) Inside graphic: 1. CS0 space, pre-read significant bit 31. CS2 space, pre-read significant bit 4. CS0 space, external wait significant bit de 2. CS0 space, precharge insertion bit after write 3. CS0 space, precharge insertion bit after read 5~8. CS0 space, burst cycle wait no. set 9~12. CS0 space, single cycle wait no. set 13~14. CS0 space, burst length set 15. CS0 space, bus size set bit (0=16bit 1=8bit) 32. CS2 space, precharge insertion bit after write 33. CS2 space, precharge insertion bit after read 34. CS2 space, external wait significant bit 35~36. CS2 space, burst length set bit 37. Bus size set bit (0=16 bit 1=8 bit) 38. Spare space, pre-read significant bit 39. Spare space, precharge insertion after write nfi 16. CS1 space, pre-read significant bit 17. CS1 space, precharge insertion bit after write 18. CS1 space, precharge insertion bit after read 19. CS1 space, external wait significant bit 20~23. CS1 space, burst cycle wait no. set 24~27. CS1 space, normal cycle wait no. set 40. Spare space, precharge insertion after read 41. Spare space, external wait significant bit 42~45. Spare space, burst cycle wait no. set bit 46~49. Spare space, normal cycle wait no. set bit 50~51. Spare space, burst length set bit 52. Spare space, bus size set bit (0=16bit 1=8bit) A-Bus Refresh Register Co 28~29. CS1 space, burst length set bit 30. CS1 space, bus size set bit (0=16bit 1=8bit) Figure 1.20 A-Bus Set Register Map Figure 1.21 shows the map of the A-Bus refresh register. This register performs the settings for A-Bus refresh. GA 25FE00B8 H 31 Inside graphic: 4 0 1 2 3 4 5 (W) 1. A-Bus refresh output significant bit (=0:insignificant / =1:significant) 2~5. A-Bus refresh wait number set bit SE Figure 1.21 A-Bus Refresh Register Map SCU User's Manual 13 SCU SDRAM Select Register Figure 1.22 shows the map of the SCU SDRAM select register. 25FE00C4 H 31 Inside graphic: ntial 0 1 (R/W) 1. Work-SDRAM select bit (=0:2 Mbit x2 / =1:4 Mbit x 2) Figure 1.22 SCU SDRAM Select Register Map SCU Version Register Figure 1.23 shows the map of the SCU version register. 25FE00C8 H 31 de 0 nfi Inside graphic: 1~4. Version number‘ Figure 1.23 SCU Version Register Map 1 2 3 4 (R) Co GA SE 14 CHAPTER 2 OPERATION 2.1 Chapter 2 Contents ntial DMA Transfer .......................................................................................16 Basic Operation of DMA ...........................................................16 DMA Mode .................................................................................18 2.2 de Example of A Specific Use ........................................................21 Interrupt Control ..................................................................................27 Blanking Interrupt ......................................................................29 Timer Interrupt ...........................................................................30 DSP-End Interrupt .....................................................................33 nfi Sound-Request Interrupt ...........................................................33 SMPC Interrupt ..........................................................................33 PAD Interrupt .............................................................................33 DMA End Interrupt ...................................................................33 2.3 Co DMA-Illegal Interrupt ...............................................................33 Sprite Draw End Interrupt ........................................................33 DSP .......................................................................................................34 DSP Control from the Main CPU .............................................34 GA SE SCU User's Manual 15 2.1 DMA Transfer Basic Operation of DMA can be executed. nti Figure 2.1 shows basic DMA operation. This DMA is basically long word access through the DMA controller buffer, but if the start address and end address are not in long word boundaries, reads and writes are made in byte units, and DMA transfer al Figure 2.1 is an example of DMA transfer from transfer source address 1H - 50H to transfer destination address 6H - 55H. However, since the long word boundary in the transfer source is 4H, 1H - 3H is read in byte units. Since the long word bound- ary in the transfer destination is 8H, the first 2 bytes of read data are written to 6H - 7H in byte units. Moreover, the transfer source end address is 50H, but since the Source de long word boundary is up to 4FH, the data in 50H is read in byte units. On the other hand, since the transfer destination end address is 55H but the long word boundary is up to 53H, the last two bytes read are written to 54H - 55H in byte units. read Buffer write Destination 1H 2H 3H 4H 1st byte 2nd byte 3rd byte 4th byte 5th byte nfi 1st byte 2nd byte 3rd byte 4th byte 5th byte 6H 7H 8H 9H 1st byte 2nd byte 3rd byte 4th byte 5th byte Co 5H AH 6th byte 6th byte 6th byte 6H BH 7th byte 7th byte 7th byte 7H CH 8th byte 8th byte 8th byte 8H DH 9th byte 9th byte 9th byte 9H EH ~ ~ ~ ~ ~ ~ 75th byte 75th byte 75th byte GA 4BH 50H 76th byte 76th byte 51H 76th byte 4C H 77th byte 77th byte 77th byte 4D H 52H 78th byte 78th byte 78th byte 4EH 53H 79th byte 79th byte 79th byte 4F H 54H 80th byte 80th byte 55H 80th byte 50H SE Access in long word units Figure 2.1 DMA Transfer Basic Operation Access in bytes 16 There are two methods of activating the SCU’s DMA transfer control. 1) activate DMA from the Main CPU 2) activate DMA from the DSP nti Figure 2.2 shows the DMA transferable area when activated from the main CPU. Figure 2.3 shows the DMA transferable area when activated from the DSP. al Work RAM-H Area A-Bus Connection Processor de B-Bus Connection Processor nfi Figure 2.2 DMA Transferable Area when activated from the Main CPU DSP Area A-Bus Connection Co B-Bus Connection Work RAM-H Area Processor Processor GA Figure 2.3 DMA Transferable Area when activated from the DSP SE SCU User's Manual 17 DMA Mode The SCU DMA mode has the following two modes: 1) Direct Mode 2) Indirect Mode Direct Mode ntial Data is transferred only in byte numbers shown as transfer byte numbers directly using address values of separate level DMA set registers, and from the address memory shown by the read address register to the address memory shown by the written address register. One transfer is implemented per start up, then DMA ends. Figure 2.4 shows the DMA transfer operation of the direct mode. DMA Set Register Read Address Write Address Transfer Byte Number de Address Add Value nfi DMA Authorization Bit Mode, Update, Select Read Address Co Transfer Source . . Write Address DMA Transfer Transfer Destination . . . . . . GA Figure 2.4 Direct Mode DMA Transfer Operation Map SE 18 Indirect Mode The indirect mode implements DMA transfer by indirectly using the DMA set regis- ter at a level different from the Direct mode mentioned earlier. The address value Indirect mode DMA. nti and byte number stored by the Direct mode in the set register are stored in the indirect mode temporary buffer by the Indirect mode, and DMA transfer is repeated until the end code is detected. Thus, the Indirect mode can implement more than al one DMA transfer when activated once. Figure 2.5 shows the execution flow of Indirect Mode DMA Parameters used for transfer are copied in a temporary buffer de nfi End Code Exists N Co Y DMA Transfer DMA Transfer GA End SE Figure 2.5 Indirect Mode DMA Transfer Flow SCU User's Manual 19 When the Indirect mode is activated, parameters of a 3 long word segment from the address first written in the write address register (DxW) is read and stored in a temporary buffer. Next, the actual DMA is executed using the parameters. On executed. This operation is repeated until the end code is detected. nti completion of DMA, the address parameters of DxW+CH are read and similarly The indirect mode address is incremented in 4 byte units. DMA Set Register Write Address Address al Execute Address Storage Buffer Address Add Value (DxW) First Read Address DMA Authorization Bit First Write Address Mode, Update, Select (DxW+CH) Write Address de First Transfer Byte Number Second Read Address Second Write Address Second Transfer Byte Number (DxW+C(N-1)H) End Code nfi ~ nth Write Address nth Transfer Byte Number ~ Co Temporary Buffer Read Address Write Address Transfer Byte Number GA Transfer Source Transfer Destination Read 1st DMA Transfer Write Address 1 Address 1 Read 2nd DMA Transfer Write Address 2 Address 2 Read 3rd DMA Transfer Write Address 3 Address 3 SE End of DMA Transfer Figure 2.6 Indirect Mode DMA Transfer Operation Details 20 Example of a Specific Use Direct Mode A 1 Kbyte transfer can be thought of as level 0 DMA from address 2000000H (A-Bus 1) nti area) to address 6000000H (work RAM). DMA (direct mode) can be executed when operating in accordance with the following procedures. 2) al Write the read address (200000H) to the read address register D0R. (Loads the address that is read to address 25EF0000H from the CPU.) Write the write address (6000000H) to the write address register D0W. (Loads the address that is written to address 25EF0004H from the CPU.) 3) Write the transfer byte number (400H) to transfer byte number register D0C. (Loads the transfer byte number from the CPU to address 25EF0008H.) 4) 5) de Write the address add value (101H) to address add value register D0AD. (Loads the address add value from the CPU to address 25EF000CH. Details of the address add value are listed in the address add value of this section. The address add value indicated in the normal DMA is 101H. ) The DMA mode is 0, and the address update bit and DMA start factor are set as necessary and written to mode/address/update/DMA start factor register 6) nfi D0MD. For example, when address update is handled as the save mode and V-Blank-IN is handled as the start factor, 0 is written to D0MD. (Loads 0 in address 25EF0014H from the CPU.) Set 1 in the DMA enable bit. When the start factor set by step 5) occurs, DMA is activated and 1 Kbyte of data is transferred by level 0 from address 2000000H 7) Co (A-Bus area) to address 6000000H (work RAM). After DMA has ended, DMA is activated each time the start factor set in step 5) occurs. The operation at that time changes according to the values of the read address update bit (D0RUP) and write address update bit (D0WUP). Figure 2.7 shows DMA operation changes by the address update bit. Steps 1) to 5) do not have to be done in the same order. (When the start factor is set in the DMA starting bit, DMA starts each time the DMA operation bit is set to 1 by GA the CPU.) SE SCU User's Manual 21 When D0RUP=0 and D0WUP=0 2000000 H 6000000 H 20003FF H When D0RUP=0 and D0WUP=1 2000000 H 60003FF H 6000000 H ntial 20003FF H 6000400 H When D0RUP=1 and D0WUP=0 2000000 H de6000000 H 2000400 H nfi 60003FF H 2000000 H Co When D0RUP=1 and D0WUP=1 2000400 H 6000000 H 6000400 H GA First DMA transfer Second DMA transfer Figure 2.7 Differences in DMA Operations according to the Address update Bit When the read address update bit is 0, the same address is referred to (read to) both SE the first and second time. When the read address update bit is 1, the second read starts after the address following the first read. When the write address update bit is 0, write is executed to the same address for both the first and second time. When the write address update bit is 1, the second write starts after the address following the first write. 22 Indirect Mode The Indirect mode is used when executing DMA transfer more than once by starting once. The Indirect mode is not set in a register as is the Direct mode, but uses a executed at level 0 through work RAM area (6000000H). nti method of executing DMA by accessing the register through RAM. For example, consider a case in which three DMA transfers are to be continuously (consecutively) (a) 20HByte DMA transfer from 4000000H to 5C00000H (b) 10HByte DMA transfer from 5E00000H to 6080000H (c) 15HByte DMA transfer from 5A00000H to 6081000H al DMA (Indirect mode) can be executed if operated in accord with the following steps. 1) As shown in Figure 2.8, data is written in long word units from the work RAM area (6000000H). 6000000H de 4 00 0 00 0 H 5 C0 0 00 0 H 2 0H 600000CH 6000018H nfi 5 E00 0 00 H 6 08 0 00 0 H 1 0H 5 A00 0 00 H 6 08 1 00 0 H Co 6000024H 8 00 0 00 1 5H Figure 2.8 Example of Data Write 2) DMA parameter source address (6000000H) is written to the write address register (D0W). GA 3) The address add value (101H) is loaded to the address add value register D0AD. (The address add value is written from the CPU to address 25FE000CH.) Infor- mation on the address add value is described in the address add value of this section. The address add value indicates 101H in normal DMA. 4) The DMA mode is 1 and the address update bit and DMA start factor are set as required and written to mode/address/update /DMA start factor register D0MP. For example, when address update is handled as the retain mode and V-Blank- SE IN is handled as the start factor, 1000000H is written to D0MD. (Loads 1000000H in address 25FE0014H from the CPU.) SCU User's Manual 23 5) “1” is set in the DMA enable bit, DMA is activated when the start factor set by step 4) occurs. DMA transfer (a) to (c) is executed in order until the DMA end code is detected. The DMA end code is the end notification code of the DMA long as “1” of this bit remains undetected. nti indirect mode that exists only in the work RAM area. DMA transfer continues as al Steps 1) to 4) do not need to be done in the same order. The read address register (D0R), transfer byte number register (D0C), and address add value register (D0AD), which must be set in the Direct mode, do not need to be set in the Indirect mode. When the DMA transfers listed below are registered in memory, DMA transfer is restarted after the above process ends. Restart can be done only by repeating the operation in step (4) above. (d) 30HByte DMA transfer from 5000000H to 6100000H. (e) 25HByte DMA transfer from 5100000H to 6200000H. de The contents from the work RAM area 6000000H are shown below in Figure 2.9. DMA starts each time the start factor set by (5) occurs. 6000000H 600000CH nfi 4 00 0 00 0 H 5 C0 0 00 0 H 2 0H 5 E00 0 00 H 6000018H 6000024H Co 6 08 0 00 0 H 1 0H 5 A00 0 00 H 6 08 1 00 0 H 8 00 0 00 1 5H 5 00 0 00 0 H 6 09 0 00 0 H 3 0H GA 6000030H 600003CH 5 10 0 00 0 H 6 0A0 0 00 H 8 00 0 00 2 5H Figure 2.9 Work RAM Area Contents SE 24 The operation at restart differs depending on whether the DMA mode is in save mode or update mode. Recognition of the save/update mode of the Indirect mode is performed and judged by the write address update bit. (a) ~ (c) DMA transfer is re-implemented. nti • For Save mode (write address update bit = 0), after one DMA transfer is completed, because the address accessing the parameters is saved at 6000000H, al • For update mode (write address update bit = 1), after one DMA transfer is completed, because the address accessing the parameters is updated at 6000024H, (d) ~ (e) DMA transfer is implemented. Address Add Value DMA normally accesses continuous areas, but by setting the address add value, the de addresses of fixed intervals can be accessed. This function is effective when chang- ing part of continuously arranged parameters like the VDP1 command table. An example is 32 blocks as one 20H byte table from address 5C00000H, among which the parameters of each 8 byte block are rewritten one time. Change parameters that have 40H bytes from address 6000000H are set by the following steps and the transfer nfi process is implemented when transferring via level 0 of DMA. 1) Write the read address 6000000H to read address register D0R. 2) Write the write address 5C00008H to write address register D0W. 3) Write transfer byte number 40H to transfer byte number register D0C. 4) Write the address add value 105H to address add value register D0AD. Here, the Co low 3 bits (5=101B) updates the address for each 20H. 5) Set the DMA mode to 0 and set the address update bit and DMA start factor as required. Write to the mode/address /update/DMA start factor register D0MD. For example, 0 is written to D0MD when V-Blank-IN is the starting factor and address update is in a retain mode. GA SE SCU User's Manual 25 6) Set the DMA enable bit to 1. DMA is activated when the starting factor set in step 5) occurs and the slanted line area in Figure 2.10 is rewritten once. 5C00000 H 5C00008 H 16 bit nti Table 1 al 5C00020 H 5C00028 H Table 2 5C00030 H 5C003E0H de 5C003E8H nfi Table 32 Co Figure 2.10 DMA Transfer by Setting Address Add Value Steps 1) through 5) do not have to be in the same order. GA SE 26 2.2 Interrupt Control Table 2.1 shows the bit allocation of interrupt factors. Bit allocation shows the inter- Details are given below for each interrupt factor. nti rupt register status. Level 1 is the lowest interrupt level and level F is the highest. Table 2.1 Interrupt Factors Bit Allocation Interrupt Factors Interrupt Source al Vector Number Level bit 0 V-Blank-IN VDP2 Vector 40 Level F bit 1 V-Blank-OUT VDP2 Vector 41 Level E bit 2 H-Blank-IN VDP2 Vector 42 Level D bit 3 Timer 0 SCU Vector 43 Level C bit 4 bit 5 bit 6 bit 7 bit 8 bit 9 Timer 1 DSP End Sound Request System Manager PAD Interrupt Level-2 DMA End de SCU SCU SCSP SM PAD A-Bus Vector 44 Vector 45 Vector 46 Vector 47 Vector 48 Vector 49 Level B Level A Level 9 Level 8 Level 8 Level 6 bit 10 bit 11 bit 12 bit 13 bit 14 bit 15 Level-1 DMA End Level-0 DMA End DMA-illegal Sprite Draw End -- -- nfi A-Bus A-Bus SCU VDP1 Vector 4A Vector 4B Vector 4C Vector 4D Level 6 Level 5 Level 3 Level 2 bit 16 bit 17 bit 18 bit 19 bit 20 bit 21 bit 22 Co External Interrupt 00 External Interrupt 01 External Interrupt 02 External Interrupt 03 External Interrupt 04 External Interrupt 05 External Interrupt 06 A-Bus A-Bus A-Bus A-Bus A-Bus A-Bus A-Bus Vector 50 Vector 51 Vector 52 Vector 53 Vector 54 Vector 55 Vector 56 Level 7 Level 7 Level 7 Level 7 Level 4 Level 4 Level 4 bit 23 External Interrupt 07 A-Bus Vector 57 Level 4 bit 24 External Interrupt 08 A-Bus Vector 58 Level 1 GA bit 25 External Interrupt 09 A-Bus Vector 59 Level 1 bit 26 External Interrupt 10 A-Bus Vector 5A Level 1 bit 27 External Interrupt 11 A-Bus Vector 5B Level 1 bit 28 External Interrupt 12 A-Bus Vector 5C Level 1 bit 29 External Interrupt 13 A-Bus Vector 5D Level 1 bit 30 External Interrupt 14 A-Bus Vector 5E Level 1 bit 31 External Interrupt 15 A-Bus Vector 5F Level 1 SE SCU User's Manual 27 Table 2.2 shows by what general names the interrupt factors are called. Later de- scriptions are based on the general name. Table 2.2 Interrupt Factor General Names General Names Blanking Interrupt V-Blank-IN V-Blank-OUT H-Blank-IN nti Specific Names al Timer Interrupt Timer 0 Timer 1 Level 2-DMA End Interrupt DMA End Interrupt de Level 1-DMA End Interrupt Level 0-DMA End Interrupt nfi Co GA SE 28 Blanking Interrupt There are three types of blanking interrupt, V-Blank-IN, V-Blank-OUT, and H-Blank- IN. Figure 2.11 details blanking interrupt. Blanking interrupt is synchronous to the Display Direction nti display, and notifies the user whether a drawing is at the beginning or end. al V-Blank-OUT H-Blank-IN de Display Screen nfi Co V-Blank-IN Non-Display Area GA Figure 2.11 Blanking Interrupt V-Blank-IN Indicates the end of a display, after which nothing will be displayed on the screen even when attempting to display data. V-Blank-OUT V-Blank-OUT indicates the beginning of a display. Although a display may be about to begin, how long before interrupt occurs must be taken into consideration since it SE takes time (an interval) for the actual display to materialize. V-Blank-OUT also clears Time 0 data. SCU User's Manual 29 H-Blank-IN H-Blank-IN indicates the draw end of one line. Timer 0 data is incremented by this timing. Timer Interrupt nti Time interrupt includes Timer 0 and Timer 1. Time interrupt is synchronous with al the blanking interrupt mentioned earlier and can cause interrupt to occur at dots (points) on the screen. Timer 0 Values are cleared by V-Blank-OUT interrupt reception and counted by H-Blank-IN interrupt reception . Timer 0 interrupt occurs when values compared to the Timer 0 compare register (see register details) are the same. Figure 2.12 shows the Timer 0 occurrence process. de Timer 0 Clear nfi Display Direction (In Sync with V-Blank-OUT) Display Screen (In Timer 0 Increment Sync with V-Blank-IN) Timer 0 =0 CoTimer 0 Interrupt Occurence Timer 0 =10 Timer 0 =19 (Same value as compare register) GA Non-Display Area SE Figure 2.12 Timer 0 Interrupt Occurrence Process (compare register = example when set to 19) 30 Timer 1 Data of the Timer 1 data set register (see register details) is set by Timer 1 with H- Timer 0. nti Blank-In interrupt receiving. Count down is done at a frequency (1 dot painting) of 7 MHz or about 1/4 the system clock. When the value of Timer 1 becomes 0, inter- rupt of Timer 1 occurs. Interrupt can also be made to occur at 1 point by combining al it with Timer 0 according to the Timer 1 mode register value (see register details), and interrupt can be caused to occur at each line independently of Timer 0. Figure 2.13 shows the process up to when Timer 1 interrupt is caused to occur in sync with de Display Direction Display Screen Timer 1 Data Set (each line) nfi Timer 1 Register = 1 Timer 1 Register = 0 Timer 0 Co V-Blank-IN 7 MHz Timer 1 Decrement Timer 1 Interrupt Occurence occurence Non-Display Area GA Figure 2.13 Timer 1 Interrupt Process (In sync with Timer 0) SE SCU User's Manual 31 Figure 2.14 shows the process up to when Timer 1 is caused to occur out of sync with Timer 0. There is no change when operationally in sync but a judgment is made for each line and interrupt made to occur. Display Direction ntial Timer 1 Data Set (each line) Display Screen line de Timer 1 Interrupt occurs at each 7 MHz V-Blank-IN Timer 1 Decrement nfi Non-Display Area Co Figure 2.14 Timer 1 Interrupt Process (out of sync with Timer 0) GA SE 32 DSP-End Interrupt The program execution control flag (see section 3.3, E flag of the Program Control Port) of the program control port (see section 3.3, Program Control Port) is set by the DSP the DSP. nti ENDI command (see section 4.5, “Command” ENDI command) and gives notice when the program has ended. By this, the main CPU can retrieve the results calculated by Sound-Request Interrupt al This interrupt occurs from the SCSP. For example, to display the volume level meter on the screen when a CD (Compact Disk) is connected, interrupt from SCSP is used and reported to the main. SMPC Interrupt User’s Manual. de Detailed information about interrupt that occurs from SMPC is listed in the SMPC PAD Interrupt The occurrence of this interrupt depends on the action of the user. PAD is given as one example but other items, such as a mouse, may be connected. DMA End Interrupt nfi Divided by level, this interrupt notifies the user when DMA transfer has ended. There are three DMA levels from level 2 to level 0. DMA-Illegal Interrupt Co Notifies user that DMA cannot be executed by interrupt when executing DMA that cannot be done using certain parameters. Sprite Draw End Interrupt Notifies user via VDP1 that draw has ended. GA SE SCU User's Manual 33 2.3 DSP DSP Control from the Main CPU from the CPU include: nti This allows control of the DSP from the main CPU. DSP items that can be controlled 1) Load DSP program 2) Access DSP data 3) Begin DSP program execution 4) Forced stop of DSP program al Load DSP Program There are two methods in which the DSP program is loaded: by using the DSP DMA command, and by writing directly to the DSP program RAM area from the order shown below. de main CPU. Program data can be loaded if controlled from the main CPU in the 1) Set the program control port bits 16 and 17 to 0. 2) Write the transfer start address to the program RAM address of the same port. If DSP is not stopped, it cannot be loaded. 3) Write sequence program data in long word units to the program RAM data port. Program Control Port nfi Figures 2.15 to 2.17 show each step of control from the CPU. bit 31 Co bit 17 Step execute control bit bit 16 Program execute control bit bit 0 0 0 GA STEP 1 Stops Program Execute Figure 2.15 DSP Program Load Step 1 SE 34 Program Control Port bit 31 bit 7 nti Program RAM Address al Program Transfer bit 0 Begin Address STEP 2 de Recognizes the Transfer Source Address Figure 2.16 DSP Program Load Step 2 Program RAM Data Port bit 31 nfi bit 0 Program RAM Data Port Co STEP 3 Data Program transfer Loads Program address counts up 1. GA Figure 2.17 DSP Program Load Step 3 SE SCU User's Manual 35 DSP Data Access In order to access DSP data, the DMA command of DSP can be used, but there is also a method that accesses the DSP data RAM area from the main CPU. Data can be accessed if controlled from the CPU in the following sequence. 1) Set the program control port bit 16 and bit 17 to 0. 2) Write the access start address to the data RAM address port. If DSP is not stopped, it cannot be set. ntial 3) Sequence data is accessed in long-word units through the data RAM data port. Control methods from the CPU for each step are shown from Figure 2.18 to Figure 2.20. Program Control Port bit 31 bit 17 Step execute control bit de bit 16 Program execute control bit bit 0 0 nfi 0 STEP 1 Co Stops Program Execute Figure 2.18 DSP Data Access Step 1 GA SE 36 Data RAM Address Port bit 31 bit 7 nti Program RAM Address al Data Access Start Address bit 0 STEP 2 de Recognizes the Access Start Address Figure 2.19 DSP Data Access Step 2 Data RAM Data Port bit 31 nfi bit 0 Data RAM Data Port Co STEP 3 Data Read / Write data Data access address counts up 1. GA Figure 2.20 DSP Data Access Step 3 SE SCU User's Manual 37 DSP Program Execute Start Execution of the DSP program is begun by writing of the program control port 1 to bit 16 (see Figure 2.21). When the write is recognized, DSP begins execution from trol port. nti the address stored in the program RAM address of the program control port. The execution start address must be set before writing “1” to bit 16 of the program con- Program Control Port b31 b16 al b0 Program execute control bit 1 de Figure 2.21 DSP Program Execution Start Control from CPU DSP Program Forced Stop nfi In contrast to execution start, DSP program execution forced stop is done by writing the program control port 0 to bit 16 of the program control port. Figure 2.22 shows the forced stop control. Program Control Port b31 Co b16 Program execute control bit b0 GA 0 Figure 2.22 DSP Program Forced Stop Control from CPU SE 38 CHAPTER 3 REGISTERS Chapter 3 Contents ntial 3.1 Register List......................................................................................................... 40 3.2 DMA Control Registers .................................................................................... 41 de Level 2-0 DMA Set Register ............................................................. 41 DMA Enable Register ....................................................................... 45 DMA Mode, Address Update, Start Factor Select Register ........ 46 DMA Forced Stop Register .............................................................. 47 DMA Status Register ........................................................................ 47 3.3 nfi DSP Control Ports .............................................................................................. 51 DSP Program Control Port .............................................................. 51 DSP Program RAM Data Port ......................................................... 53 DSP Data RAM Address Port .......................................................... 53 3.4 Co DSP Data RAM Data Port ................................................................ 54 Timer Registers ................................................................................................... 55 Timer 0 Compare Register ............................................................... 55 Timer 1 Set Data Register ................................................................. 55 Timer 1 Mode Register ..................................................................... 56 3.5 Interrupt Control Registers .............................................................................. 57 Interrupt Mask Register ................................................................... 57 GA 3.6 Interrupt Status Register .................................................................. 58 A-Bus Control Registers ................................................................................... 61 A-Bus Interrupt Acknowledge Register ........................................ 61 A-Bus Set Register ............................................................................. 62 A-Bus Refresh Register .................................................................... 72 3.7 SCU Control Registers ...................................................................................... 73 SE SCU SDRAM Select Register ........................................................... 73 SCU Version Register ........................................................................ 73 SCU User's Manual 39 3.1 Register List A list of SCU registers is given in Table 3.1. Headings are divided for each register type and each register is explained. Table 3.1 Register List Type Register Name Lead Address ntial End Address Size DMA Control Registers Level 0-DMA Set Register 25FE0000H 25FE0017H 24 byte Level 1-DMA Set Register 25FE0020H 25FE0037H 24 byte Level 2-DMA Set Register 25FE0040H 25FE0057H 24 byte DSP Control Ports DMA Force-End Register DMA Status Register DSP Program Control Port 25FE0080H DSP Program RAM Data Port DSP Data RAM Address de 25FE0060H 25FE007CH 25FE0084H 25FE0063H 25FE007FH 25FE0083H 25FE0087H 4 byte 4 byte 4 byte 4 byte Timer Registers Port DSP RAM Data Port nfi 25FE0088H 25FE008CH Timer 0 Compare Register 25FE0090H Timer 1 Set Data Register 25FE0094H Timer 1 Mode Register 25FE0098H 25FE008BH 25FE008FH 25FE0093H 25FE0097H 25FE009BH 4 byte 4 byte 4 byte 4 byte 4 byte Interrupt Control Registers Co Interrupt Mask Register Interrupt Status Register 25FE00A0H 25FE00A4H A-Bus Control Registers A-Bus Interrupt Acknowledge 25FE00A8H A-Bus Set Register A-Bus Refresh Register 25FE00B0H 25FE00B8H 25FE00A3H 25FE00A7H 25FE00ABH 25FE00B7H 25FE00BBH 4 byte 4 byte 4 byte 8 byte 4 byte SCU Control Registers SCU SDRAM Select Register 25FE00C4H 25FE00C7H 4 byte GA SCU Version Register 25FE00C8H 25FE00CBH 4 byte SE 40 3.2 DMA Control Registers Level 2-0 DMA Set Register nti There are three DMA levels, beginning at the highest priority level of 2 to the lowest priority level of 0. These are explained below. • Read Address al Figure 3.1 is the read address register. The DMA mode includes a direct mode and an indirect mode. The value of the meaning changes for each mode. b31 b24 b23 b16 b15 b8 b7 b0 25FE0000 (Level 0) 25FE0020 (Level 1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 25FE0040 (Level 2) de Figure 3.1 Level 2-0 Read Address (Register: D0R, D1R, D2R) Initail value undefined Read Address (1~27 [bit 26 ~ 0] in Figure 3.1) DxR 26-0[x=2-0] (R/W) DMA level 2-0 Read address bit 26-0 When in the Direct mode, values being stored are transfer source addresses. expressed in bytes. nfi However, this has no meaning when in the Indirect mode. The register of that level prohibits writing while DMA is operating. All address values are • Write Address The write address register is shown in Figure 3.2. The DMA mode includes a 25FE0004 (Level 0) Co direct mode and indirect mode; the value of the meaning changes with each mode. 25FE0024 (Level 1) 25FE0044 (Level 2) b31 1 2 b24 b23 3 4 5 6 7 8 b16 b15 b8 b7 b0 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Figure 3.2 Level 2-0 Write Address (Register: D0W, D1W, D2W) Initial value undefined Write Address (1~27 [bit 26 ~ 0] in Figure 3.2) GA DxW 26-0[x=2-0] (R/W) DMA level 2-0 Write address bit 26-0 When in the Direct mode, the value being stored is the transfer source ad- dress. However, when in the Indirect mode, the address of the location where the transfer source address of DMA transfer is executed the first time is stored. The register of that level prohibits writing while DMA is operating. All address values are expressed in bytes. SE SCU User's Manual 41 • Transfer Byte Number Stores the byte number to be transferred by DMA. Figure 3.3 shows the level 0 transfer byte number. Figure 3.4 shows the level 2-1 transfer byte number. 25FE0008 b31 b24 b23 b16 b15 nti b8 b7 b0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 al Figure 3.3 Level 0 Transfer Byte Number (Register: D0C) Initial value undefined Level 0 transfer byte number (1~20 [bit 19 ~ 0] in Figure 3.3) D0C 19-0 (R/W) DMA level 0 Count bit 19-0 Stores the DMA transfer byte number to be operated at level 0. The register of that level prohibits writing while DMA is operating. This register can be set to up to 1 MByte. 25FE0028 (Level 1) 25FE0048 (Level 2) b31 b24 b23 de b16 b15 b8 b7 b0 1 2 3 4 5 6 7 8 9 10 11 12 Figure 3.4 Level 2-1 Transfer Byte Number (Register: D1C, D2C) Initial value undefined can be set to a maximum of 4 Kbytes. nfi Level 2-1 transfer byte number (1~12 [bit 11 ~ 0] in Figure 3.4) DxC 11-0[x=2-1] (R/W) DMA level 2-1 Count bit 11-0 Stores the DMA transfer byte number to be operated at level 1 or 2. The register of that level prohibits writing while DMA is operating. This register • Add Value Register Co Figure 3.5 shows the add value register. 25FE000C (Level 0) b31 b24 b23 b16 b15 b8 b7 b0 25FE002C (Level 1) 1 2 3 4 25FE004C (Level 2) Figure 3.5 Level 2-0 Address Add Value (Register: D0AD, D1AD, D2AD) Initial value 00000101H GA SE 42 Read Address Add Value (1 [bit 8] in Figure 3.5) DxRA[x=2-0] (W) DMA level 2-0 Read address Addition data bit Designates the add byte number of the read address. Table 3.2 shows the while DMA is operating. nti read address add value. Since this is effective only for the CS2 space of the A- Bus, everything else should set 1B. The register of that level prohibits writing Table 3.2 Read Address Add Value DxRA (X=2-0) al Description 0 Nothing is added 1 4 Bytes are added de Write Address Add Value (2~4 [bit 2~0] in Figure 3.5) DxWA3-0[x=2-0] (W) DMA level 2-0 Write address Addition data bit 3-0 operating. nfi Designates the add byte number of the write address. Table 3.3 shows the write address add value. This value is always effective when writing data to the B-Bus, but is effective only for 000B or 010B data when writing to the CS2 space of the A-Bus. Data should be set to 010B when writing anywhere except to A-Bus or B-Bus. The register of that level prohibits writing while DMA is Co Table 3.3 Write Address Add Value DxWA (X=2-0) 000 B 001 B Description Nothing is added 2 Bytes are added 010 B 4 Bytes are added GA 011 B 8 Bytes are added 100 B 16 Bytes are added 101 B 32 Bytes are added 110 B 64 Bytes are added 111 B 128 Bytes are added SE SCU User's Manual 43 There are provisions (as in Figure 3.6) for the write address add value. As shown in Figure 3.6, communication between the SCU and B-Bus is in 32-bit units, but in 16- bit units between the B-Bus and processor. Thus, when transferring A ~ D data from B-Bus is 2 byte units, as shown in Figure 3.8. nti the SCU to the processor, as shown in Figure 3.7, the SCU can transfer A ~ D to the B-Bus at one time but the B-Bus can only transfer to the processor after dividing A ~ B and C ~ D. From this, the difference between address 2 and address 1 can be al written and indicated as the address add value since the write address add value of SCU 32 B-Bus de 16 nfi SCSP VDP1 VDP2 Co Figure 3.6 Communication Units Between the SCU and Processor A A SCU GA B C D B-Bus B C D Processor SCSP VDP1 VDP2 32 bits of A~D is A~B, C~D are divided SE output once into 2 and output Figure 3.7 Specific Example of Transfer Between the SCU and Processor 44 nti Transfer SCU Transfer B-Bus Transfer Transfer Source Units Units Destination Address 1 al Address 2 de Address 2 - Address 1 can be indicated by "Write Address Add Value" DMA Enable Register nfi Figure 3.8 Write Address Add Value Indication This register enable execution of DMA. The register of that level prohibits writing 25FE0010 (Level 0) b31 Co while DMA is operating. Figure 3.9 shows the format of this register. 25FE0030 (Level 1) 25FE0050 (Level 2) b24 b23 b16 b15 b8 b7 1 Figure 3.9 Level 2-0 DMA Enable Bit (Register: D0EN, D1EN, D2EN) Initial Value 00000000H GA DMA Enable Bit (1 [bit 8] in Figure 3.9) DxEN[x=2-0] (W) DMA level 2-0 ENable bit This bit enables DMA to be executed. This flag is set to 1 when DMA is enabled. Other required data must be set in advance since DMA begins after the flag is set. DMA Starting Bit (2 [bit 0] in Figure 3.9) DxGO[x=2-0] (W) DMA level 2-0 GO bit SE This bit starts execution of DMA. The starting factor bit is significant only when 111B, and when DMA is started, this bit is set to 1. DMA starts one time per set. SCU User's Manual 45 DMA Mode, Address Update, Start Factor Select Register This register designates the DMA mode (direct or indirect), address update (save or update set value), and selection of the start factor. Registers of that level prohibit writing while DMA is operating. Figure 3.10 shows the register. 25FE0014 (Level 0) 25FE0034 (Level 1) 25FE0054 (Level 2) b31 Figure 3.10 b24 b23 1 b16 b15 2 ntial b8 b7 3 Level 2-0 DMA Mode, Address Update, Start Factor Select 4 5 b0 6 Register (Register : D0MD, D1MD, D2MD) Initial Value 00000007H DMA Mode Bit (1 [bit 24] in Figure 3.10) DxMOD[x=2-0] (W) DMA level 2-0 MODe bit indirect mode. de Decides the DMA mode. “0” shows the direct mode, and “1” shows the Read Address Update Bit (2 [bit 16] in Figure 3.10) DxRUP[x=2-0] (W) DMA level 2-0 Read update UP bit This bit decides whether to save or update the value at the time it is set for nfi read address. 0 means save and 1 means update. See “Example of a Specific Use” in section 2.1 “DMA Transfer” for more information on how to operate it. Write Address Update Bit (3 [bit 8] in Figure 3.10) (DxWUP[x=2-0] (W) DMA level 2-0 Write update UP bit This bit decides whether to save or update the value at the time it is set for operate it. Co write address. “0” means save and “1” means update. See “Example of A Specific Use” in section 2.1 “DMA Transfer” for more information on how to DMA Starting Factor Select Bit (4~6 [bit 2~0] in Figure 3.10) DxFT2-0[x=2-0] (W) DMA level 2-0 starting FacTor bit 2-0 DMA sets the DMA enable bit and starts by receiving an outside signal se- lected by the starting factor select bit. When the starting factor bit is 111B, DMA starts by setting the DMA starting bit. 0 0 GA Table 3.4 Starting Factors Starting Factor Bits (x=2-0) DxFT2 0 DxFT1 0 0 1 DXFT0 0 1 0 Starting Factors V-BLANK-IN signal receive and enable bit setting V-BLANK-OUT signal receive and enable bit setting H-BLANK-IN signal receive and enable bit setting 0 1 1 Timer 0 signal receive and enable bit setting SE 1 1 1 1 0 0 1 1 0 1 0 1 Timer 1 signal receive and enable bit setting Sound Req signal receive and enable bit setting Sprite draw end signal receive and enable bit setting Enable bit setting and DMA starting factor bit setting 46 DMA Forced Stop Register This is a bit in DMA control which causes DMA forced stops. This register is posi- tioned at address 05FE0060H (32 bit area) within the SCU. Its operation is shown by the map below. 25FE0060 b31 Figure 3.11 b24 b23 b16 b15 ntial b8 b7 DMA Force-Stop Register (Register: DSTP) Initial Value 00000000H b0 1 DMA Force-Stop bit (1 [bit 0] in Figure 3.11) DSTOP (W) DMA STOP control bit DSTOP=1 : Stops DMA while in operation. DMA Status Register de • Access, Interruption, Stand by, Operation Registers This register shows the DMA bus access indication and the DMA condition for each level. The four DMA conditions are interrupt, standby, operation, and ships. nfi stop. Explained first are the high level and low level DMA operational relation When high level DMA is operating, as shown in Figure 3.15, and launching low level DMA currently interrupted, the operation will not occur at the time when the low level DMA is launched (it will not be in operation). It will wait for Co a period of time and then go into operation mode. This period is called Standby (or Wait period), and this condition always exists prior to the DMA operation. Low level DMA operates after high level DMA is completed. When starting high level DMA while low level DMA is operating, operation will not begin at the moment that high level DMA is started but will begin to operate after temporarily being on standby. At this time, low level DMA is interrupted and cannot start until high level DMA has stopped (operation ends). GA SE SCU User's Manual 47 When Low Level DMA starts while High Level DMA is operating Low Level DMA High Level DMA stopped Start in operation on standby nti in operation stoppedal stopped When High Level DMA starts while Low Level DMA is operating High Level DMA Low Level DMA stopped Start in operation on standby de in operation interrupted stopped in operation nfi Figure 3.12 High Level DMA Operation A 0 bit during interrupt or operation confirms that the DMA operation is stopped. Figure 3.13 shows access, interrupt, stand by, and operation registers. b31 25FE007C b24 b23 Co 1 2 3 4 b16 b15 5 6 7 8 Figure 3.13 DMA Status Register (Register: DSTA) Initial Value 00000000H b8 b7 9 10 11 b0 12 13 DMA DSP Bus Access Flag (1 [bit 22] in Figure 3.13) GA DACSD (R) DMA ACceSs DSP-Bus Shows whether the DSP bus is being accessed during DMA. 1 means access- ing. 0 means not accessing. DMA B Bus Access Flag (2 [bit 21] in Figure 3.13) DACSB (R) DMA ACceSs B-Bus Shows whether the B bus is being accessed during DMA. 1 means accessing. 0 means not accessing. SEDMA A Bus Access Flag (3 [bit 20] in Figure 3.13) DACSA (R) DMA ACceSs A-Bus Shows whether the A bus is being accessed during DMA. 1 means accessing. 0 means not accessing. 48 Level-1 DMA Interrupt Flag (4 [bit 17] in Figure 3.13) D1BK (R) DMA level 1 BacK ground flag level 1 DMA is not interrupted. nti Shows Level-1 DMA transfer execution is interrupted by the effect of high level DMA. A 1 shows that it is currently being interrupted. A 0 shows that Level-0 DMA Interrupt Flag (5 [bit 16] in Figure 3.13) D0BK (R) DMA level 0 BacK ground flag al Shows Level-0 DMA transfers execution is interrupted by the effect of high level DMA. A 1 shows that it is currently being interrupted. A 0 shows that level 0 DMA is not interrupted. D2WT (R) DMA level 2 WaiT flag de Level-2 DMA Stand by Flag (6 [bit 13] in Figure 3.13) Level-2 DMA transfer execution is currently shown in on standby (in wait condition). A 1 shows the current standby condition. A 0 shows that level 2 DMA is not on standby. D2MV (R) DMA level 2 MoVe flag nfi Level-2 DMA Operation Flag (7 [bit 12] in Figure 3.13) Level-2 DMA transfer execution is currently shown in operation. A 1 shows that it is currently in operation. A 0 shows level 2 DMA is not in operation. Also, when both D2WT and D2MV are 0, it shows that level 2 DMA is stopped. Co Level-1 DMA Stand by Flag (8 [bit 19] in Figure 3.13) D1WT (R) DMA level 1 WaiT flag Level-1 DMA transfer execution is currently shown on standby. A 1 shows the current standby condition. A 0 shows that level 1 DMA is not on standby. Level-1 DMA Operation Flag (9 [bit 8] in Figure 3.13) D1MV (R) DMA level 1 MoVe flag Level-1 DMA transfer execution is currently shown in operation. A 1 shows GA that it is currently in operation. A 0 shows level 1 DMA is not in operation. Also, when D1WT, D1MV, D1BK are all 0, it shows that level 1 DMA is stopped. Level-0 DMA Stand by Flag (10 [bit 5] in Figure 3.13) D0WT (R) DMA level 0 WaiT flag Level-0 DMA transfer execution is shown to be currently on standby. A 1 shows the current standby condition. A 0 shows level 0 DMA is not on SE standby. SCU User's Manual 49 Level-0 DMA Operation Flag (11 [bit 4] in Figure 3.13) D0MV (R) DMA level 0 MoVe flag Level-0 DMA transfer execution is shown to be currently in operation. A 1 DMA is stopped. nti shows that it is currently in operation. A 0 shows that level 0 DMA is not in operation. Also, when all D0WT, D0MV, D0BK are 0 it indicates that level 0 DSP DMA Stand by Flag (12 [bit 1] in Figure 3.13) DDWT (R) DMA DSP WaiT flag al DMA transfer execution of the DSP statement is shown to be currently on standby. A 1 shows the current standby condition. A 0 shows that DSP issue DMA is not on standby. DSP DMA Operation Flag (13 [bit 0] in Figure 3.13) DDMV (R) DMA DSP MoVe flag de DMA transfer execution of the DSP statement is shown to be currently in operation. A 1 shows that it is currently in operation. A 0 shows that DSP issue DMA is not in operation. Also, when DDWT, DDMV, D0BK are all 0, it shows that DSP DMA is stopped. nfi Co GA SE 50 3.3 DSP Control Ports DSP Program Control Port The DSP program control port is shown in Figure 3.14. 25FE080 b31 1 2 b24 b23 3 4 5 b16 b15 6 7 8 9 10 11 ntial b8 b7 b0 12 13 14 15 16 17 18 19 Figure 3.14 DSP Program Control Port (Register: PPAF) Initial Value 00000000H Execute Pause Reset Flag (1 [bit 26] in Figure 3.14) PR (W) execute Pause Reset flag Execute Pause Flag (2 [bit 25] in Figure 3.14) de When the program execute control flag (see below) is 1, the program pause is reset if 1 is written to the flag and execution begins. The condition does not change when it does not pause or when the program execute flag is 0. EP (W) Execute Pause flag T0 (R) Transfer 0 nfi When the program execute control flag (see below) is 1, the executing pro- gram pauses if 1 is written to the flag. This condition does not change when it pauses or when the program execute flag is 0. D0-Bus DMA Execution Flag (3 [bit 23] in Figure 3.14) S (R) Sign flag Co This flag becomes 1 when executing DMA using the D0-Bus. Sine Flag (4 [bit 22] in Figure 3.14) This flag becomes 1 when the operation result is negative. Zero Flag (5 [bit 21] in Figure 3.14) Z (R) Zero flag This flag becomes 1 when the operation result is 0. GA Carry Flag (6 [bit 20] in Figure 3.14) C (R) Carry flag This flag becomes 1 when carry occurs in the operation result. Overflow Flag (7 [bit 19] in Figure 3.14) V (R) oVerflow flag This flag becomes 1 when the operation results causes overflow (or SE underflow). This flag is reset by the read out. SCU User's Manual 51 Program End Interrupt Flag (8 [bit 18] in Figure 3.14) E (R) End flag This flag becomes 1 and causes program end interrupt to occur when the read out. nti program ended by the ENDI command is detected. This flag is reset by the Step Execute Control BIt (9 [bit 17] in Figure 3.14) ES (W) Execute Step control bit al The program executes 1 step if a 1 is written while the program is stopped (when the program execute control flag is 0). Invalid while executing. Program Execute Control Flag (10 [bit 16] in Figure 3.14) EX (R/W) program EXecute control flag Controls execution of program. Execution begins by writing 1 and stops by is in progress (1) or is stopped (0). de writing 0. When this flag is read out, it can be determined whether execution Program Counter Transfer Enable Bit (11 [bit 15] in Figure 3.14) LE (W) Load Enable bit This bit decides whether or not the program RAM address (see below) is to be is 1). nfi loaded to the program counter. The program RAM address is loaded to the program counter if 1 is written to the bit. The address can not be loaded when the program is being executed (when the program execute control flag and read the stop address. Co Program RAM Address (12~19 [bit 7~0] in Figure 3.14) P7-0 (R/W) Program RAM address bit 7-0 Stores the address of the program RAM. Also, is able to set the begin address GA SE 52 DSP Program RAM Data Port Details of the DSP program RAM data port are shown in Figure 3.15. Data is loaded into the program RAM by writing data stored in the program RAM area from the CPU. 25FE0084 1 7 nti After loading, the program RAM address of the program control port counts up 1. However, write is prohibited while the program is being executed (when program execute control flag is 1). This port is write only. b31 2 3 4 5 6 b24 b23 b16 b15 al b8 b7 b0 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Figure 3.15 DSP Program RAM Data Port (Register: PPD) Initial Value Undefined DSP Data RAM Address Port de The DSP data RAM address port is shown in Figure 3.16. This sets the data RAM ad- dress to be accessed. However, write is prohibited while the program is being executed (when program execute control flag is 1). 25FE0088 b31 b24 b23 nfi b16 b15 Figure 3.16 DSP Data RAM Address Port (Register: PDA) Initial Value 00000000H b8 b7 1 2 3 4 5 b0 6 7 8 RA7 Co Data RAM Select Bit (1~2 [bit 7~6] in Figure 3.16) RA7-6 (W) RAM select bit bit 7-6 Shows the page of the read RAM data. Table 3.5 shows the RAM page selection. Table 3.5 RAM Page Select Bit RA6 Select RAM Page 0 0 Selects RAM0 GA 0 1 Selects RAM1 1 0 Selects RAM2 1 1 Selects RAM3 Data RAM Address (3~8 [bit 5~0] in Figure 3.16) RA5-0 (W) RAM address bit 5-0 Indicates the read data RAM address. SE SCU User's Manual 53 DSP Data RAM Data Port Details of the DSP data RAM data port are shown in Figure 3.17. The data RAM data is accessed from this port. The data RAM address of the DSP data RAM ad- 25FE008C 1 7 nti dress port increases by 1 when accessed. However, access is prohibited while the program is being executed (when program execute control flag is 1). This port can read and write. b31 2 3 4 5 6 b24 b23 b16 b15 al b8 b7 b0 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Figure 3.17 DSP Data RAM Data Port (Register: PDD) Initial Value Undefined de nfi Co GA SE 54 3.4 Timer Registers Timer 0 Compare Register signal.) nti The Timer 0 compare register is shown in Figure 3.18. (Timer 0 is a counter that increases on receiving an H-Blank-IN signal, and that is cleared by a V-Blank-END 25FE0090 b31 b24 b23 b16 b15 al b8 b7 1 2 3 4 5 b0 6 7 8 9 10 Figure 3.18 Timer 0 Compare Register (Register: T0C) Initial Value Undefined Timer 0 Compare Data (1~1 0 [bit 9~0] in Figure 3.18) TOC9-0 (W) Timer 0 Compare data bit 9-0 de When the value of Timer 0 is equal to the value of this register, timer 0 inter- rupt will occur. Timer 1 Set Data Register nfi The Timer 1 set data register is shown in Figure 3.19. (Timer 1 sets the data of this register by the H-Blank-IN signal receive, automatically counts down by 7 MHz, and when the Timer 1 value is 0, executes interrupt.) 25FE0094 b31 Co b24 b23 b16 b15 b8 b7 1 2 3 4 Figure 3.19 Timer 1 Set Data Register (Register: T1S) Initial Value Undefined 5 6 7 8 b0 9 Timer 1 Set Data (1~9 [bit 8~0] in Figure 3.19) GA T1S8-0 (W) Timer 1 Set data bit 8-0 Sets the value that is set in Timer 1. SE SCU User's Manual 55 Timer 1 Mode Register Details of the Timer 1 mode register are shown in Figure 3.20. How occurrence of Time is set is decided by this register. 25FE0098 b31 b24 b23 b16 b15 nti b8 b7 1 al Figure 3.20 Timer 1 Mode Register (Register: T1MD) Initial Value 00000000H b0 2 Timer 1 Mode Bit (1 [bit 8] in Figure 3.20) T1MD (W) Timer 1 MoDe bit This bit specifies the occurrence of Timer 1. Table 3.6 shows what happens when it occurs. Table 3.6 Timer 1 Occurrence Selection T1MD 0 Occurrence Selection Interrupt occurs at each line de 1 nfi Occurs only at lines indicated by Timer 0 Timer Enable Bit (2 [bit 0] in Figure 3.20) TENB (W) Timer ENaBle bit This bit turns the timer operation ON/OFF. Operation details are shown in Table 3.7. Co Table 3.7 Timer Operation Contents TENB 0 Timer operation off Timer Operation 1 Timer operation on GA SE 56 3.5 Interrupt Control Registers Interrupt Mask Register 25FE00A0 b31 nti The interrupt register is shown in Figure 3.21. It does not mask interrupt when the value of this register is 0, and masks interrupt when it is 1. b24 b23 b16 b15 1 2 al 3 4 5 6 b8 b7 b0 7 8 9 10 11 12 13 14 15 Figure 3.21 Interrupt Mask Register (Register: IMS) Initial Value 0000BFFFH A-Bus Interrupt Mask Bit (1 [bit 15] in Figure 3.21) IMS15 (W) Interrupt MaSk bit bit 15 de Indicates whether to mask the A-Bus interrupt. Sprite Draw End Interrupt Mask Bit (2 [bit 13] in Figure 3.21) IMS13 (W) Interrupt MaSk bit bit 13 Indicates whether to mask the sprite draw end interrupt. IMS12 (W) Interrupt MaSk bit bit 12 nfi DMA Illegal Interrupt Mask Bit (3 [bit 12] in Figure 3.21) Indicates whether to mask the DMA illegal interrupt. Level-0-DMA End Interrupt Mask Bit (4 [bit 11] in Figure 3.21) IMS11 (W) Interrupt MaSk bit bit 11 Co Indicates whether to mask the level-0-DMA end interrupt. Level-1-DMA End Interrupt Mask Bit (5 [bit 10] in Figure 3.21) IMS10 (W) Interrupt MaSk bit bit 10 Indicates whether to mask the level-1-DMA end interrupt. Level-2-DMA End Interrupt Mask Bit (6 [bit 9] in Figure 3.21) IMS9 (W) Interrupt MaSk bit bit 9 Indicates whether to mask the level-2-DMA end interrupt. GA PAD Interrupt Mask Bit (7 [bit 8] in Figure 3.21) IMS8 (W) Interrupt MaSk bit bit 8 Indicates whether to mask the interrupt from PAD. System Manager Interrupt Mask Bit (8 [bit 7] in Figure 3.21) IMS7 (W) Interrupt MaSk bit bit 7 Indicates whether to mask the interrupt from the system manager. SE Sound Request Interrupt Mask Bit (9 [bit 6] in Figure 3.21) IMS6 (W) Interrupt MaSk bit bit 6 Indicates whether to mask the sound request interrupt. SCU User's Manual 57 DSP End Interrupt Mask Bit (10 [bit 5] in Figure 3.21) IMS5 (W) Interrupt MaSk bit bit bit 5 Indicates whether to mask the DSP end interrupt. Timer 1 Interrupt Mask Bit (11 [bit 4] in Figure 3.21) IMS4 (W) Interrupt MaSk bit bit 4 Indicates whether to mask the Timer 1 interrupt. Timer 0 Interrupt Mask Bit (12 [bit 3] in Figure 3.21) IMS3 (W) Interrupt MaSk bit bit 3 Indicates whether to mask the Timer 0 interrupt. ntial H-Blank-IN Interrupt Mask Bit (13 [bit 2] in Figure 3.21) IMS2 (W) Interrupt MaSk bit bit 2 Indicates whether to mask the H-Blank-IN interrupt. V-Blank-OUT Interrupt Mask Bit (14 [bit 1] in Figure 3.21) IMS1 (W) Interrupt MaSk bit bit 1 Indicates whether to mask the V-Blank-OUT interrupt. de IMS0 (W) Interrupt MaSk bit bit 0 nfi V-Blank-IN Interrupt Mask Bit (15 [bit 0] in Figure 3.21) Indicates whether to mask the V-Blank-IN interrupt. Interrupt Status Register Figure 3.22 3 4 Co Figure 3.22 shows the interrupt status register. b31 25FE00A4 1 2 5 6 7 b24 b23 b16 b15 8 9 10 11 12 13 14 15 16 b8 b7 b0 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Interrupt Status Register (Register: IST) Initial Value 00000000H GA These status registers are all read/write registers; the read and write meanings are as shown in Table 3.8. SE 58 Table 3.8 Interrupt Status Bit Contents Access Status Result Read Write 0 1 0 1 Interrupt does not occur Interrupt does occur Resets interrupt ntial Maintains current interrupt status External Interrupt Status Bit (1~16 [bit 31-16] in Figure 3.22) IST31-16 (R/W) Interrupt STatus bit bit 31-16 Shows the status of 16 external interrupts from external interrupt 15 (1 in Figure 3.25) to external interrupt 0 (16 in Figure 3.25). IST13 (R/W) Interrupt STatus bit bit 13 de Sprite Draw End Interrupt Status Bit (17 [bit 13] in Figure 3.22) Shows interrupt status of sprite draw end. DMA Illegal Interrupt Status Bit (18 [bit 12] in Figure 3.22) IST12 (R/W) Interrupt STatus bit bit 12 nfi Shows interrupt status of DMA illegal. Level-0-DMA End Interrupt Status Bit (19 [bit 11] in Figure 3.22) IST11 (R/W) Interrupt STatus bit bit 11 Shows interrupt status of level-0-DMA end. Co Level-1-DMA End Interrupt Status Bit (20 [bit 10] in Figure 3.22) IST10 (R/W) Interrupt STatus bit bit 10 Shows interrupt status of level-1-DMA end. Level-2-DMA End Interrupt Status Bit (21 [bit 9] in Figure 3.22) IST9 (R/W) Interrupt STatus bit bit 9 Shows interrupt status of level-2-DMA end. PAD Interrupt Status Bit (22 [bit 8] in Figure 3.22) IST8 (R/W) Interrupt STatus bit bit 8 GA Shows status of interrupt from PAD. System Manager Interrupt Status Bit (23 [bit 7] in Figure 3.22) IST7 (R/W) Interrupt STatus register bit bit 7 Shows status of interrupt from the system manager. Sound Request Interrupt Status Bit (24 [bit 6] in Figure 3.22) IST6 (R/W) Interrupt STatus bit bit 6 SE Shows status of sound request interrupt. SCU User's Manual 59 DSP End Interrupt Status Bit (25 [bit 5] in Figure 3.22) IST5 (R/W) Interrupt STatus bit bit 5 Shows status of DSP end interrupt. Timer 1 Interrupt Status Bit (26 [bit 4] in Figure 3.22) IST4 (R/W) Interrupt STatus bit bit 4 Shows status of Timer 1 interrupt. Timer 0 Interrupt Status Bit (27 [bit 3] in Figure 3.22) IST3 (R/W) Interrupt STatus bit bit 3 ntial Shows status of Timer 0 interrupt. H-Blank-IN Interrupt Status Bit (28 [bit 2] in Figure 3.22) IST2 (R/W) Interrupt STatus register bit bit 2 Shows status of H-Blank-IN interrupt. de V-Blank-OUT Interrupt Status Bit (29 [bit 1] in Figure 3.22) IST1 (R/W) Interrupt STatus bit bit 1 Shows status of V-Blank-OUT interrupt. IST0 (R/W) Interrupt STatus bit bit 0 nfi V-Blank-IN Interrupt Status Bit (30 [bit 0] in Figure 3.22) Shows status of V-Blank-IN interrupt. Co GA SE 60 3.6 A-Bus Control Registers A-Bus Interrupt Acknowledge Register Figure 3.23 shows the A-Bus interrupt acknowledge register. 25FE00A8 b31 b24 b23 b16 b15 ntial b8 b7 b0 1 Figure 3.23 A-Bus Interrupt Acknowledge Register (Register: AIACK) Initial Value 00000000H A-Bus Interrupt Acknowledge (1 [bit 0] in Figure 3.23) AIACK (R/W) A-Bus Interrupt ACKnowledge This shows the effectiveness or ineffectiveness of interrupts from the devices A-Bus. de that exist on the A-Bus. This bit can read and write. The meaning of the bit is shown in Table 3.9. If interrupt is requested, the A-Bus interrupt acknowledge cycle occurs, the interrupt classification data (16 bit) is fetched, and by means of its contents, the current interrupt condition can be acknowledged. If this cycle occurs, and since the AIACK bit must be 0 and the A-Bus interrupt be comes ineffective, the AIACK bit must be reset to receive interrupt from the Access nfi Table 3.9 A-Bus Interrupt Acknowledge Contents Read Status 0 Contents Invalid A-Bus interrupt Write Co 1 0 1 Valid A-Bus interrupt Invalid A-Bus interrupt Valid A-Bus interrupt GA SE SCU User's Manual 61 A-Bus Set Register There are a total of four types of spaces arranged as spaces connected to the A-Bus, chip select 0 ~ 2 (hereafter referred to as CS) which includes three types of spaces that are output and one type of dummy space that CS does not output. nti The register relating to the A-Bus is determined by the connecting devices and al therefore must be set to include all devices. Make sure that there is no excessive change in the value after it has been set. CS0, CS1, and CS2 Dummy Space A-Bus Set Registers Figure 3.24 shows the CS0 and CS1 spaces, and Figure 3.25 shows the CS2 spaces and dummy spaces of the A-Bus set register. b31 25FE00B0 1 2 3 4 5 b24 b23 6 7 8 9 10 11 12 13 14 b16 b15 de b8 b7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 Figure 3.24 A-Bus Set Register [CS0, CS1 Spaces] (Register: ASR0) Initial Value 00000000H b0 30 b31 25FE00B4 1 2 3 4 b24 b23 5 6 nfi b16 b15 b8 b7 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Figure 3.25 A-Bus Set Register [CS2, Dummy Spaces] (Register: ASR1) Initial Value 00000000H b0 22 Co CS0 Space Previous Read Bit (1 [bit 31] in Figure 3.24) A0PRD (W) A-Bus CS0 Previous ReaD bit This bit decides whether the data previous read process of CS0 space is effective or not. The time period from when access begins until data output is reduced by the previous data read process. This is effective only for data that is stored in the address following the accessed data; other addresses do not change with normal access. A 1 shows it is effective, 0 shows it is not effective. Figure 3.26 shows the result when the previous read is effective. GA SE 62 CLK nti CPU RD A B C E A B C D E F A-Bus RD A-Bus DATA A B C D E F CPU DATA A B Collects the next address data in advance (preread) C al E of access until data is output de Decreases loss time from beginning Figure 3.26 Result of Previous Read Process * The clock in the figure is the SCU internal clock nfi Pre-charge Insert Bit After CS0 Space Write (2 [bit 30] in Figure 3.24) A0WPC (W) A-Bus CS0 after Write Pre-Charge insert bit After data is written in the CS0 space, 1 clock no-process condition can be inserted. This is the bit that decides whether the process is effective or inef- fective: 1 shows it is effective; 0 shows it is ineffective. This bit does not affect the operation after CS0 space read. The operation when this bit CLK ARD AWR Co has been set is shown in Figure 3.27. After Read After Write After Write After Read GA 1 clock 2 clock 2 clock 1 clock *The clock in the figure is the SCU internal clock Figure 3.27 Timing when Setting the Pre-Charge Insert Bit after Write Pre-charge Insert Bit After CS0 Space Read (3 [bit 29] in Figure 3.24) A0RPC (W) A-Bus CS0 Previous ReaD bit After CS0 space data is read, 1 clock no-process condition can be inserted. SE This is the bit that decides whether the process is effective or ineffective: 1 shows it is effective; 0 shows it is ineffective. This bit does not affect the operation after CS0 space write. The operation when this bit has been set is shown in Figure 3.28. Depending on the type of device, this bit is set because a fixed period is required after CS is set to High until the next CS is set to Low. This is true for write as well. SCU User's Manual 63 CLK nti ARD AWR After Read 2 clock After Write 1 clock After Write 1 clock al After Read 2 clock * Clock in the figure is the SCU internal clock Figure 3.28 Timing when Setting the Pre-Charge Insert Bit after Read CSO External Wait effective Bit (4 [bit 28] in Figure 3.24) A0EWT (W) A-Bus CS0 External WaiT effective bit de Wait can be inserted by force by the external signal when accessing the CS0 space via the A-Bus. Whether the process will be effective or not is decided by this bit. A 1 shows that the process is effective, 0 shows that the process is ineffective. When the process is effective, wait will continue as long as the external wait signal is “Low” at the time of the SCU wait sampling. Figure 3.29 shows the difference in timing charts when external wait is effective or CPU RD CLK ineffective. nfi A-Bus RD AWAIT DATA Co Timing when External Wait is Ineffective Timing when External Wait is Effective * Clock in the figure is the SCU internal clock GA Figure 3.29 Differences in Timing by Setting External Wait Effective Bit CS0 Space Burst Cycle Wait Number Set Bit (5~8 [bit 27~24] in Figure 3.24) A0BW3-0 (W) A-Bus CS0 Burst cycle Wait bit 3-0 In the CS0 space, the wait number is set for 1 cycle while a burst access is being performed. Table 3.10 shows the set values. SE 64 Table 3.10 CS0 Space Burst Cycle Set Values Bit Wait Number A0BW3 A0BW2 A0BW1 A0BW0 0 0 : 1 1 0 0 : 1 1 0 0 : 1 1 0 1 : 0 1 nti No wait (wait does not sample) 1-cycle wait 14-cycle wait 15-cycle wait al CS0 Normal Cycle Wait Number Set Bit (9~12 [bit 23~20] in Figure 3.24) A0NW3-0 (W) A-Bus CS0 Normal cycle Wait bit 3-0 In the CS0 space, the wait number is set for 1 cycle during normal access. Table 3.11 shows the set values. Table 3.11 CS0 Space Normal Cycle Set Values A0NW3 0 A0NW2 0 Bit A0NW1 0 A0NW0 0 de Wait Number No wait (does not sample waits) 0 : 1 1 0 : 1 1 0 : 1 1 nfi 1 : 0 1 1 cycle wait 14 cycle wait 15 cycle wait Co CS0 Burst Length Set Bit (13~14 [bit 19~18] in Figure 3.24) A0LN1-0 (W) A-Bus CS0 burst LeNgth bit 1-0 In the CS0 space, the length (boundary) to be accessed is designated during burst access. Table 3.12 shows the length set values. Table 3.12 CS0 Space Burst Length Set Values Bit Access Values A0LN1 A0LN0 0 0 No burst access GA 0 1 1 1 0 1 4 address burst access 256 address burst access No boundary SE SCU User's Manual 65 CS0 Space Bus Size Set Bit (15 [bit 16] in Figure 3.24) A0SZ (W) A-Bus CS0 bus SiZe bit nti Sets the A-Bus size in the CS0 space. Table 3.13 shows the set values. Table 3.13 CS0 Space Bus Set Values al A0SZ Bus Size Settings 0 Indicates 16 bit bus 1 Indicates 8 bit bus CS1 Space Previous Read Effective Bit (16 [bit 15] in Figure 3.24) A1PRD (W) A-Bus CS1 Previous ReaD bit This bit decides whether the data previous read process of CS1 space is effec- 3.26 for the result when previous read is effective. de tive or not. The data previous read processes reduces the time from access start until data output. This is effective only for data that is stored in address that follows the accessed data. Other addresses do not change with normal addresses. A 1 shows it is effective, a 0 shows it is not effective. See Figure has been set. nfi Pre-charge Insert Bit After CS1 Space Write (17 [bit 14] in Figure 3.24) A1WPC (W) A-Bus CS1 after Write Pre-Charge insert bit Non-process conditions of 1 clock can be inserted after writing data to CS1 space. This is the bit that decides whether the process is effective or ineffec- tive. A 1 shows it is effective, a 0 shows it is ineffective. This bit has no effect on the operation after read. Figure 3.26 shows the operation when this bit Co Pre-charge Insert Bit After CS1 Space Read (18 [bit 13] in Figure 3.24) A1RPC (W) A-Bus CS1 Read Pre-Charge insert bit One clock worth of non-process condition can be inserted after reading data to CS1 space. This is the bit that decides whether the process is effective or ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit has no effect on the operation after write. Figure 3.28 shows the operation when this bit has been set. GA SE 66 CS1 Space External Wait Effective Bit (19 [bit 12] in Figure 3.24) A1EWT (W) A-Bus CS1 External WaiT effective bit Wait can be entered by force by an external signal when accessing the CS1 space via the A-Bus; however, whether the process will be effective or not is A1BW3-0 (W) A-Bus CS1 Burst cycle WaiT bit 3-0 nti decided by this bit. A 1 shows that the process is effective, a 0 shows that the process is ineffective. When the process is effective, wait will continue as long as the external signal is “Low.” Figure 3.29 shows differences in al timing charts when external wait is effective vs. ineffective. CS1 space Burst Cycle Wait Number Set Bit (20~23 [bit 11~8] in Figure 3.24) In the CS1 space, the wait number is set for 1 cycle while a burst access is performed. Table 3.14 shows the set values. Table 3.14 CS1 Space Burst Cycle Set Values A1BW3 0 0 : A1BW2 0 0 : Bit A1BW1 0 0 : A1BW0 0 1 : de Wait Number No wait (Does not sample wait) 1 cycle wait 1 1 1 1 1 1 nfi 0 1 14 cycle wait 15 cycle wait CS1 Normal Cycle Wait Number Set Bit (24~27 [bit 7~4] in Figure 3.24) A1NW3-0 (W) A-Bus CS1 Normal cycle Wait bit 3-0 In the CS1 space, the wait number is set for 1 cycle during a normal access. A1NW3 Co Table 3.15 shows the set values. Table 3.15 CS1 Space Normal Cycle Set Values 0 A1NW2 0 Bit A1NW1 0 A1NW0 0 Wait Number No wait (Does not sample wait) 0 0 0 1 1 cycle wait : : : : GA 1 1 1 1 1 1 0 1 14 cycle wait 15 cycle wait SE SCU User's Manual 67 CS1 space Burst Length Bit (28~29 [bit 3~2] in Figure 3.24) A1LN1-0 (W) A-Bus CS1 burst LeNgth bit 1-0 nti The access length (boundary) is indicated while burst accessing in CS1 space. Table 3.16 shows length values. Table 3.16 CS1 Space Burst Length Set Values A1LN1 0 0 1 1 Bit A1LN0 0 1 0 1 Access Settings No burst access 4 Address burst access 256 Address burst access No boundary al CS1 space Bus Size Set Bit (30 [bit 0] in Figure 3.24) A1SZ (W) A-Bus CS1 bus SiZe bit de Sets the A-Bus bus size in the CS1 space. Table 3.17 shows the set values. Table 3.17 CS1 Space Bus Size Set Values A1SZ 0 1 nfi Bus Size Settings Indicates 16-bit bus Indicates 8-bit bus CS2 Space Previous Read Effective Bit (1 [bit 31] in Figure 3.25) Co A2PRD (W) A-Bus CS2 Previous ReaD bit This bit decides whether the data in the previous read process of CS2 is effective or not. The data previous read process reduces the time from access start until data output. This is effective only for data that is stored in the address that follows the accessed data. Other addresses do not change with normal addresses. A 1 shows it is effective, a 0 shows it is not effective. See Figure 3.25 for the effect when previous read is effective. GA SE 68 Pre-charge Insert Bit After Writing CS2 Space (2 [bit 30] in Figure 3.25) A2WPC (W) A-Bus CS2 after Write Pre-Charge insert bit A no-process condition of 1 clock can be inserted after writing data to CS2. This is the bit that decides whether the process is effective or ineffective. A set. nti 1 shows it is effective, a 0 shows it is ineffective. This bit has no effect on the operation after read. Figure 3.27 shows the operation when this bit has been al Pre-charge Insert Bit After Reading CS2 Space (3 [bit 29] in Figure 3.25) A2RPC (W) A-Bus CS2 Read Pre-Charge insert bit A no-process condition of 1 clock can be inserted after reading data to CS2. This is the bit that decides whether the process is effective or ineffective. A 1 shows it is effective, a 0 shows it is ineffective.This bit does not affect the operation after write. Figure 3.28 shows the operation when this bit has been set. de CS2 Space External Wait Effective Bit (4 [bit 28] in Figure 3.25) A2EWT (W) A-Bus CS2 External Wait effective bit Wait can be entered by force by an external signal when accessing the CS2 space via the A-Bus. Whether the process will be effective or not is decided by this bit. A 1 shows that the process is effective, a 0 shows that the process is ineffective. When the process is effective, wait will continue as long as the nfi external signal is “Low.” Figure 3.29 shows differences in timing charts when external wait is effective vs. ineffective. CS2 Space Burst Length Bit (5~6 [bit 19~18] in Figure 3.25) A2LN1-0 (W) A-Bus CS2 burst LeNgth bit 1-0 The access length (boundary) is indicated while burst accessing in CS2. A2LN1 Bit Co Table 3.18 shows the length settings. Table 3.18 CS2 Space Burst Length Set Values 0 A2LN0 0 Access Settings No burst access 0 1 4 Address burst access 1 0 256 Address burst access GA 1 1 No border CS2 Bus Size Set Bit (7 [bit 16] in Figure 3.25) A2SZ (W) A-Bus CS2 bus SiZe bit Sets the A-Bus bus size in the CS2 space. Table 3.19 shows the set values. SE SCU User's Manual 69 Table 3.19 CS2 Space Bus Size Set Values A2SZ Bus Size Settings 0 Indicates 16-bit bus 1 Indicates 8-bit bus Dummy Space Previous Read Effective Bit (8 [bit 15] in Figure 3.25) A3PRD (W) A-Bus CS3 Previous ReaD bit ntial This bit decides whether the data previous read process of dummy space is effective or not. The data previous read process reduces the time from access start until data output. This is effective only for data that is stored in address that follows the accessed data. Other addresses do not change with normal addresses. A 1 shows it is effective, a 0 shows it is not effective. See Figure 3.26 for the result when previous read is effective. A3WPC (W) A-Bus CS3 after Write Pre-Charge insert bit de After Pre-charge Insert Bit Dummy Space Write (9 [bit 14] in Figure 3.25) Non-process conditions of 1 clock can be inserted after writing data to dummy space. This is the bit that decides whether the process is effective or ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit hasno effect on the operation after read. Figure 3.27 shows the operation when this bit has been set. nfi After Pre-charge Insert Bit Dummy Space Read (10 [bit 13] in Figure 3.25) A3RPC (W) A-Bus CS3 Read Pre-Charge insert bit Non-process conditions of 1 clock can be inserted after reading data to dummy space. This is the bit that decides whether the process is effective or ineffective. A 1 shows it is effective, a 0 shows it is ineffective. This bit does not affect the operation after write. Figure 3.28 shows the operation when this bit has been set. Co Dummy Space External Wait Effective Bit (11 [bit 12] in Figure 3.25) A3EWT (W) A-Bus CS3 External WaiT effective bit Wait can be entered by force by an external signal when accessing the dummy space via the A-Bus. Whether the process will be effective or not is decided by this bit. A 1 shows that the process is effective, a 0 shows that the process is ineffective. When the process is effective, wait will continue as long as the external signal is “Low.” Figure 3.29 shows differences in GA timing charts for when external wait is effective vs. when it is ineffective. Dummy Space Burst Cycle Wait Number Set Bit (12~15 [bit 11~8] in Figure 3.25) A3BW3-0 (W) A-Bus CS3 Burst cycle Wait bit 3-0 In dummy space, the wait number is set for 1 cycle while a burst access is performed. Table 3.20 shows the set values. SE 70 Table 3.20 Dummy Space Burst Cycle Set Values Bit Wait Number A3BW3 A3BW2 A3BW1 A3BW0 0 0 : 1 1 0 0 : 1 1 0 0 : 1 1 0 1 : 0 1 nti No wait (wait not sampled) 1 cycle wait al 14 cycle wait 15 cycle wait Dummy Space Normal Cycle Wait Number Bit (16~19 [bit 7~4] in Figure 3.25) A3NW3-0 (W) A-Bus CS 3 Normal cycle Wait bit 3-0 In the dummy space, the wait number is set for 1 cycle during normal accessing. Table 3.21 shows the set values. Table 3.21 A3NW3 0 de Dummy Space Normal Cycle Set Values A3NW2 0 Bit A3NW1 0 A3NW0 0 Wait Number No wait (wait not sampled) 0 : 1 1 0 : 1 1 0 : 1 1 nfi 1 : 0 1 1 cycle wait 14 cycle wait 15 cycle wait Dummy Space Burst Length Set Bit (20~21 [bit 3~2] in Figure 3.25) A3LN1-0 (W) Table 3.22 A3LN1 Co A-Bus CS 3 burst Le Ngth bit 1-0 In the dummy space, the length (boundary) to be accessed is designated during burst access. Table 3.22 shows the length set values. Dummy Space Burst Length Set Values Bit A3LN0 Access Settings 0 0 No burst access 0 1 4 address burst access GA 1 1 0 1 256 address burst access No boundary SE SCU User's Manual 71 Dummy Space Bus Size Set Bit (22 [bit 0] in Figure 3.25) A3SZ (W) A-Bus CS3 bus SiZe bit Sets the A-Bus bus size in the dummy space. Table 3.23 shows the set values. Table 3.23 Dummy Space Bus Size Set Values A3SZ 0 1 Bus Size Settings Indicates 16 bit bus Indicates 8 bit bus ntial A-Bus Refresh Register Figure 3.30 shows the A-Bus refresh register. 25FE00B8 b31 b24 b23 b16 b15 de b8 b7 1 Figure 3.30 A-Bus Refresh Register (Register: AREF) Initial Value 00000000H 2 3 4 b0 5 ARFEN (W) A-Bus ReFresh ENable bit nfi A-Bus Refresh Output Effective Bit (1 [bit 4] in Figure 3.30) Makes effective the refresh cycle output of A-Bus. A 1 indicates it is effective, a 0 indicates it is not effective. A-Bus Refresh Wait Number Set Bit (2~5 [bit 3~0] in Figure 3.30) Table 3.24 A-Bus Refresh Wait Number Co ARWT3-0 (W) A-Bus Refresh WaiT bit 3-0 ARWT3 Sets the A-Bus refresh cycle wait number. Table 3.24 shows the details. ARWT2 Bit ARWT1 ARWT0 Wait Number 0 0 0 0 No wait 0 0 0 1 1 cycle wait GA : : : : 1 1 1 0 14 cycle wait 1 1 1 1 15 cycle wait SE 72 3.7 SCU Control Registers SCU SDRAM Select Register nti The SCU has a register that designates the SDRAM configuration. The SDRAM select register is shown in Figure 3.31. This register is at address 25FE00C4H within the SCU. b31 b24 b23 b16 b15 al b8 b7 b0 25FE00C4 1 Figure 3.31 SCU SDRAM Select Bit (Register: RSEL) Initial Value 00000000H SD-RAM Select Bit (1 [bit 0] in Figure 3.31) RSEL (R/W) RAM SELect bit RSEL=0 indicates 2 Mbit X 2 RSEL=1 indicates 4 Mbit X 2 de SCU Version Register nfi SCU has a register showing the chip version. This register is at the address 25FE00C8H within the SCU. The version register is shown in Figure 3.32. b31 b24 b23 b16 b15 b8 b7 b0 25FE00C8 Co Figure 3.32 SCU Version Register (Register: VER) Initial Value 00000000H Version Number (1~4 [bit 3~0] in Figure 3.32) VER 3-0 (R) VERsion number bit 3~0 Shows the SCU chip version. Because there are 4 bits, this supports version 1 2 3 4 0~15 chips. GA SE SCU User's Manual 73 (This page is blank in the original Japanese document.) ntial de nfi Co GA SE 74 CHAPTER 4 DSP CONTROL Chapter 4 Contents ntial 4.1 DSP Internal BLOCK MAP ................................................................76 4.2 List of Commands ................................................................................80 4.3 de Operand Execution Methods .............................................................85 Jump Command Execution ...............................................85 Loop Program Execution ..................................................86 DMA Command Execution ..............................................87 End Command Execution .................................................88 4.4 nfi Special Process Execution ...................................................................89 Loading a Program by the DMA Command ..................89 Repeating One Command .................................................89 Executing a SubRoutine Program .....................................90 4.5 Co More About Commands .....................................................................91 Operation Commands ........................................................91 Load Immediate Command ............................................120 DMA Command ................................................................132 Jump Commands ..............................................................141 Loop Bottom Commands .................................................153 END Command .................................................................156 GA SE SCU User's Manual 75 4.1 DSP Internal BLOCK MAP Figure 4.1 (on the next page) is an internal block map of the DSP. ntial de nfi Co GA SE 76 Figure 4.1 Block Map Inside DSP SE SCU User's Manual MDO MD1 MD2 MD3 GA A (64 word X 32 bit) A (64 word X 32 bit) A (64 word X 32 bit) A (64 word X 32 bit) WD RD WD RD WD RD WD RD CT0(6) CT1(6) CT2(6) CT3(6) RA(8) D0[31-0] D0 D1 DS[31-0] X Co Y SHIFT L16 Imm TOP(8) TOP(12) RX(32) RY(32) PH(16) PL(32) ACH(16) ACL(32) DSP nfi X Y B A PC(8) LEEX ES EP PR E V C Z S T0 WA0 MULTIPLIER ALU Write address read F P47-0 Q data data E Instruction RA0 de T 48 48 decoder PROGRAM RAM C (256 wordX32bit) DSPexternal H register nti al 77 • ALU This arithmetic unit is able to output up to 48 bits. Normal calcula- tions are executed at 32 bits. Only product sum operations become • MULTIPLIER 48-bit operations. ntial This multiplier outputs a low-order 48 bit from among the 64 bit results obtained by 32 bit X 32 bit. The calculation results are in 48 bit data; the high-order 16 bit is stored in PH and the low order 32 bit is stored in PL (see below). • TOP (W) This is an 8 bit register that stores the lead address. The jump • LOP (W) de command and subroutine execution process store the lead address in this register and execute the process. This is a 12 bit register that stores the loop counter. The number of loops is set by the process of repeating 1 command. • CT0-3 (W) • MDO-3 (R/W) nfi This is a 6 bit register that stores the access address of data RAM0-3. This is a 32 bit unit data port that stores the data of data RAM0-3. There are 64 data ports in each data RAM. • RA (W) • RX (W) Co This is the address that stores the register for accessing the data RAM. This register is 8 bit. The RAM designation number (0-3) is stored by a high-order 2 bit. The RAM access address is stored by a low-order 6 bit. This is the 32 bit X-bus connection register that stores the multiplier input data. • RY (W) • PH (W) GA This is the 32 bit Y-bus connection register that stores the multiplier input data. This register stores the high-order 16 bit within the 48 bit multiplier output data. There is also an input data storage register that stores the high-order 16 bit within ALU arithmetic unit input data B (48bit). SE • PL (W) This register stores the low-order 32 bit within the 48 bit of multiplier output data. There is also an input data storage register that stores the low-order 32 bit within ALU arithmetic unit input data B (48bit). 78 • ACH (W) This register stores the high-order 16 bit within 48 bit data showing the ALU calulation results. There is also an imput data storage register that stores the high-order 16 bit within ALU arithmetic unit • ACL (W) input data A(48bit). nti This register stores the low-order 32 bit within the 48 bit data al showing the ALU calulation results. There is also an imput data storage register that stores the low-order 32 bit within ALU arithmetic unit input data A(48bit). • D0 Bus This is a 32 bit data bus for external access. It operates at 28 MHz. It is used in accessing the main CPU. • X-Bus, Y-Bus • RAO (W) de This is a 32 bit data bus for aquiring arithmetic unit input data. It operates at 14 MHz. This is a 32 bit external address register used in external → DSP DMA • WAO (W) nfi transfer. Since it takes a 4 byte unit value, the external address should be shifted right 2 bits. This is a 32 bit external address register used in DSP → external DMA transfer. Since it takes a 4 byte unit value, the external address should be shifted right 2 bits. Co GA SE SCU User's Manual 79 4.2 List of Commands A list of commands used by DSP is given in Tables 4.1 to 4.4. Table 4.1 List of Commands (1) Type Operation Commands ALU Control NOP Command Overview of Operation No operation ntial AND Takes the AND operation of [ACL] and [PL]. OR Takes the OR operation of [ACL] and [PL]. XOR Takes the exclusive OR of [ACL] and [PL]. ADD SUB AD2 SR RR SL Adds [ACL] and [PL]. de Subtracts [PL] from [ACL]. Adds [ACH][ACL] and [PH][PL]. Shifts [ACL] right 1 bit, stores LSB in carry flag Rotates [ACL] right 1 bit, stores LSB in carry flag Shifts [ACL] left 1 bit, stores 0 in LSB of [ACL], stores MSB in carry flag. RL RL8 X-Bus Control NOP MOV [s], X MOV MUL, P nfi Rotates [ACL] left 1 bit, stores MSB in carry flag. Rotates [ACL] left 8 bits, stores b24 in carry flag. No operation Transfers data from data RAM to [RX] [MULTIPLIER] data is transfered to [PH] [PL] MOV [s], P Y-Bus Control NOP MOV [s], Y CLR A MOV ALU, A MOV [s], A D1-Bus Control NOP Co Transfers data from data RAM to [PL] No operation Transfers data from data RAM to [RY] Clears to 0 [ACH] and [ACL] Transfers [ALU] data to [ACH][ACL] Transfers data from data RAM to [ACL] No operation MOV SImm, [d] SImm (short immediate) data is stored in a register or a data RAM designated by [d]. GA MOV [s], [d] Data is transfered to the RAM designated by [s] or data RAM designated by [d] from the register. Load Immediate MVI Imm , [d] Stores Imm (immediate) data in register or in data RAM Commands designated by [d] MVI Imm , [d] , Z When Z (zero flag) of the program control port is 1, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , NZWhen Z (zero flag) of the program control port is 0, Imm (immediate) data is stored in register or in data RAM designated by [d] SE 80 Table 4.2 List of Commands (2) Type Command Overview of Operation Load Immediate commands MVI Imm , [d] , S nti When S (sine flag) of the program control port is 1, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , NS When S (sine flag) of the program control port is 0, Imm al (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , C When C (carry flag) of the program control port is 1, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , NC When C (carry flag) of the program control port is 0, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , T0 When T0 (flag while executing D0 bus DMA) of the program de control port is 1, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , NT0 When T0 (flag while executing D0 bus DMA) of the program control port is 0, Imm (immediate) data is stored in register or in data RAM designated by [d] MVI Imm , [d] , ZS When either S (sine flag) or Z (zero flag) of the program control port is 1, Imm (immediate) data is stored in register or in data RAM designated by [d] DMA Commands DMA D0, [RAM], nfi MVI Imm , [d] , NZSWhen both S (sine flag) and Z (zero flag) of the program SImm control port are 0, Imm (immediate) data is stored in register or in data RAM designated by [d] SImm (short immediate) data is set in the transfer word number counter ([TN0]) as the transfer counter, and transfers data to the RAM area designated by [RAM] from outside using D0-Bus. Transfer begin address ([RA0]) and transfer word number counter ([TN0]) are updated to the Co DMA [RAM], D0, SImm value when transfer ends. SImm (short immediate) data is set in the transfer word number counter ([TN0]) as the transfer counter, and transfers data from the RAM area designated by [RAM] using D0-Bus to the outside. Transfer begin address ([WA0]) and transfer word number counter ([TN0]) are updated to the value when transfer ends. GA SE SCU User's Manual 81 Table 4.3 List of Commands (3) Type Command Overview of Operation DMA Commands DMA D0, [RAM], [s] nti Sets data within the data RAM designated by [s] as the transfer counter to the transfer word number counter ([TN0]), and transfers data to the RAM area designated by [RAM] from outside using D0-Bus. Transfer begin address ([RA0]) and transfer word number counter DMA [RAM], D0, [s] al ([TN0]) are updated to the value when transfer ends. Sets data within the data RAM designated by [s] as the transfer counter to the transfer word number counter ([TN0]), and transfers data to the outside from the RAM area designated by [RAM] using D0-Bus. Transfer begin address ([WA0]) and transfer word number counter ([TN0]) are updated to the value at the time that transfer ends. DMAH D0, [RAM], SImm SImm (short immediate) data is set in the transfer word when transfer begins. de number counter ([TN0]) as the transfer counter, and transfers data to the RAM area designated by [RAM] from outside using D0-Bus. Transfer begin address ([RA0]) and transfer word number counter ([TN0]) keep the value DMAH [RAM], D0, SImm SImm (short immediate) data is set as the transfer counter in the transfer word number counter ([TN0]), and transfers data from the RAM area designated by [RAM] to the outside using D0-Bus. Transfer begin address DMAH D0, [RAM], [s] nfi ([WA0]) and transfer word number counter ([TN0]) keep the value at the time that transfer ends. Sets data within the data RAM designated by [s] as the transfer counter to the transfer word number counter ([TN0]), and transfers data to the RAM area designated by [RAM] from outside using D0-Bus. Transfer begin address ([RA0]) and transfer word number counter ([TN0]) keep the value at the time that transfer begins. DMAH [RAM], D0, [s] JUMP Commands JMP Imm JMP Z, Imm Co Sets data within the data RAM designated by [s] as the transfer counter to the transfer word number counter ([TN0]) , and transfers data to the outside from the RAM area designated by [RAM] using D0-Bus. Transfer begin address ([WA0]) and transfer word number counter ([TN0]) keep the value at the time that transfer begins. Moves to the address shown by Imm (immediate) Moves to the address shown by Imm (immediate) when the Z (zero flag) of the program control port is 1. JMP NZ, Imm Moves to the address shown by Imm (immediate) when the Z (zero flag) of the program control port is 0. GA SE 82 Table 4.4 List of Commands (4) Type Command Overview of Processing nti JUMP Commands JMP S, Imm When S (sine flag) of the program control port is 1, moves to address displayed by Imm (immediate) JMP NS, Imm When S (sine flag) of the program control port is 0, moves to address displayed by Imm (immediate) al JMP C, Imm When C (carry flag) of the program control port is 1, moves to address displayed by Imm (immediate) JMP NC, Imm When C (carry flag) of the program control port is 0, moves to address displayed by Imm (immediate) JMP T0, Imm When T0 (flag while executing D0 Bus DMA) of the program control port is 1, moves to address displayed by Imm (immediate) JMP NT0, Imm When T0 (flag while executing D0 Bus DMA) of the program control port is 0, moves to address displayed by Imm LOOP BOTTOM Commands (immediate) de JMP ZS, Imm When either Z (zero flag) or S (sine flag) of the program control port is 1, moves to address displayed by Imm (immediate) JMP NZS, Imm When either Z (zero flag) or S (sine flag) of the program control BTM port is 0, moves to address displayed by Imm (immediate) When loop counter ([LOP]) is any number but 0, the top address register ([TOP]) is stored in the program counter and the loop counter ([LOP]) is decremented. No operation is done when 0. END Commands LPS END ENDI nfi When loop counter ([LOP]) is any number but 0, the program counter stops, the next command is executed, loop counter ([LOP]) is decremented. This is repeated until the loop counter is 0. Program stops and EX (program execute control flag) of the program control port is reset. Program stops and EX (program execute control flag) of the program control port is reset, and E (program end interrupt flag) Co is set. GA SE SCU User's Manual 83 • Description of Constants Follow the notation in Table 4.5. Table 4.5 Descriptions of Constants Notation Binary Digital Hexadecimal Description Place a "%" before numbers Place nothing before nor after numbers Place a "$" before numbers nti Example al %0010, %1111 2, 10, 16, 32 $05, $0A, $FF de nfi Co GA SE 84 4.3 Operand Execution Method DSP controls and executes registers as shown for the following commands. Jump Command Execution nti Jump command execution is attained by storing the jump destination address (Im- al mediate Data) in the program RAM address of the program control port. But you should be aware that commands that are pre-fetched will be executed. The condi- tional JUMP command examines the condition of the program control port flag, and then, if the conditions are met, stores the jump destination address in the program RAM address of the program control port. See the section on Jump commands under 4.5 “Commands” for the command format. Figure 4.2 is a flowchart of the Jump command execution. Jump de nfi Command Any Conditions? N Co N Y Conditions Satisfied ? Y Stores Jump destination address in program RAM address of program control port GA Executes pre-fetched commands END SE Figure 4.2 Jump Command Execution SCU User's Manual 85 Loop Program Execution Execution of programs between the address designated by the top address register ([TOP]) and the BTM command of the DSP (see Loop Bottom command under 4.5 ecution flow of the Loop program is shown in Figure 4.3. nti “Command” ) are repeated only the number of times indicated by the loop counter. Thus, in order to realize this process, it must be executed after setting values in the top address register and loop counter. Values can be set by the DSP load immediate al command (see section on Load Immediate Command under 4.5 “Command”). Ex- LOOP Sets the top address of the Loop program de Sets number of Loops BTM Command ? N nfi Y Loop End ? ([LOP]=0) Y Co N Execute command Decrement number of Loops GA Execute Pre-Fetch Commands Stores the Loop program top address in the program control port Execute Pre-Fetch Commands END SE Figure 4.3 Loop Program Execution 86 DMA Command Execution This sets the DMA controller register from the DSP and explains the actual process of DMA transfer. The DMA command is divided into the two types, shown below, depending on the transfer direction (read / write). 1) Data transfer from the D0-Bus to the DSP. 2) Data transfer from the DSP to the D0-Bus. • Data transfer from D0-Bus to DSP ntial DSP data RAM transfer begin address and external memory transfer begin address are set in registers ([CT0-3] and [RA0]), and transfer is begun by the DMA command. The command formats up to the DMA command are shown below. See 4.5 “Commands” for more information. MOV MVI DMA SImm , [CT0] Imm , [RA0] D0 , [MD0] , SImm de ; Sets DSP data RAM0 transfer begin address ; Sets external memory transfer begin address ; Begins DMA transfer using the D0 Bus nfi Table 4.6 is a collection of the features of DMA transfer. Because DMA transfer is executed by 1 long word units, setting of the transfer word number (SImm of the DMA command mentioned above) must be done in long word units. Item Co Table 4.6 Features of Data Transfer from D0 Bus to DSP Flag Set Start and End Feature T0 flag of the program control port is set Follows the data ready signal from outside. Transfer is done by this signal in 1 long word units. DMA transfer is ended by the end signal from outside, and the program control port T0 flag is reset by this timing. Address Update Each time 1 long word is transfered, 1 is added to the DSP data RAM transfer address ([CT0-3]), and the external memory transfer address ([RA0]) is added according to the address add number. GA Hold Status If the DMA command Hold bit (see item 4.5 "Commands" DMA command section) is set to 1, the transfer word number ([TN0]) and external memory transfer address ([RA0]) keep the transfer begin values. SE SCU User's Manual 87 • Data transfer from DSP to D0-Bus The DSP data RAM transfer begin address and external memory begin address are set in registers ([CT0-3]) and (WA0]), and transfer is begun by the DMA See item 4.5 for more information. nti command. The command formats up to the DMA command are shown below. MOV MVI DMA SImm , [CT0] Imm , [WA0] [MD0] , D0, SImm al ; Sets DSP data RAM0 transfer begin address ; Sets external memory transfer begin address ; Begins DMA transfer using the D0 Bus Table 4.7 is a collection of the features of DMA transfer. Because DMA transfer is executed in single long word units, setting of the transfer word number (SImm of Table 4.7 Features of Data Transfer from DSP to D0 Bus de the DMA command mentioned above) must be done in long word units. Item Feature Flag Set Start and End Address Change nfi T0 flag of the program control part is set Obeys the data ready signal from outside. Transfer is done by this signal in 1 long word units. DMA transfer is ended by the end signal from outside, and the program control port T0 flag is reset by this timing. Each time 1 long word is transfered, 1 is added to the DSP data RAM transfer address ([CT0-3]), and the external memory transfer address Hold Status END Command Execution Co ([WA0]) is added according to the address add number. If the DMA command Hold bit (see item 4.5 "Commands" DMA command section) is set to 1, the transfer word number ([TN0]) and external memory transfer address ([WA0]) keep the transfer begin values. When the END command is recognized, the program control port program RAM address add process is stopped and the program execution control bit (EX flag) is GA reset. Execution of the DSP program is stopped accordingly. But data transfer by the DMA command continues ignoring this END command until the transfer is completed. The value of the program address when the program termintes stops at the address that follows the address stored in END command. SE 88 4.4 Special Process Execution DSP can execute the following special processes. 1) Loading a Program by the DMA command 2) Repeating One Command 3) Execution of subroutine program Loading a Program by the DMA command ntial Loading from the CPU was explained earlier as one method of loading a program (see section 2.3), but a program can be loaded in the DSP program RAM by using the DSP DMA command as well. Loading a program is done in the following formats. MVI Imm , [RA0] DMA D0 , [PRG], SImm MVI Imm , [PC] , SImm de ; Sets external memory transfer begin address ; Sets transfer word number, begins transfer ; Sets program execution start address Repeating One Command nfi The format for repeating 1 command is shown below. The 1 command repeat execu- tion command (see LPS command in section 4.5 “Command” under the part on Loop Bottom) repeat the following commands. The repeat number executes one time more than the set value. MVI LPS ### Co Imm , [LOP] ; Sets number of repetitions ; Repeat execution comand ; This command is repeatedly executed GA SE SCU User's Manual 89 Executing a SubRoutine Program There are no special commands (mnemonic) in the DSP program for executing subroutines. By combining the Load Immediate command to the [PC] with the Loop nti Bottom command, subroutines are created in the form shown in Figure 4.4. al Main Subroutine Program MOV $01 , [LOP] MOV Imm , [PC] Designates execution 1 time Sets subroutine program start address de Child Program NOP Program Caution: nfi Executed 2 times Jumps after execution Program within subroutine END Co BTM Execute pre-fetched command of next step Return to start address GA Figure 4.4 Subroutine Program Execution SE 90 4.5 More About Commands Operation Commands 1) ALU control command nti Operation commands use each X, Y, and D1 bus as well as an arithmetic logic unit (ALU). Operation commands can be classified into the following four control types. 2) X-Bus control command 3) Y-Bus control command al 4) D1-Bus control command The operation command format is as shown in Figure 4.5. 31 30 29 26 25 0 0 ALU Control X-Bus Control 20 19 de14 13 Y-Bus Control D1-Bus Control 0 nfi Figure 4.5 Operation Command Format Operation commands can execute these four types of commands concurrently. Mnemonics should list the ALU control command to the far left. Other required commands should be listed and separated by a space or tab. Co GA SE SCU User's Manual 91 • ALU Control Command ALU control commands operate using the ALU. The following pages show more about ALU control commands. ntial de nfi Co GA SE 92 NOP ALU No Operation Operation nti No ALU command process Description Label NOP al Instruction Code b31 26 0 0 0 0 0 0 de 0 nfi Co Flag No change GA Comments SE SCU User's Manual 93 AND AND Operation Operation Takes the AND operation of [ACL] and [PL] logical product. Description ntial Label AND Instruction Code b31 26 0 0 0 0 01 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. Comments GA C ; is 0. SE 94 OR OR Operation Operation Takes the OR operation of [ACL] and [PL] logical sum. Description ntial Label OR Instruction Code b31 26 0 0 0 01 0 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. GA Comments C ; is 0. SE SCU User's Manual 95 XOR Exclusive OR Operation Operation Takes the exclusive OR operation of [ACL] and [PL]. Description ntial Label XOR Instruction Code b31 26 0 0 0 01 1 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. Comments GA C ; this is 0. SE 96 ADD Addition Operation ADDS [ACL] and [PL]. Description ntial Label ADD Instruction Code b31 26 0 0 01 0 0 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. GA C ; 1 when carry occurs as a result of the operation, otherwise it is 0. V ; 1 when there is overflow (exceeds 48 bits)opeation result, otherwise it is 0. Comments SE SCU User's Manual 97 SUB Subtraction Operation Subtracts [PL] from [ACL]. Description ntial Label SUB Instruction Code b31 26 0 0 01 01 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. GA C ; 1 when carry occurs as a result of the operation, otherwise it is 0. V ; 1 when there is underflow in the opeation result,otherwise it is 0. Comments SE 98 AD2 Addition Operation Adds [ACH][ACL] and [PH][PL]. Description ntial Label AD2 Instruction Code b31 26 0 0 01 1 0 de 0 nfi Co Flag S ; 1 when operation result is negative, otherwise it is 0. Z ; 1 when operation result is 0, otherwise it is 0. GA C ; 1 when carry occurs as a result of the operation, otherwise it is 0. V ; 1 when there is overflow (exceeds 48 bits)operation result, otherwise it is 0. Comments SE SCU User's Manual 99 SR Right Shift 1 Bit Operation nti Shifts the value of [ACL] right 1 bit, and the value of bit 0 is stored in C flag. Description MSB LSB Label SR b31 b30 b29 b2 al b1 b0 C Instruction Code b31 26 0 01 0 0 0 de 0 nfi Co Flag S ; 1 when operation result MSB is 1,0 when 0. Z ; 1 when operation result is 0, otherwise it is 0. Comments GA C ; 1 when the value of b0 of input data is 1, 0 when 0. ACL ; Shifts 1 bit to the right, most significant bit (b31) does not change SE 100 RR Right Rotate 1 Bit Operation nti Rotates the [ACL] value right 1 bit. Description MSB LSB b31 b30 b29 b0 Label RR al C Instruction Code b31 26 0 01 0 01 de 0 nfi Co Flag S ; 1 when operation result MSB is 1,0 when 0. GA Z ; 1 when operation result is 0, otherwise it is 0. C ; 1 when the value of b0 of input data is 1, 0 when 0. ACL ; Shifts 1 bit to the right, least significant bit (b0) moves to the most significant bit (b31). Comments SE SCU User's Manual 101 SL Left Shift 1 Bit Operation nti Shifts the [ACL] value left 1 bit. Description MSB LSB al b31 b30 b29 0 C Label SL Instruction Code b31 26 0 01 01 0 de 0 nfi Co Flag S ; 1 when operation result MSB is 1,0 when 0. GA Z ; 1 when operation result is 0, otherwise it is 0. C ; 1 when the value of b31 of input data is 1, 0 when 0. ACL ; Shifts 1 bit to the left; least significant bit (b0) is 0. Comments SE 102 RL Left Rotate 1 Bit Operation nti Rotates the [ACL] value left 1 bit. Description MSB LSB b31 b30 b29 b0 Label C RL al Instruction Code b31 26 0 01 01 1 de 0 nfi Co Flag S ; 1 when operation result MSB is 1,0 when 0. Z ; 1 when operation result is 0, otherwise it is 0. GAComments C ; 1 when the value of b31of input data is 1, 0 when 0. ACL ; Shifts 1 bit to the left, most significant bit (b31) moves to the least significant bit (b0). SE SCU User's Manual 103 RL8 Left Rotate 8 Bits Operation Rotates the [ACL] value left 8 bits. Description C MSB b31 b30 b29 ntial LSB b0 Label RL8 Instruction Code b31 26 0 01 1 1 1 de 0 nfi Co Flag S ; 1 when operation result MSB is 1,0 when 0. Z ; 1 when operation result is 0, other wise 0. GA C ; 1 when the value of b24of input data is 1, 0 when 0. ACL ; Rotates 8bits to the left. Comments SE 104 • X-Bus Control Commands X-Bus control commands transfer data using the X-Bus to the RX register and PH, PL registers. The following pages show more about X-Bus control commands. ntial de nfi Co GA SE SCU User's Manual 105 NOP X-Bus No Operation Operation nti No X-Bus control process Description Label NOP al Instruction Code b31 0 0 25 23 0 0 0 de 0 nfi Co Flag No change Comments GA SE 106 MOV [s],X Transfer (Memory →[RX]) Operation nti Data is transfered to [RX] from the data RAM address displayed by [CTx(x=0~3)]. Description al [CTx] [RX] 32bit Label MOV [Source RAM],X Instruction Code b31 0 0 de Source RAM = MO ~ M3 *,MC0 ~ MC3 * 25 20 1 0 0x x x 0 nfi bit 22 0 0 0 0 Bit Data bit 21 bit 20 0 0 1 1 Process Selections 0 DATA RAM0 1 DATA RAM1 0 DATA RAM2 1 DATA RAM3 [RX] [RX] [RX] [RX] Co 1 1 1 1 0 0 1 1 0 DATA RAM0 1 DATA RAM1 0 DATA RAM2 1 DATA RAM3 [RX] ,CT0++ [RX] ,CT1++ [RX] ,CT2++ [RX] ,CT3++ Flag * RX ; becomes data selected by multiple choice. GAComments CTx(x=0 ~ 3) ; incremented as long as b22 = 1. No change when b22 0. * [Mx(x=0 ~ 3)] designates DATA RAMx(x=0~3). [MCx(x=0 ~ 3)] designates DATA RAMx(x=0~3) and after transfer, increments [CTx(x=0~3). SE SCU User's Manual 107 MOV MUL,P Transfer (MULTIPLIER →[Pn]) Operation Description nti The high order 16 bit of the MULTIPLIER data 48 bit is transfered to [PH], and the low order 32 bit is transferred to [PL] 16bit MULTIPLIER 32bit al [PH] [PL] Label MOV MUL,P Instruction Code b31 0 0 25 0 1 0 20 de 0 nfi Co Flag PH ; becomes MULTIPLIER high order 16 bit data GA PL ; becomes the MULTIPLIER low order 32 bit data Comments SE 108 MOV [s],P Transfer (Memory →[PL]) Operation Description nti Data is transfered to [PL] from the data RAM address displayed by [CTx(x=0~3)]. The value of [PH] is changed by the [PL] sign extension. [CTx] al 32bit [PL] Label MOV [Source RAM],P Instruction Code b31 0 0 de Source RAM = MO ~ M3,MC0 ~ MC3 * 25 20 0 1 1x x x 0 nfi bit 22 0 0 0 0 Bit Data bit 21 bit 20 0 0 1 1 Process Selections 0 DATA RAM0 1 DATA RAM1 0 DATA RAM2 1 DATA RAM3 [PL] [PL ] [PL] [PL] Co 1 1 1 1 0 0 1 1 0 DATA RAM0 1 DATA RAM1 0 DATA RAM2 1 DATA RAM3 [PL] ,CT0++ [PL] ,CT1++ [PL] ,CT2++ [PL] ,CT3++ GA Flag PL ; becomes data selected by multiple choice. PH ; changed by [PL] sign extension. CTx(x=0~3) ; incremented when b22 = 1. No change when b22 = 0. Comments * [Mx(x=0 ~ 3)] designates DATA RAMx(x=0~3). [MCx(x=0 ~ 3)] designates DATA RAMx(x=0~3) and after transfer increments [CTx(x=0~3). SE SCU User's Manual 109 • Y-Bus Control Commands Y-Bus control commands transfer data using the Y-Bus to the RY register and ACH, ACL registers. The following pages shows more about Y-Bus control commands. ntial de nfi Co GA SE 110 NOP Y-Bus No Operation Operation nti No Y-Bus control process Description Label NOP al Instruction Code b31 0 0 de 19 17 0 0 0 0 nfi Co Flag No change GAComments SE SCU User's Manual 111 MOV [s],Y Transfer (Memory →[RY]) Operation Description nti Data is transfered to [RY] from the data RAM address displayed by [CTx(x=0~3)]. [CTx] 32bit al[RY] Label MOV [Source RAM],Y Instruction Code b31 0 0 de Source RAM = MO ~ M3,MC0 ~ MC3 * 19 14 1 0 0x x x 0 1 nfi bit16 bit15 bit 14 0 0 0 0 Bit Data 0 0 1 Process Selections 0 DATA RAM0 1 DATA RAM1 0 DATA RAM2 1 DATA RAM3 [RY] [RY ] [RY] [RY] Co 1 1 1 1 0 0 1 1 0 DATA RAM0 1 DATA RAM0 0 DATA RAM0 1 DATA RAM0 [RY] ,CT0++ [RY] ,CT1++ [RY] ,CT2++ [RY] ,CT3++ GA Flag RY ; becomes data selected by multiple choice. CTx(x=0~3) ; incremented when b16 = 1. No change when b16 = 0. Comments * [Mx(x=0 ~ 3)] designates DATA RAMx(x=0~3). [MCx(x=0 ~ 3)] designates DATA RAMx(x=0~3) and after transfer increments [CTx(x=0~3). SE 112 CLR A 0 Clear nti Operation 0 clears the [ACH] and [ACL] values. Description Label CLR A al Instruction Code b31 0 0 de 19 0 0 1 14 0 nfi Co Flag ACH ; becomes 0 GA ACL ; becomes 0 Comments SE SCU User's Manual 113 MOV ALU,A Transfer ([ALU] →[ACH][ACL]) Operation Description nti Transfers the value of the [ALU] high order 16 bit to [ACH] and the value of the [ALU] low order 32 bit to [ACL]. 16bit ALU 32bit al [ACH] [ACL] Label MOV ALU,A Instruction Code b31 0 0 19 0 1 0 de 14 0 nfi Co Flag ACH ; becomes ALU high order 16 bit data GA ACL ; becomes ALU low order 32 bit data Comments SE 114 MOV [s],A Transfer (Memory →[ACL]) Operation Description nti Data is transfered to [ACL] from the data RAM address displayed by [CTx(x=0~3)]. The value of [ACH] is changed by the sign extension of [ACL]. [CTx] al 32bit [ACL] Label MOV [Source RAM],A Instruction Code b31 0 0 de Source RAM = MO ~ M3,MC0 ~ MC3 * 19 14 0 1 1x x x 0 nfi bit16 bit15 bit 14 0 0 0 0 Bit Data 0 0 1 1 Process Selections 0DATA RAM0 1DATA RAM1 0DATA RAM2 1DATA RAM3 [ACL] [ACL] [ACL] [ACL] Co 1 1 1 1 0 0 1 1 0DATA RAM0 1DATA RAM1 0DATA RAM2 1DATA RAM3 [ACL] ,CT0++ [ACL] ,CT1++ [ACL] ,CT2++ [ACL] ,CT3++ GA Flag ACL ; becomes data selected by multiple choice. ACH ; is changed by the sign extension of [ACL] CTx(x=0~3) ; incremented when b16 = 1. No change when b16 = 0. Comments * [Mx(x=0 ~ 3)] designates DATA RAMx(x=0~3). [MCx(x=0 ~ 3)] designates DATA RAMx(x=0~3) and after transfer increments [CTx(x=0~3). SE SCU User's Manual 115 • D1-Bus Control Commands D1-Bus control commands control the exchange of data between memory connected to the D1-Bus. The following pages shows more about D1-Bus control commands. ntial de nfi Co GA SE 116 NOP D1-Bus No Operation Operation No D1-Bus control process Description ntial Label NOP Instruction Code b31 0 0 de 13 0 0 0 nfi Co Flag No change GA Comments SE SCU User's Manual 117 MOV SImm,[d] Transfer (SImm →[destination]) Operation Description nti SImm data is transfered to the RAM or register designated by [destination]. SImm data is signed 8 bit data. Short Immediate Data [destination] al D31 - 7 ← b7 D6-0 ← b6-0 Label MOV SImm,[Destination] Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,TOP,CT0 ~ CT3 Instruction Code b31 0 0 de 13 8 7 0 1x x x x SImm Data 0 nfi bit11 bit10 bit 9 0 0 0 0 0 Bit Data 0 0 0 0 1 0 0 1 1 0 bit 8 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] [TOP] [CT0] 1 1 0 1 [CT1] 1 1 1 0 [CT2] Flag Comments GA 1 1 1 1 [CT3] Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAMx(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 118 MOV [s],[d] Transfer ([source]→[destination]) nti Operation RAM data or register data designated by [source] is transfered to the RAM or register designated by [destination]. Description Label MOV [Source], [Destination] Source = M0 ~ M3 *,MC0 ~ MC3 *,ALH,ALL al Destination = MC0 ~ MC3,RX,PL,RA0,WA0,LOP,TOP,CT0 ~ CT3 Instruction Code b31 0 0 de 13 8 1 1x x x x 3 0 x x x x bit11 bit10 bit 9 bit 8 0 0 0 0 nfi Bit Data 0 0 0 0 0 0 1 1 0 1 0 1 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ bit 3 bit 2 0 0 0 0 Bit Data 0 0 0 0 bit 1 0 0 1 1 bit 0 0 1 0 1 [s] Selections DATA RAM0 DATA RAM1 DATA RAM2 DATA RAM3 Co 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 [RX] [PL] [RA0] [WA0] unused unused [LOP] [TOP] 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 DATA RAM0 DATA RAM1 DATA RAM2 DATA RAM3 no field [ALU LOW] [ALU HIGH] ,CT0++ ,CT1++ ,CT2++ ,CT3++ 1 1 0 0 [CT0] 1 1 0 1 [CT1] GA 1 1 1 0 [CT2] 1 1 1 1 [CT3] Flag Area selected by [d] selection is data of an area selected by [s] selectio Comments * [Mx(x=0 ~ 3)] designates DATA RAM x(x=0~3) [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 119 Load Immediate Command The load immediate command transfers immediate data to the storage destination. Unconditional transfer follows the format in Figure 4.6. Conditional transfer follows the format in Figure 4.7. Details are on the following pages. 31 30 29 Storage 26 25 24 1 0 Destination 0 Immediate data ntial 0 Figure 4.6 Load Immediate Command Format 1 (Unconditional Transfer) 31 30 29 26 25 24 19 18 0 Storage 1 0 Destination 1 Status de Immediate data Figure 4.7 Load Immediate Command Format 2 (Conditional Transfer) nfi Co GA SE 120 MVI Imm,[d] Unconditional Transfer (Imm →[destination]) Operation Description nti Imm data is unconditional and is transfered to the RAM or register designated by [destination]. Imm data is signed 25 bit data. al Label MVI Imm,[Destination] Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 0 24 de Imm Data 0 nfi bit11 bit10 bit 9 0 0 0 0 0 Bit Data 0 0 0 0 1 0 0 1 1 0 bit 8 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 [PL] [RA0] [WA0] unused unused [LOP] unused 1 1 0 0 [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 GA unused 1 1 1 1 unused Flag Area selected by [d] multiple choice ; becomes Imm data Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 121 MVI Imm,[d]Z Conditional Transfer (Z=1 then Imm →[destination]) nti Operation When the Z flag is 1, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used as execution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],Z Destination RAM = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 1 1 0 0 0 0 1 Bit Data 18 de Imm Data 0 bit29 0 0 0 0 0 0 0 0 0 1 nfi bit28 bit27 bit26 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused Flag Comments GA 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 122 MVI =Imm,[d]NZ Conditional Transfer (Z=0 then Imm →[destination]) nti Operation When the Z flag is 0, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used as execution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],NZ Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 de 1 0x x x x 1 1 0 0 0 0 1 Bit Data 18 Imm Data 0 nfi bit29 0 0 0 0 0 bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GAFlag Comments 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer , increments [CTx(x=0~3). SE SCU User's Manual 123 MVI Imm,[d]S Conditional Transfer (S=1 then Imm →[destination]) Operation nti When the S flag is 1, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Th address next after this command will be executed twice, once before the subroutine and once after. Label MVI Imm,[Destination],S Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 1 1 0 0 0 1 0 18 de Imm Data 0 bit29 0 0 0 0 0 Bit Data bit28 bit27 bit26 0 0 0 0 1 nfi 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused Flag Comments GA 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 124 MVI Imm,[d]NS Conditional Transfer (S=0 then Imm →[destination]) nti Operation When the S flag is 0, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],NS Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 de 1 0x x x x 1 1 0 0 0 1 0 Bit Data 18 Imm Data 0 nfi bit29 0 0 0 0 0 bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GAFlag Comments 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 125 MVI Imm,[d]C Conditional Transfer (C=1 then Imm →[destination]) nti Operation When the C flag is 1, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],C Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 1 1 0 0 1 0 0 Bit Data 18 de Imm Data 0 bit29 0 0 0 0 0 0 0 0 0 1 nfi bit28 bit27 bit26 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused Flag Comments GA 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 126 MVI Imm,[d]NC Conditional Transfer (C=0 then Imm →[destination]) nti Operation When the C flag is 0, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],NC Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 de 1 0x x x x 1 1 0 0 1 0 0 Bit Data 18 Imm Data 0 nfi bit29 0 0 0 0 0 bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GAFlag Comments 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 127 MVI Imm,[d],T0 Conditional Transfer (T0=1 then Imm →[destination]) Operation nti When the T0 flag is 1, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Description Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],T0 Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 1 1 0 1 0 0 0 Bit Data 18 de Imm Data 0 bit29 0 0 0 0 0 0 0 0 0 1 nfi bit28 bit27 bit26 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GA 1 1 1 1 unused Flag Area selected by [d] selection ; becomes Imm data Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 128 MVI Imm,[d]NT0 Conditional Transfer (T0=0 then Imm →[destination]) Operation Description nti When the T0 flag is 0, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],NT0 Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 de 1 0x x x x 1 0 0 1 0 0 0 18 Imm Data 0 nfi bit29 0 0 0 0 0 Bit Data bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 1 0 0 1 1 1 0 1 0 1 0 1 [PL] [RA0] [WA0] unused unused [LOP] unused 1 1 0 0 [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GAFlag Comments 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 129 MVI Imm,[d]ZS Conditional Transfer (Z=1 or S=1 then Imm → [destination]) Operation Description nti When the Z flag or S flag is 1, Imm data is transfered to the RAM or register designated by [destination]. Imm data is signed 19 bit data. Can be used asexecution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],ZS Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 1 0x x x x 1 1 0 0 0 1 1 18 de Imm Data 0 bit29 0 0 0 0 0 nfi Bit Data bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ Co [RX] 0 1 0 1 [PL] 0 1 1 0 [RA0] 0 1 1 1 [WA0] 1 0 0 0 unused 1 0 0 1 unused 1 0 1 0 [LOP] 1 0 1 1 unused 1 1 0 0 [PC] → [TOP] ,[PC] 1 1 0 1 unused GA 1 1 1 0 unused 1 1 1 1 unused Flag Area selected by [d] selection ; becomes Imm data Comments * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE 130 MVI Imm,[d]NZS Conditional Transfer (Z=0=S then Imm → [destination]) Operation nti When the Z flag or S flag are both 0, Imm data is transfered to the RA or register designated by [destination]. Imm data is signed 19 bit data Description Can be used as execution of the subroutine program (see instruction code**) by sending Imm data (subtroutine begin dress) to the PC and al saving the PC (jump address after subroutine ends) value to TOP. Be aware that the address next after this command will be executed twice once before the subroutine and once after. Label MVI Imm,[Destination],NZS Destination = MC0 ~ MC3 *,RX,PL,RA0,WA0,LOP,PC Instruction Code b31 de 1 0x x x x 1 0 0 0 0 1 1 18 Imm Data 0 nfi bit29 0 0 0 0 0 Bit Data bit28 bit27 bit26 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 [d] Selections DATA RAM0 ,CT0++ DATA RAM1 ,CT1++ DATA RAM2 ,CT2++ DATA RAM3 ,CT3++ [RX] Co 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 [PL] [RA0] [WA0] unused unused [LOP] unused [PC] → [TOP] ,[PC] 1 1 0 1 unused 1 1 1 0 unused GAFlag Comments 1 1 1 1 unused Area selected by [d] selection ; becomes Imm data * [MCx(x=0 ~ 3)] designates DATA RAM x(x=0~3) and, after transfer, increments [CTx(x=0~3). SE SCU User's Manual 131 DMA Command DMA commands transfer data of an external and DSP internal RAM through an external bus. There are two methods, one of which is setting the transfer word Details of the command are shown on the pages that follow. nti number directly by Imm data, and the other is setting the internal RAM transfer word number by designating the number of the internal data RAM. The first method is shown in Figure 4.8 and the second method is shown in Figure 4.9. 31 30 29 28 27 18 17 15 14 13 12 11 10 8 7 al 0 Add 1 1 0 0 Mode H 0 dir RAM Immediate data 31 30 29 28 27 1 1 0 0 Figure 4.8 DMA Command Format 1 18 17 Add Mode de 15 14 13 12 11 10 8 7 H 1 dir RAM 3 2 SOURCE 0 nfi Figure 4.9 DMA Command Format 2 Co GA SE 132 DMA D0,[RAM],SImm DMA Transfer (D0[31-0] → RAM) nti Operation D0[31-0] data is transfered to RAM . The external address register and transfer word number register are updated (added) according to Description the address add number. The transfer word number register is a register for storing the transfer word number in long word units. This word number is either 0 or transfer ends when forced to end. Label DMA D0,[Destination],Counter al Destination = M0 ~ M3 * Instruction Code b31 28 1 1 0 0 de 17 15 x x x 0 0 0 0 0x x 7 SImm Data 0 bit17 bit16 bit15 0 0 0 nfi Bit Data 0 0 1 0 1 0 Add Mode Selections Address Add 0 Address Add 1 Address Add 2 Bit Data bit9 bit8 0 0 1 0 1 0 Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 Co 0 1 1 Address Add 4 1 1 DATA RAM 3 1 0 0 Address Add 8 1 0 1 Address Add 16 1 1 0 Address Add 32 1 1 1 Address Add 64 Flag T0 ; becomes 1. GAComments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command and becomes DMA0~DMA64. SE Add number is1 when address add number designation is omitted. The transfer source address is set in advance to RA0 and the transfer destination RAM address is set in advance to CTx. SCU User's Manual 133 DMA [RAM],D0,SImm DMA Transfer (RAM → D0[31-0]) Operation Description nti RAM data is transfered to D0[31-0]. The external address register and transfer word number register are updated (added) according to the address add number. Only add numbers 0 and 1 are valid for the -A Bus and the write unit is 32bit. All add numbers (0 - 64) are valid for al the B-Bus. Write unit is16bit; 32bit data is divided in half and written at intervals of16X (0-64). The transfer word number register is a register for storing the transfer word number in long word units. This word number is either 0 or transfer ends when forced to end. Label DMA [Source],D0,Counter Source = Mo ~ M3 * Instruction Code b31 1 1 0 0 17 15 de x x x 0 0 1 0 0x x 7 SImm Data 0 bit17 bit16 bit15 0 0 0 0 Bit Data 0 0 1 1 0 1 0 1 nfi Add Mode Selections Address Add 0 Address Add 1 Address Add 2 Address Add 4 Bit Data bit9 bit8 0 0 1 1 0 1 0 1 Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 1 1 1 1 Co 0 0 1 1 0 1 0 1 Address Add 8 Address Add 16 Address Add 32 Address Add 64 Flag T0 ; becomes 1. Comments GA * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command and becomes DMA0~DMA64. Add number is 1 when address add number designation is omitted. The transfer source RAM address is set in advance to CTx and the SE transfer destination address is set in advance to WA0. 134 DMA D0,[RAM],[s] DMA Transfer (D0[31-0] → RAM ) Operation Description Label nti [s] data designated by bit0~2 is treated as a transfer counter, and only numbers displayed transfer D0[31-0] data to the RAM. External address register and transfer word number register are updated (added) according to the address add number. The transfer word al number register stores transfer word numbers in long word units. This word number becomes 0 or transfer ends when forced to end. DMA D0,[Destination],[Counter] Counter = M0 ~ M3 *,MC0~MC3* Destination = M0~M3 *,PRG * Instruction Code de Valid only for A-Bus Address add is 32bit units. bit 15 Add Mode Selections 0 1 Address Add 0 Address Add 1 b31 28 1 1 0 0 Bit Data nfi bit 10 bit9 bit8 0 0x 0 1 0 0x x x RAM Selections bit 2 Bit Data 7 bit1 bit 0 0 x x x [s] Selections Co 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 PROGRAM RAM 0 0 0 0 1 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 DATA RAM 0,CT0++ DATA RAM 1,CT1++ DATA RAM 2,CT2++ 1 1 1 DATA RAM 3,CT3++ Flag T0 ; becomes 1. ** GAComments CTx(x0~3) ; incremented when b2=1. When b2=0, there is no change * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects DATA RAM x(x=0~3), and after transfer increments CTx(x0~3). PRG selects program RAM. **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command an becomes DMA0~DMA1. SE Add number is 1 when address add number designation is omitted. The transfer source address is set in advance to RA0 and the transfer destination RAM address is set in advance to CTx. SCU User's Manual 135 DMA [RAM],D0,[s] DMA Transfer (RAM → D0[31-0] ) nti Operation [s] data designated by bit0~2 is treated as a transfer counter, and only numbers displayed transfer RAM data to DO[31-0] data. External Description address register and transfer word number register are updated (added) according to the address add number. The transfer word number register stores transfer word numbers in long word units. But Label al only add numbers 0 and 1 are valid for A-Bus, and write units are 32 bits. For B-Bus, all add numbers (0-64) are valid. Write units are 16 bit; 32 bit data is divided in half and written at intervals of 16bitX (0-64). Th transfer word number register stores transfer words in long word units. This word number becomes 0 or transfer ends when forced to end. DMA D0,[Destination],[Counter] Counter = M0 ~ M3 *,MC0~MC3* Instruction Code 0 Source = M0~M3 *,PR* Bit Data bit17 bit16 bit15 0 0 0 0 1 0 1 0 Add Mode Selections Address Add 0 Address Add 1 Address Add 2 de bit 2 bit1 bit 0 0 0 0 Bit Data 0 0 1 0 1 0 [s] Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 nfi Address Add 4 Address Add 8 Address Add 16 Address Add 32 Address Add 64 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 DATA RAM 3 DATA RAM 0,CT0++ DATA RAM 1,CT1++ DATA RAM 2,CT2++ DATA RAM 3,CT3++ b31 1 1 0 0 Co 17 x x x 0 1 1 0 0x x Bit Data bit9 bit8 0 0 0 1 7 RAM Selections DATA RAM 0 DATA RAM 1 0 x x x 1 0 DATA RAM 2 1 1 DATA RAM 3 Flag Comments GA T0 ; becomes 1. ** CTx(x=0~3) ; incremented when b2=1. No changes when b2=0. * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects DATA RAM x(x=0~3), and after transfer increments CTx(x0~3). **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command an SE becomes DMA0~DMA64. Add number is 1 when address add number designation is omitted. The transfer source RAM address is set in advance to CTx and the transfer destination address is set in advance to WA0. 136 DMAH D0,[RAM],SImm DMA Transfer (D0[31-0] → RAM) by HOLD Status Operation Description Label nti D0[31-0] data is transfered to the RAM. External address register and transfer word number register save the value at the time transfer begins. The transfer word number register stores the transfer word number in long word units. This word number becomes 0 or becomes the transfer end when forced to end. DMAH D0,[Destination],[Counter] al Destination = M0~M3 *,PR* Instruction Code b31 28 1 1 0 0 de bit 15 Add Mode Selections 17 15 0 0x 0 1 0 0x x x Bit Data bit 10 bit9 bit8 7 0 x x x SImm Data RAM Selections 0 1 nfi Address Add 0 Address Add 1 Valid only for A-Bus Address add is 32 bit unit. 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 PROGRAM RAM Flag Co T0 ; becomes 1.** Comments * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). PR selects PROGRAM RAM GA **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command an becomes DMAH0~DMAH1. Add number is 1 when address add number designation is omitted. The transfer source address is set in advance to RA0 and the transfer destination RAM address is set in advance to CTx. SE SCU User's Manual 137 DMAH [RAM],D0,SImm DMA Transfer (RAM → D0[31-0]) by HOLD Status Operation Description Label nti RAM data is transfered to D0[31-0]. The external address register and transfer word number register save the value when transfer starts. The transfer word number register is a register for storing the transfer word number in long word units. This word number is either 0 or transfer ends when forced to end. DMA H [Source],D0,Counter al Source = Mo ~ M3 * Instruction Code b31 1 1 0 0 Bit Data 17 15 de x x x 1 0 1 0 0x x 7 Bit Data SImm Data 0 bit17 bit16 bit15 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 nfi Add Mode Selections Address Add 0 Address Add 1 Address Add 2 Address Add 4 Address Add 8 bit9 bit8 0 0 1 1 0 1 0 1 Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 1 1 1 Co 0 1 1 1 0 1 Address Add 16 Address Add 32 Address Add 64 Flag T0 ; becomes 1.** Comments GA * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). **When the END signal informing you that transfer end fromoutside has been entered, T0; becomes 0. Designating address-add adds an add number after the command and becomes DMAH0~DMAH64. Add number is 1 when address add number designation is omitted. The transfer source RAM address is set in advance to CTx and the SE transfer destination address is set in advance to WA0. 138 DMAH D0,[RAM],[s] DMA Transfer (D0[31-0] → RAM ) by HOLD Status nti Operation [s] data designated by bit0~2 is treated as transfer counter, and only numbers displayed transfer RAM data to D0(31-0) data. External Description address register and transfer word number register save the value, when starting transfer, to the address add number. The transfer word number register stores transfer word numbers in long word units. This Label al word number becomes 0 or transfer ends when forced to end. DMA H D0,[Destination],[Counter] Counter = M0 ~ M3 *,MC0~MC3* Destination = M0~M3 *,PR* Instruction Code de Valid only for A-Bus Address add is 32bit units. bit 15 Add Mode Selections 0 1 Address Add 0 Address Add 1 b31 28 1 1 0 0 nfi Bit Data 0 0x 1 1 0 0x x x Bit Data 7 0 x x x Co bit 10 bit9 bit8 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 RAM Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 PROGRAM RAM bit 2 0 0 0 0 1 1 0 0 1 1 0 0 bit1 bit 0 0 1 0 1 0 1 [s] Selections DATA RAM 0 DATA RAM 1 DATA RAM 2 DATA RAM 3 DATA RAM 0,CT0++ DATA RAM 1,CT1++ 1 1 0 DATA RAM 2,CT2++ 1 1 1 DATA RAM 3,CT3++ GAFlag Comments T0 ; becomes 1. ** CTx(x0~3) ; incremented when b2=1. When b2=0, there is no change * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects DATA RAM x(x=0~3), and after transfer increments CTx(x0~3). **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command an becomes DMAH0~DMAH1. SE Add number is 1 when address add number designation is omitted. The transfer source address is set in advance to RA0 and the transfer destination RAM address is set in advance to CTx. SCU User's Manual 139 DMA [RAM],D0,[s] DMA Transfer (RAM → D0[31-0] ) by HOLD Status nti Operation [s] data designated by bit0~2 is treated as transfer counter, and only numbers displayed transfer RAM data to D0[31-0] data. External Description address register and transfer word number register save the value when starting transfer. The transfer word number register stores transfer words in long word units. This word number becomes 0 or Label transfer ends when forced to end. DMAH [Source],DO,[Counter] Counter = M0 ~ M3 *,MC0~MC3* Source = M0~M3 *,PR* al Instruction Code 0 0 0 Bit Data bit17 bit16 bit15 Selections 0 0 1 0 1 0 Add Mode Address Add 0 Address Add 1 Address Add 2 de bit 2 bit1 bit 0 0 0 0 Bit Data 0 0 1 0 1 0 [s] Selections Data RAM 0 Data RAM 1 Data RAM 2 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 nfi Address Add 4 Address Add 8 Address Add 16 Address Add 32 Address Add 64 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 Data RAM 3 Data RAM 0 ,CT0++ Data RAM 1 ,CT1++ Data RAM 2 ,CT2++ Data RAM 3 ,CT3++ b31 Co 1 1 0 0 17 x x x 1 1 1 0 0x x Bit Data bit9 bit8 0 0 0 1 7 RAM Selections DATA RAM 0 DATA RAM 1 0 x x x 1 0 DATA RAM 2 1 1 DATA RAM 3 Flag CommentsGA T0 ; becomes 1. ** CTx(x=0~3) ; incremented when b2=1. No changes when b2=0. * [MCx(x=0 ~ 3)] selects DATA RAM x(x=0~3). MCx(x=0~3) selects DATA RAM x(x=0~3), and after transfer increments CTx(x0~3). **When the END signal informing you that transfer end from outside has been entered, T0; becomes 0. Designating address-add adds an add number after the command and becomes DMAH0~DMAH64. SE Add number is 1 when address add number designation is omitted. The transfer source RAM address is set in advance to CTx and the transfer destination address is set in advance to WA0. 140 JUMP Commands Jump commands are realized by storing immediate data in the program counter. Figure 4.10 shows the Jump command format. Details of the command are shown in the next few pages. 31 30 29 28 27 26 25 24 1 1 0 1 Status 19 18 ntial 8 7 Immediate 0 Figure 4.10 Jump Command Format de nfi Co GA SE SCU User's Manual 141 JMP Imm Unconditional Jump Operation nti Jumps according to address data (Imm). Description Label JMP [address] al Instruction Code b31 1 1 0 1 25 19 0 0 0 0 0 0 0 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 142 JMP Z, Imm Conditional Jump (Z = 1) nti Operation When the Z flag is 1, jump is in accordance with address data (Imm). Description Label JMP Z,[address] al Instruction Code b31 1 1 0 1 25 de 19 1 1 0 0 0 0 1 7 Imm Data 0 nfi Co Flag No change GA Comments SE SCU User's Manual 143 JMP NZ,Imm Conditional Jump (Z=0) nti Operation When the Z flag is 0, jump is in accordance with address data (Imm). Description Label JMP NZ,[address] al Instruction Code b31 1 1 0 1 25 19 1 0 0 0 0 0 1 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 144 JMP S,Imm Conditional Jump (S=1) Operation nti When the S flag is 1, jump is in accordance with address data (Imm). Description Label JMP S,[address] al Instruction Code b31 1 1 0 1 25 de 19 1 1 0 0 0 1 0 7 Imm Data 0 nfi Co Flag No change GA Comments SE SCU User's Manual 145 JMP NS,Imm Conditional Jump (Z=0) Operation nti When the S flag is 0, jump is in accordance with address data (Imm). Description Label JMP NS,[address] al Instruction Code b31 1 1 0 1 25 19 1 0 0 0 0 1 0 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 146 JMP C,Imm Conditional Jump (C=1) nti Operation When the C flag is 1, jump is in accordance with address data (Imm). Description Label JMP C,[address] al Instruction Code b31 1 1 0 1 25 de 19 1 1 0 0 1 0 0 7 Imm Data 0 nfi Co Flag No change GAComments SE SCU User's Manual 147 JMP NC,Imm Conditional Jump (C=0) Operation nti When the C flag is 0, jump is in accordance with address data (Imm). Description Label JMP NC,[address] al Instruction Code b31 1 1 0 1 25 19 1 0 0 0 1 0 0 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 148 JMP T0,Imm Conditional Jump (T0=1) Operation nti When the T0 flag is 1, jump is in accordance with address data (Imm). Description Label JMP T0,[address] al Instruction Code b31 1 1 0 1 25 de 19 1 1 0 1 0 0 0 7 Imm Data 0 nfi Co Flag No change GAComments SE SCU User's Manual 149 JMP NT0,Imm Conditional Jump (T0=0) nti Operation When the T0 flag is 0, jump is in accordance with address data (Imm). Description Label JMP NT0,[address] al Instruction Code b31 1 1 0 1 25 19 1 0 01 0 0 0 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 150 JMP ZS,Imm Conditional Jump (Z=1 or S=1) Operation nti When the Z flag or S flag is 1, jump is in accordance with address data (Imm). Description Label JMP ZS,[address] al Instruction Code b31 1 1 0 1 25 de 19 1 1 0 0 0 1 1 7 Imm Data 0 nfi Co Flag No change GAComments SE SCU User's Manual 151 JMP NZS,Imm Conditional Jump (Z=S=0) Operation Description nti When the Z flag and S flag are 0, jump is in accordnce with address d (Imm). al Label JMP NZS,[address] Instruction Code b31 1 1 0 1 25 19 1 0 0 0 0 1 1 de 7 Imm Data 0 nfi Co Flag No change Comments GA SE 152 LOOP BOTTOM Commands Loop Bottom commands repeat one to several steps of a program. Figure 4.11 shows the Jump command format. Details of the command are shown in the next few pages. 31 30 29 28 27 1 1 1 0 MOD ntial 0 Figure 4.11 Loop Bottom Command Format de nfi Co GA SE SCU User's Manual 153 BTM Repeat Process Criterion Operation There is no repeat when the [LOP] flag is 0. Otherwise the program Description counter returns to [TOP]. nti Does nothing when the [LOP] flag is 0; otherwise, it returns the program counter to [TOP]. al Label BTM Instruction Code b31 29 27 1 1 1 0 0 de 0 nfi Co Flag LOP ; decremented when LOP≠ 0. Ends when LOP=0. Comments GA SE 154 LPS 1 Step Repeat nti Operation Repeats next 1 step until the [LOP] register is 0. Description Label LPS al Instruction Code b31 29 27 1 1 1 0 1 de 0 nfi Co Flag LOP ; decremented when LOP≠ 0. Ends when LOP=0. GAComments After the process ends, PC executes LOP+1 time then ends. SE SCU User's Manual 155 END Command The END command stops the program currently being executed. Figure 4.12 shows the END command format. Details of the command are shown in the next two pages. 31 30 29 28 27 1 1 1 1 IE ntial 0 Figure 4.12 END Command Format de nfi Co GA SE 156 END STOP Operation Description Stops the program. ntial Label END Instruction Code b31 29 27 1 1 1 1 0 de 0 nfi Co Flag EX ; is0. GAComments SE SCU User's Manual 157 ENDI Program End Operation nti Stops the program, and sets the E flag (program end interrupt flag). Description Label ENDI al Instruction Code b31 29 27 1 1 1 1 1 de 0 nfi Co Flag E ; is 1 GA EX ; is0. Comments SE 158 APPENDIX This appendix contains a list of SCU register address maps. ntial de nfi Co GA SE SCU User's Manual 159 Register names are shown in parenthesis. 160 D0R26 D0R25 D0R24 D0R23 D0R22 D0R21 D0R20 D0R19 D0R18 D0R17 D0R16 D0R15 D0R14 D0R13 D0R12 D0R11 D0R10 D0R9 D0R8 D0R7 D0R6 D0R5 D0R4 D0R3 D0R2 D0R1 D0R0 D0W26 D0W25 D0W24 D0W23 D0W22 D0W21 D0W20 D0W19 D0W18 D0W17 D0W16 D0W15 D0W14 D0W13 D0W12 D0W11 D0W10 D0W9 D0W8 D0W7 D0W6 D0W5 D0W4 D0W3 D0W2 D0W1 D0W0 D0C19 D0C18 D0C17 D0C16 D0C15 D0C14 D0C13 D0C12 D0C11 D0C10 D0C9 D0C8 D0C7 D0C6 D0C5 D0C4 D0C3 D0C2 D0C1 D0C0 D0RA D0WA2 D0WA1 D0WA0 D0EN D0GO D0MOD D0RUP D0WUP D0FT2 D0FT1 D0FT0 SE D1R26 D1R25 D1R24 D1R23 D1R22 D1R21 D1R20 D1R19 D1R18 D1R17 D1R16 D1R15 D1R14 D1R13 D1R12 D1R11 D1R10 D1R9 D1R8 D1R7 D1R6 D1R5 D1R4 D1R3 D1R2 D1R1 D1R0 D1W26 D1W25 D1W24 D1W23 D1W22 D1W21 D1W20 D1W19 D1W18 D1W17 D1W16 D1W15 D1W14 D1W13 D1W12 D1W11 D1W10 D1W9 D1W8 D1W7 D1W6 D2W5 D1W4 D1W3 D1W2 D1W1 D1W0 D1C11 D1C10 D1C9 D1C8 D1C7 D1C6 D1C5 D1C4 D1C3 D1C2 D1C1 D1C0 GA D1RA D1WA2 D1WA1 D1WA0 D1EN D1GO D1MOD D1RUP D1WUP D1FT2 D1FT1 D1FT0 D2R26 D2R25 D2R24 D2R23 D2R22 D2R21 D2R20 D2R19 D2R18 D2R17 D2R16 D2R15 D2R14 D2R13 D2R12 D2R11 D2R10 D2R9 D2R8 D2R7 D2R6 D2R5 D2R4 D2R3 D2R2 D2R1 D2R0 D2W26 D2W25 D2W24 D2W23 D2W22 D2W21 D2W20 D2W19 Co D2W18 D2W17 D2W16 D2W15 D2W14 D2W13 D2W12 D2W11 D2W10 D2W9 D2W8 D2W7 D2W6 D2W5 D2W4 D2W3 D2W2 D2W1 D2W0 D2C11 D2C10 D2C9 D2C8 D2C7 D2C6 D2C5 D2C4 D2C3 D2C2 D2C1` D2C0 D2RA D2WA2 D2WA1 D2WA0 D2EN D2GO D2MOD D2RUP D2WUP D2FT2 D2FT1 D2FT0 nfi DSTOP de nti DACS0 DACSB DACSA D1BK D0BK D2WT D2MV D1WT D1MV D0WT D0MV DOWT DOMV al SE SCU User's Manual 25FE0080(PPAF) PR EP T0 9 Z C E V E8 EX LE P7 P6 P5 P4 P3 P2 P1 P0 25FE0084(PPD) PD31 PD30 PD29 PD28 PD27 PD26 PD25 PD24 PD23 PD22 PD21 PD20 PD19 PD18 PD17 PD16 PD15 PD14 PD13 PD12 PD11 PD10 PD9 PD8 PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 25FE0088(PDA) RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0 25FE008C(PDD) GA RD31 RD30 RD29 RD28 RD27 RD26 RD25 RD24 RD23 RD22 RD21 RD20 RD19 RD18 RD17 RD16 RD15 RD14 RD13 RD12 RD11 RD10 RD9 RD8 RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 25FE0090(T0C) T0C9 T0C8 T0C7 T0C6 T0C5 T0C4 T0C3 T0C2 T0C1 T0C0 25FE0094(T1S) T198 T197 T196 T195 T194 T193 T192 T191 T190 25FE0098(T1MD) T1MD TENB 25FE009C(—) 25FE00A0(IMS) IMS15 IMS13 IMS12 IMS11 IMS10 IMS9 IMS8 IMS7 IMS6 IMS5 IMS4 IMS3 IMS2 IMS1 IMS0 Co 25FE00A4(IST) IST31 IST30 IST29 IST28 IST27 IST26 IST25 IST24 IST23 IST22 IST21 IST20 IST19 IST18 IST17 IST16 IST13 IST12 IST11 IST10 IST9 IST8 IST7 IST6 IST5 IST4 IST3 IST2 IST1 IST0 25FE00A8(—) AIACK 25FE00AC(—) 25FE00B0(ASR0) A0PRO A0WPC A0RPC A0EWT A0BW3 A0BW2 A0BW1 A0BW0 A0NW3 A0NW2 A0NW1 A0NW0 A0LN1 A0LN0 A0SZ A1PRO A1WPC A1RPC A1EW1 A1BW3 A1BW2 A1BW1 A1BW0 A1NW3 A1NW2 A1NW1 A1NW0 A1LN1 A1LN0 A1SZ 25FE00B4(ASR1) A2PRO A2WPC A2RPC A2EWT A2LN1 A2LN0 A2SZ A3PRO A3WPC A3RPC A3EW1 A3BW3 A3BW2 A3BW1 A3BW0 A3NW3 A3NW2 A3NW1 A3NW0 A3LN1 A3LN0 A3SZ nfi 25FE00B8(AREF) ARFEN ARWT3 ARWT2 ARWT1 ARWT0 25FE00BC(AIAK) 25FE00C0(—) de 25FE00C4(RSEL) RSEL 25FE00C8(VER) VER3 VER2 VER1 VER0 25FE00CC(—) nti al 161 Acronym Address Bit Description AIACK 25FE00A8H 0 A-Bus interrupt acknowledge output valid bit (=0: invalid / =1: valid) ARFEN ARWT3-0 A0BW3-0 A0EWT A0LN1-0 A0PRD A0RPC A0NW3-0 25FE00B8H 25FE00B8H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 3-0 4 27 - 24 28 19 - 18 31 29 23 - 20 A-Bus refresh output valid bit A-Bus refresh wait number nti (=0: invalid/=1: valid) CS0 space, burst cycle wait number set bit CS0 space, external wait effective bit (=0: invalid/=1: valid) CS0 space, burst length set bit al CS0 space, previous read effective bit (=0: invalid/=1: valid) CS0 space, pre-charge insert bit after read CS0 space, normal cycle wait number set bit A0SZ 25FE00B0H 16 CS0 space, bus size set bit A0WPC 25FE00B0H 30 CS0 space, pre-charge insert bit after write A1BW3-0 25FE00B0H 11 - 8 CS1 space, burst cycle wait number set bit A1EWT 25FE00B0H 12 CS1 space, external wait effctive bit (=0: invalid/=1: valid) A1LN1-0 A1NW3-0 A1PRD A1RPC A1SZ A1WPC A2EWT 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B0H 25FE00B4H 3-2 7-4 15 13 0 14 28 de CS1 space, burst length set bit CS1 space, normal cycle wait number set bit CS1 space, previous read effective bit (=0: invalid/=1: valid) CS1 space, pre-charge insert bit after read CS1 space, bus size set bit CS1 space, pre-charge insert bit after write CS2 space, external wait effctive bit (=0: invalid/=1: valid) A2LN1-0 A2PRD A2RPC A2SZ A2WPC A3BW3-0 A3EWT 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 19 - 18 31 29 16 30 11 - 8 12 nfi CS2 space, burst length set bit CS2 space, previous read effective bit (=0: invalid/=1: valid) CS2 space, pre-charge insert bit after read CS2 space, bus size set bit CS2 space, pre-charge insert bit after write Dummy space, burst cycle wait number set bit Dummy space, external wait effctive bit (=0: invalid/=1: valid) A3LN1-0 A3NW3-0 A3PRD A3RPC A3SZ A3WPC C DACSA 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE00B4H 25FE0080H 25FE007CH Co3-2 7-4 15 13 0 14 20 20 Dummy space, burst length set bit Dummy space, normal cycle wait number set bit Dummy space, previous read effective bit (=0: invalid/=1: valid) Dummy space, pre-charge insert bit after read Dummy space, bus size set bit Dummy space, pre-charge insert bit after write DSP program control port, Carry flag DMA A-Bus Access Flag (=0: no access/=1: access) DACSB 25FE007CH 21 DMA B-Bus Access Flag (=0: no access/=1: access) DACSD 25FE007CH 22 DMA DSP-Bus Access Flag (=0: no access/=1: access) DDMV 25FE007CH 0 DSP side DMA operate flag (=0: stop/=1: operate) DDWT DSTOP D0BK D0C19-0 D0EN GA 25FE007CH 25FE0060H 25FE007CH 25FE0008H 25FE0010H 1 0 16 19 - 0 8 DSP side DMA standby flag (=0: stop/=1: standby) DMA force-stop bit (=0: DMA operable/=1: DMA force stop) DMA level 0 interrupt flag (=0: stop/=1: interrupt) DMA level 0 transfer byte number DMA level 0 enable bit (=0: Disable/=1: Enable) SE 162 Acronym Address Bit Description D0FT2-0 25FE0014H 2-0 DMA level 0 starting factor selection bit =000B: V-Blank-IN receive and enable bit set D0GO 25FE0010H 0 nti =001B: V-Blank-OUT receive and enable bit set =010B: H-Blank-IN receive and enable bit set =011B: Timer 0 receive and enable bit set =100B: Timer 1 receive and enable bit set =101B: Sound Req receive and enable bit set al =110B: Sprite draw end and enable bit set =111B: DMA start bit set and enable bit set DMA level 0 start bit (=0: stop =1: start) D0MOD 25FE0014H 24 DMA level 0 mode bit (=0: direct mode/=1: indirect mode) D0MV 25FE007CH 4 DMA level 0 operating flag (=0: stop/=1: start) D0RA 25FE000CH 8 DMA level 0 read address add value (=0: no add/=1: adds 4 byte) D0RUP 25FE0014H 16 DMA level 0 read address update bit D0R26-0 D0WA2-0 25FE0000H 25FE000CH 26 - 0 2-0 de DMA level 0 read address DMA level 0 write address add value =000B: no addition =001B: adds 2 bytes =010B: adds 4 bytes =011B: adds 8 bytes =100B: adds 16 bytes =101B: adds 32 bytes D0WT D0WUP D0W26-0 D1BK D1C11-0 25FE007CH 25FE0014H 25FE0004H 25FE007CH 25FE0028H nfi 5 8 26 - 0 17 11 - 0 =110B: adds 64 bytes =111B: adds 128 bytes DMA level 0 standby flag (=0: stop/=1: standby) DMA level 0 write address update bit DMA level 0 write address DMA level 1 interrupt flag (=0: stop/=1: interrupt) DMA level 1 transfer byte number D1EN 25FE0030H 8 Co DMA level 1 enable bit (=0: Disable/=1: Enable) D1FT2-0 25FE0034H 2-0 DMA level 1 starting factor selection bit =000B: V-Blank-IN receive and enable bit set =001B: V-Blank-OUT receive and enable bit set =010B: H-Blank-IN receive and enable bit set =011B: Timer 0 receive and enable bit set =100B: Timer 1 receive and enable bit set =101B: Sound Req receive and enable bit set =110B: Sprite draw end and enable bit set =111B: DMA start bit set and enable bit set D1GO 25FE0030H 0 DMA level 1 start bit (=0: stop/=1: start) D1MOD 25FE0034H 24 DMA level 1 mode bit (=0: direct mode/=1: indirect mode) GA D1MV 25FE007CH 8 DMA level 1 operating flag (=0: stop/=1: start) D1RA 25FE002CH 8 DMA level 1 read address add value (=0: no add/=1: adds 4 bytes) D1RUP 25FE0034H 16 DMA level 1 read address update bit D1R26-0 25FE0020H 26 - 0 DMA level 1 read address SE SCU User's Manual 163 Acronym Address Bit Description D1WA2-0 25FE002CH 2-0 DMA level 1 write address add value =000B:does not add D1WT D1WUP 25FE007CH 25FE0034H 9 8 =001B: adds 2 bytes =010B: adds 4 bytes =011B: adds 8 bytes =100B: adds 16 bytes =101B: adds 32 bytes =110B: adds 64 bytes =111B: adds 128 bytes ntial DMA level 1 standby flag (=0: stop/=1: standby) DMA level 1 write address update bit D1W26-0 25FE0024H 26 - 0 DMA level 1 write address D2C11-0 25FE0048H 11 - 0 DMA level 2 transfer byte number D2EN 25FE0050H 8 DMA level 2 enable bit (=0: Disable/=1: Enable) D2FT2-0 25FE0054H 2-0 DMA level 2 starting factor selection bits D2G0 25FE0050H 0 de =000B: V-Blank-IN receive and enable bit set =001B: V-Blank-OUT receive and enable bit set =010B: H-Blank-IN receive and enable bit set =011B: Timer 0 recieve and enable bit set =100B: Timer 1 recieve and enable bit set =101B: Sound Req receive and enable bit set =110B: Sprite draw end and enable bit set =111B: DMA start bit set and enable bit set DMA level 2 start bit (=0: stop/=1: operation) D2MOD D2MV D2RA D2RUP D2R26-0 D2WA2-0 25FE0054H 25FE007CH 25FE004CH 25FE0054H 25FE0040H 25FE004CH 24 12 8 16 26 - 0 2-0 nfi DMA level 2 mode bit (=0: direct mode/=1: indirect mode) DMA level 2 operation flag (=0: stop/=1: operation) DMA level 2 read address add value DMA level 2 read address (=0: no add/=1: adds 4 bytes) DMA level 2 read address update bit DMA level 2 write address add value Co =000B: no addition =001B: adds 2 bytes =010B: adds 4 bytes =011B: adds 8 bytes =100B: adds 16 bytes =101B: adds 32 bytes =110B: adds 64 bytes =111B: adds 128 bytes D2WT 25FE007CH 13 DMA level 2 standby flag (=0: stop/=1: standby) D2WUP 25FE0054H 8 DMA level 2 write address update bit D2W26-0 25FE0044H 26 - 0 DMA level 2 write address E 25FE0080H 18 DSP Program control port, Program end interrupt flag GA EP 25FE0080H 25 DSP Program control port, Temporary stop execution flag during program execution (=0: don't execute / =1: execute) SE 164 Acronym Address Bit Description ES 25FE0080H 17 DSP Program Control Port, Program Step Execution Control Bit (=0: don't execute / =1: execute) EX IMS0 IMS1 IMS2 IMS3 IMS4 IMS5 25FE0080H 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A0H 16 0 1 2 3 4 5 nti DSP Program Control Port, Program Execution Control Bit (=0: don't execute / =1: execute) V-Blank-IN Interrupt Mask Bit V-Blank-OUT Interrupt Mask Bit al H-Blank-IN Interrupt Mask Bit Timer 0 Interrupt Mask Bit Timer 1 Interrupt Mask Bit DSP End Interrupt Mask Bit IMS6 25FE00A0H 6 Sound Request Interrupt Mask Bit IMS7 25FE00A0H 7 SMPC Interrupt Mask Bit IMS8 25FE00A0H 8 PAD Interrupt Mask Bit IMS9 25FE00A0H 9 Level 2-DMA End Interrupt Mask Bit IMS10 IMS11 IMS12 IMS13 IMS15 IST0 IST1 IST2 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A0H 25FE00A4H 25FE00A4H 25FE00A4H 10 11 12 13 15 0 1 2 de Level 1-DMA End Interrupt Mask Bit Level 0-DMA End Interrupt Mask Bit DMA Illegal Interrupt Mask Bit Sprite Draw End Interrupt Mask Bit A-Bus Interrupt Mask Bit V-Blank-IN Interrupt Status Bit V-Blank-OUT Interrupt Status Bit H-Blank-IN Interrupt Status Bit IST3 IST4 IST5 IST6 IST7 IST8 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H nfi3 4 5 6 7 8 Timer 0 Interrupt Status Bi t Timer 1 Interrupt Status Bit DSP End Interrupt Status Bit Sound request Interrupt Status Bit SMPC Interrupt Status Bit PAD Interrupt Status Bit IST9 IST10 IST11 IST12 IST13 IST31-16 LE Co 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H 25FE00A4H 25FE0080H 9 10 11 12 13 31-16 15 Level 2-DMA End Interrupt Status Bit Level 1-DMA End Interrupt Status Bit Level 0-DMA End Interrupt Status Bit DMA Illegal Interrupt Status Bit Sprite Draw End Interrupt Status Bit Outside Interrupt 15-0 Status Bit DSP Program Control Port, Program Counter Load Enable Bit (=0: no execute/=1: execute) PD31-0 25FE0084H 31 - 0 DSP Program RAM Data Port PR 25FE0080H 26 DSP Program Control Port, Pause Cancel Flag while program is executing (=0: no execute/=1: execute) GA P7-0 RA7-0 RD31-0 RSEL S 25FE0080H 25FE0088H 25FE008CH 25FE00C4H 25FE0080H 7-0 7-0 31 - 0 22 0 DSP Program RAM Address DSP Data RAM Address DSP Data RAM Data Port SDRAM Selection Bit (=0: 2 Mbit x 2 / =1: 4 Mbit x 2) DSP Program Control Port, Sine Flag SE SCU User's Manual 165 TENB 25FE0098H 0 Timer Enable Bit (=0: OFF / =1: ON) T0 25FE0080H 23 DSP Program Control Port, D0 Bus Use DMA Execute Flag T0C9-0 25FE0090H 9-0 Timer 0 Compare Data T1MD T1S8-0 V VER3-0 Z 25FE0098H 25FE0094H 25FE0080H 25FE00C8H 25FE0080H 8 8-0 19 3-0 21 Timer 1 ModeBit =0: occurs at each line =1: occurs only at lines indicated by Timer 0 Timer 1 Set Data ntial DSP Program Control Port, Overflow Flag SCU Chip Version Number DSP Program Control Port, Zero Flag de nfi Co GA SE 166 INDEX Numbers within ( ) shows the page of the “First” heading. nti Numeric 1 command Repeat Execution...................................................................................... 89 Alphabetic al A-Bus ................................................................................................................................ ii A-Bus Control Register ................................................................................................. 61 A-Bus Interrupt Acknowledge .................................................................................... 61 A-Bus Interrupt Acknowledge Register ..................................................................... 61 A-Bus Interrupt Acknowledge Map ........................................................................... 14 de A-Bus Refresh Register ........................................................................................... 13, 71 A-Bus Refresh Register Map ........................................................................................ 13 A-Bus Refresh Wait Number ........................................................................................ 71 A-Bus Set Register (CS0, 1 spaces) .............................................................................. 62 A-Bus Set Register (CS2 and dummy spaces) ........................................................... 62 nfi A-Bus Set Register Map ................................................................................................ 13 Access, Interrupt, Standby, Operation Registers ....................................................... 47 B-Bus ............................................................................................................................... (ii) Blanking Interrupt ......................................................................................................... 29 Block Diagram .................................................................................................................. 3 Co Commands ...................................................................................................................... 91 Commands (1), List of ................................................................................................... 80 Commands (2), List of ................................................................................................... 81 Commands (3), List of ................................................................................................... 82 Commands (4), List of ................................................................................................... 83 Constants, Description of ............................................................................................. 90 CS0 Space Burst Cycle Set Value ................................................................................. 65 GA CS0 Space Burst Length Set Value ............................................................................... 65 CS0 Space Bus Size Set Value ....................................................................................... 66 CS0 Space Single Cycle Set Value ................................................................................ 65 CS0, 1 Space A-Bus Set Set Register ............................................................................ 62 CS1 Space Burst Cycle Set Value ................................................................................. 67 CS1 Space Burst Length Set Value ............................................................................... 68 CS1 Space Bus Size Set Value ....................................................................................... 68 SE CS1 Space Single Cycle Set Value ................................................................................ 67 CS2 Space Burst Cycle Value ........................................................................................ 68 CS2 Space Bus Size Set Value ....................................................................................... 70 SCU User's Manual 167 Data .................................................................................................................................... ii Data Write Example (Indirect Mode) .......................................................................... 23 Difference in DMA operation by Address Renewal Bit ........................................... 22 Difference in Timing by Setting External Wait Effective Bit .................................... 64 Direct Mode DMA Transfer Operation ...................................................................... 18 DMA Enable Register .................................................................................................... 45 DMA Command Execution .......................................................................................... 87 DMA Command Format 1 ......................................................................................... 132 DMA Command Format 2 ......................................................................................... 132 ntial DMA Control Register .................................................................................................. 41 DMA End Interrupt ....................................................................................................... 33 DMA Mode, Address Renewal, Start Factor Select Register ................................... 46 de DMA Force-Stop Register ............................................................................................. 47 DMA Force-Stop Register Map...................................................................................... 8 DMA Illegal Interrupt ................................................................................................... 33 DMA Mode ..................................................................................................................... 18 DMA Status Register ............................................................................................... 47, 48 nfi DMA Status Register Map .............................................................................................. 9 DMA Transfer (Basic Operation) ................................................................................. 16 DMA Transfer Execution by Address Add Value Set ............................................... 26 DMA Transferable Area when Started from DSP ..................................................... 17 DMA Transferable Area when Started from Main CPU .......................................... 17 Co DMA Write Address while Stopped ........................................................................... 46 DSP .................................................................................................................................. 34 DSP Control Port............................................................................................................ 51 DSP Data RAM Address Port ................................................................................ 10, 53 DSP Data RAM Address Port Map ............................................................................. 10 DSP Data RAM Data Port ............................................................................................. 54 DSP Data RAM Data Port Map ................................................................................... 10 GA DSP End Interrupt ......................................................................................................... 33 DSP Program Control Port ............................................................................................. 9 DSP Program Load Step 1 ............................................................................................ 34 DSP Program Load Step 2 ............................................................................................ 35 DSP Program Load Step 3 ............................................................................................ 35 DSP Program RAM Data Port ................................................................................ 10, 53 DSP Program RAM Data Port Map ............................................................................ 10 SE Dummy Space Burst Cycle Set Value ......................................................................... 71 Dummy Space Burst Length Set Value ....................................................................... 71 Dummy Space Bus Size Set Value ............................................................................... 72 Dummy Space Single Cycle Set Value ........................................................................ 71 168 Example of transfer between SCU and Processor ..................................................... 44 Features of Data Transfer to DSP from D0 Bus ................................................... 87, 88 High/Low Level DMA Operation .............................................................................. 48 nti Indirect Mode DMA Transfer ...................................................................................... 20 Indirect Mode DMA Transfer Flow ............................................................................. 19 Interrupt Control Register ............................................................................................ 57 al Interrupt Factor .............................................................................................................. 27 Interrupt Factor, General Names ................................................................................. 28 Interrupt Mask Register ................................................................................................ 57 Interrupt Mask Register Map ....................................................................................... 12 Interrupt Status Register ............................................................................................... 58 de Interrupt Status Register Contents .............................................................................. 59 Interrupt Status Register Map ..................................................................................... 12 Jump Command Execution .......................................................................................... 85 Jump Command Format ............................................................................................. 141 Level 0 Transfer Byte Number ..................................................................................... 42 Level 2-0 Address Add Value ....................................................................................... 42 nfi Level 2-0 DMA Authorization Bit ............................................................................... 45 Level 2-0 DMA Mode, Address Renewal, Start Factor Select Register .................. 46 Level 2-0 DMA Set Register Map .................................................................................. 8 Level 2-0 Read Address ................................................................................................ 41 Level 2-0 Write Address ................................................................................................ 41 Co Level 2-1 Transfer Byte Number .................................................................................. 42 Load Immediate Command Format 1 (unconditional transfer) ........................... 120 Load Immediate Command Format 2 (conditional transfer) ................................ 120 Loop Bottom Command Format ............................................................................... 153 Loop Program Execution .............................................................................................. 86 Main CPU .......................................................................................................................... i Operand Execution Method ......................................................................................... 85 GA Operation Command Format ...................................................................................... 91 Operation when Cache Hit ............................................................................................. 5 PAD Interrupt ................................................................................................................. 33 RAM Page Select ............................................................................................................ 53 Read Address Add Value .............................................................................................. 43 Registers, List of ............................................................................................................. 40 Results of Previous Read Process ................................................................................ 63 SE SCU User's Manual 169 SCSP .................................................................................................................................... i SCU ..................................................................................................................................... i SCU Control Register .................................................................................................... 73 SCU Mapping (Cache_address)..................................................................................... 4 SCU Mapping (Cache_through_address) .................................................................... 6 nti SCU Overview ................................................................................................................. 2 SCU SDRAM Select Register Map .............................................................................. 14 SCU SDRAM Select Bit ................................................................................................. 73 SCU Version Register Map ........................................................................................... 14 al SCU Version Register .................................................................................................... 73 SMPC ................................................................................................................................. ii de SMPC Interrupt .............................................................................................................. 33 Sound Request Interrupt .............................................................................................. 33 Special Process Execution ............................................................................................. 89 Sprite Draw End Interrupt ........................................................................................... 33 Start Factor ...................................................................................................................... 46 Subroutine Program Execution .................................................................................... 90 nfi System Configuration ..................................................................................................... 2 Timer 0 Compare Register ...................................................................................... 11, 55 Timer 0 Compare Register Map ................................................................................... 11 Timer 0 Interrupt Degree of Occurrence .................................................................... 30 Timer 1 Interrupt Degree of Occurrence .................................................................... 31 Co Timer 1 Mode Register ............................................................................................ 11, 56 Timer 1 Mode Register Map ......................................................................................... 11 Timer 1 Occurrence Select Content ............................................................................. 56 Timer 1 Set Data Register ....................................................................................... 11, 55 Timer 1 Set Data Register Map .................................................................................... 11 Timer Operation Contents ............................................................................................ 56 Timer Register ................................................................................................................ 55 GA Timing when setting pre-charge insert bit after Read .............................................. 63 Timing when setting pre-charge insert bit after Write ............................................. 63 Timing when Writing CS2 Burst Cycle ....................................................................... 65 VDP1 ................................................................................................................................... i VDP2 ................................................................................................................................... i Work RAM Area Contents ............................................................................................ 24 Write Address Add Value ............................................................................................. 43 SE Write Address Add Value Indication .......................................................................... 45 170 (This page is blank in the original Japanese document.) ntial de nfi Co GA SE SCU User's Manual 171 Commands NOP (ALU Operation) .................................................................................................. 93 nti AND ................................................................................................................................. 94 OR .................................................................................................................................... 95 XOR .................................................................................................................................. 96 al ADD ................................................................................................................................. 97 SUB .................................................................................................................................. 98 AD2 .................................................................................................................................. 99 SR ................................................................................................................................... 100 RR ................................................................................................................................... 101 de SL .................................................................................................................................... 102 RL ................................................................................................................................... 103 RL8 ................................................................................................................................. 104 NOP (X-Bus Operation) .............................................................................................. 106 MOV [s] , X ................................................................................................................... 107 MOV MUL , p ............................................................................................................... 108 nfi MOV [s] , P.................................................................................................................... 109 NOP (Y-Bus Control) ...................................................................................................111 MOV [s] , Y ................................................................................................................... 112 CLR A ........................................................................................................................... 113 MOV ALU , A ............................................................................................................... 114 Co MOV [s] , A ................................................................................................................... 115 NOP (D1-Bus No Operation) .................................................................................... 117 MOV SImm , [d] ........................................................................................................... 118 MOV [s] , [d] ................................................................................................................. 119 MVI Imm , [d] ............................................................................................................... 121 MVI [d] , Imm , Z ......................................................................................................... 122 MVI Imm , [d] , NZ ...................................................................................................... 123 GA MVI Imm , [d] , S ......................................................................................................... 124 MVI Imm , [d] , NS ...................................................................................................... 125 MVI Imm , [d] , C ......................................................................................................... 126 MVI Imm , [d] , NC ..................................................................................................... 127 MVI Imm , [d] , T0 ....................................................................................................... 128 MVI Imm , [d] , NT0 .................................................................................................... 129 MVI Imm , [d] , ZS ....................................................................................................... 130 SE MVI Imm , [d] , NZS ................................................................................................... 131 172 DMA D0 , [RAM] , SImm .......................................................................................... 133 DMA [RAM] , D0 , SImm .......................................................................................... 134 DMA , D0 , [RAM] , [s] .............................................................................................. 135 nti DMA [RAM] , D0 , [s] ................................................................................................ 136 DMAH , D0 , [RAM] , SImm ..................................................................................... 137 DMAH [RAM] , D0 , SImm ....................................................................................... 138 al DMAH D0 , [RAM] , [s] ............................................................................................. 139 DMAH [RAM] , D0 , [s] ............................................................................................. 140 JMP Imm ...................................................................................................................... 142 JMP Z , Imm................................................................................................................. 143 JMP NZ , Imm ............................................................................................................. 144 de JMP S , Imm ................................................................................................................. 145 JMP NS , Imm .............................................................................................................. 146 JMP C , Imm ................................................................................................................ 147 JMP NC , mm .............................................................................................................. 148 JMP T0 , Imm ............................................................................................................... 149 JMP NT0 , Imm ........................................................................................................... 150 nfi JMP ZS , Imm .............................................................................................................. 151 JMP NZS , Imm ........................................................................................................... 152 BTM ............................................................................................................................... 154 LPS ................................................................................................................................. 155 END ............................................................................................................................... 157 Co ENDI ........................................................................................................................ 33, 158 GA SE SCU User's Manual 173