The MB91319 is a standard single-chip microcontroller that has a 32-bit high-performance RISC
CPU as well as built-in I/O resources for embedded controller that requires high-performance
and high-speed CPU processing.
The MB91319 is most suitable for embedded applications, such as TV and PDP controllers, that
require a high level of CPU processing power.
The MB91319 is one of the FR60 series of microcontrollers, which are based on the FR30/40
family of CPUs. It has enhanced bus access and is optimized for high-speed use.
This manual is intended for engineers who will develop products using the MB91319 and
describes the functions and operations of the MB91319. Read this manual thoroughly.
For more information on instructions, see the "Instructions Manual".
■ Trademarks
FR, which is an abbreviation of FUJITSU RISC controller, is a product of Fujitsu Limited.
REALOS (Real-time Operating System) is a trademark of FUJITSU LIMITED.
■ License
The names of other systems and products appearing in this manual are the trademarks of their
respective companies or organizations.
Purchase of Fujitsu I
use, these components in an I
Specification as defined by Philips.
2
C components conveys a license under the Philips I2C Patent Rights to
2
C system provided that the system conforms to the I2C Standard
i
Page 6
■ Organization of This Manual
This manual consists of the following 20 chapters and an appendix.
CHAPTER 1 "OVERVIEW"
This chapter provides basic information required to understand the MB91319 series, and
covers features, a block diagram, and functions.
CHAPTER 2 "HANDLING THE DEVICE"
This chapter provides precautions on handling the MB91319 series.
CHAPTER 3 "CPU AND CONTROL UNITS"
This chapter provides basic information required to understand the functions of the MB91319
series. It covers architecture, specifications, and instructions.
CHAPTER 4 "I/O PORT"
This chapter describes the I/O ports and the configuration and functions of registers.
CHAPTER 5 "16-BIT RELOAD TIMER"
This chapter describes the 16-bit reload timer, the configuration and functions of registers,
and 16-bit reload timer operation.
This chapter gives an outline of the PPG (Programmable Pulse Generator) timer and
explains the register configuration and functions and the timer operations.
CHAPTER 7 "MULTIFUNCTION TIMER"
This chapter gives an overview of the multifunction timer and explains the register
configuration and functions and the timer operat ion.
CHAPTER 8 "16-BIT PULSE WIDTH COUNTER"
This chapter gives an overview of the 16-bit pulse width counter and explains the register
configuration and functions and the counter operation.
CHAPTER 9 "INTERRUPT CONTROLLER"
This chapter describes the interrupt controller, the configuration and functions of registers,
and interrupt controller operation. It also presents an example of using the hold request
cancellation request function.
CHAPTER 10 "EXTERNAL INTERRUPT AND NMI CONTROLLER"
This chapter describes the external interrupt and NMI controller, the configuration and
functions of registers, and operation of the external interrupt and NMI controller.
CHAPTER 11 "REALOS-RELATED HARDWARE"
This chapter explains the delayed interrupt module and bit search module that are REALOSrelated hardware. REALOS-related hardware is used by the real-time OS. When REALOS is
used, the hardware cannot be used with the user program.
CHAPTER 12 "10-BIT A/D CONVERTER"
This chapter gives an overview of the 10-bit A/D converter, register configuration and
functions, and 10-bit A/D converter oper at ion .
CHAPTER 13 "U-TIMER"
This chapter describes the U-TIMER, the configuration and functions of registers, and UTIMER operation.
ii
Page 7
CHAPTER 14 "UART"
This chapter describes the UART, the configuration and functions of registers, and UART
operation.
CHAPTER 15 "I
This chapter describes the I
2
C INTERFACE"
2
C interface, the configuration and functions of registers, and I2C
interface operation.
CHAPTER 16 "DMA CONTROLLER (DMAC)"
This chapter describes the DMA controller (DMAC), the configuration and functions of
registers, and DMAC operation.
CHAPTER 17 "USB FUNCTION"
This chapter gives an overview of the USB function, register configuration and functions,
operation of the USB function, and supplement ary notes on the USB function.
CHAPTER 18 "OSDC"
This chapter explains the features, block diagram, display function, control function, and
display control command of the on-screen display controller ( OSDC).
CHAPTER 19 "FLASH MEMORY"
This chapter provides an outline of flash memory and explains its register configuration,
register functions, and operations.
CHAPTER 20 "SERIAL PROGRAMMING CONNECTION"
The built-in FLASH product supports the serial onboard writing (Fujitsu standard) of the flash
ROM. The following explains its specification.
APPENDIX
This appendix consists of the following parts: the I/O map, interrupt vector, dot clock
generation PLL, USB clock, external bus interface setting, and instruction lists. The appendix
contains detailed information that could not be included in the main text and reference
material for programming.
iii
Page 8
•The contents of this document are subject to change without notice.
Customers are advised to consult with FUJITSU sales representatives before ordering.
•The information, such as descriptions of function and application circuit examples, in this document are
presented solely for the purpose of reference to show examples of operations and uses of FUJITSU
semiconductor device; FUJITSU does not warrant proper operation of the device with respect to use based
on such information. When you develop equipment incorporating the device based on such information, you
must assume any responsibility arising out of such use of the information. FUJITSU a ssumes no liability for
any damages whatsoever arising out of the use of the information.
•Any information in this document, including descriptions of function and schematic diagrams, shall not be
construed as license of the use or exercise of any intellectual property right, such as patent right or
copyright, or any other right of FUJITSU or any third party or does FUJITSU warrant non-in fringement of any
third-party's intellectual property right or other right by using such information. FUJITSU assumes no liability
for any infringement of the intellectual property rights or othe r rights of third parties which would result fro m
the use of information contained herein.
•The products described in this document are designed, developed and manufactured as contemplated fo r
general use, including without limitation, ordinary industrial use, general office use, personal use, and
household use, but are not designed, developed and manufactured as contemplated (1) for use
accompanying fatal risks or dangers that, unless extremely high safety is secured, could have a serious
effect to the public, and could lead directly to death, personal injury, severe physical damage or other loss
(i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control, mass transport control,
medical life support system, missile launch control in weapon system), or (2) for use requiring extremely high
reliability (i.e., submersible repeater and artificial satellite).
Please note that FUJITSU will not be liable against you and/or any third party for any claims or d amages
arising in connection with above-mentioned uses of the products.
•Any semiconductor devices have an inherent chance of failure. You must protect against injury, damage o r
loss from such failures by incorporating safety design measures into your facility and equipment such as
redundancy, fire protection, and prevention of over-current levels and other abnormal operating conditions.
•If any products described in this document represent goods or technolog ies subject to certain restrictions on
export under the Foreign Exchange and Foreign Trade Law of Japan, the prior authorization by Japa nese
government will be required for export of those products from Japan.
The following defines principal terms used in this manual.
TermMeaning
32-bit bus for internal instructions. In the FR family, which is based on an
I-bus
D-busInternal 32-bit data bus. An internal resource is conn ected to the D-bus.
F-bus
internal Harvard architecture, independent buses are used for instructions and
data. A bus converter is connected to the I-bus.
Princeton bus on which internal instructio ns and da ta are multiple xed. Th e F-bu s
is connected via a switch to the I-bus and D-bus. Built-in resources such as
ROM and RAM are connected to the F-bus.
X-bus
R-bus
E-unitExecution unit for operations.
CLKP
CLKB
CLKT
External interface bus. An external interface module is conn ected to the X-bus.
Data and instructions are multiplexed on the external data bus.
Internal 16-bit data bus. The R-bus is connected to the D-bus via an adapter. I/
O, a clock generator, and an interrupt controller are connected to the R-bus.
Since addresses and data are multiplexed on an R-bus that is only 16 bits wide,
more than one cycle is required for the CPU to access these resources.
System clock. Clock generated by the clock generator for each of the internal
resources connected to the R-bus. This clock has the same frequency as the
source oscillation at its maximum, but becomes a 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7,...
or 1/16 (or 1/2, 1/4, 1/6, ... or 1/32) frequency clock as determined by the divideby rate specified by the B3 to B0 bits in the clock generator DIV0 register.
System clock. Operating clock for the CPU and each of the other resources
connected to a bus other than the R-bus and X-bus. This clock has the same
frequency as the source oscillation at its maximum, but becomes a 1, 1/2, 1/3, 1/
4, 1/5, 1/6, 1/7, ... or 1/16 (or 1/2, 1/4, 1/6, ... or 1/32) frequency clock as
determined by the divided-by rate specified by the P3 to P0 bits in the clock
generator DIV0 register.
System clock. Operating clock for the external bus interface connected to the Xbus. This clock has the same frequency as the source oscillation at its
maximum, but becomes a 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, ... or 1/16 (or 1/2, 1/4, 1/
6, ... or 1/32) frequency clock as determined by the divide-by rate specified by
the T3 to T0 bits in the clock generator DIV1 register.
1.5List of Pin Fun ctio ns .................. ... .... ... ... ... ....................................... ... ... .... ...................................... 10
1.6Input-output Circuit Forms ................................................................................................................ 17
CHAPTER 2HANDLING THE DEVICE .......................................................................... 23
2.1Precautions on Handling the Device ................................................................................................. 24
CHAPTER 3CPU AND CONTROL UNITS ..................................................................... 29
3.1Memo ry Spa ce .............................. .... ... ....................................... ... ... ................................................ 30
3.2Intern al Arc hite ct ur e ................................ ....................................... ... ... ... .......................................... 31
3.3Programming Model ......................................................................................................................... 36
3.6Memo ry Ma p . ... ... .... ...................................... .... ...................................... .... ... ................................... 45
3.9Opera tin g Mo d es ................................................. ... ... .... ... ... ....................................... ... . .................. 64
5.1Overview of the 16-bit Reload Timer .............................................................................................. 138
5.216-bit Re loa d Timer Re gis ter s ...................... .... ... ... ... ....................................... ... .... ... .................... 139
5.2.1Control Status Register (TMCSR) ............................................................................................. 140
5.316-bit Re loa d Timer Op e ratio n ............... ... ... .... ... ... ....................................... ... ... .... ....................... 145
9.1Overview of the Interrupt Controller ................................................................................................ 204
9.2Interr up t Con tr oller Re gisters ..................... ... .... ... ....................................... ... ... ... ........................... 206
9.2.1Interrupt Control Register (ICR) ................................................................................................. 208
9.3Interr up t Con tr oller Op e ra tio n ....................... .... ... ... ....................................... ... ... .... ....................... 211
9.4Example of Using the Hold Request Cancellation Request Function (HRCR) ............................... 214
CHAPTER 10EXTERNAL INTERRUPT AND NMI CONTROLLER ............................... 217
10.1Overview of the External Interrupt and NMI Controller ................................................................... 218
10.2External Interrupt and NMI Controller Registers ............................................................................. 219
16.5Data Bus ......................................................................................................................................... 373
CHAPTER 17USB FUNCTION ....................................................................................... 377
17.1Overview of the USB Function ........................................................................................................ 378
APPENDIX A I/O Map ................................................................................................................................ 670
APPENDIX B Interrupt Vector .................................................................................................................... 685
APPENDIX C Dot Clock Generation PLL ................................................................................................... 688
APPENDIX D USB Clock ........................................................................... ................................................. 690
APPENDIX E Macro Reset ......................................................................................................................... 691
APPENDIX F USB Low-power Consumption Mode ................................................................................... 692
APPENDIX G External Bus Interface Setting ............................................................................................. 693
APPENDIX H Pin State List ...................................................................................................... .................. 695
APPENDIX I Instruction Lists .................................................................................................................... 699
I.1How to Read the Instruction Lists .................................................................................................. 700
I.2FR Family Instruction Lists ............................................................................................................. 704
Change ■ Built-in RAM (MASK: Add 32KB RAM)
Change ■ A/D Converter (conversion time: about 10 µs → conversion ti me: about 8.5 µs)
Change CMOS technology of ■ Other Features
Change Supply voltage of ■ Other Features
Change the Figure 1.2-1 Block Diagram
(Add DSU)
7
(Add MASK 512KB to Flash 1MB)
(Add MASK 32KB to RAM)
(PWC 1ch→PWC 4ch)
(Add Font ROM product)
Change Figure 1.4-1 Pin Layout of the MB91319
9
(MB91F318A→MB91F318A/S)
(MB91FV319A
(Change the Note)
→MB91FV319A/R)
Add a sentence to ■ Quartz Oscillation Circuit
Change Low Power Consumption Mode of ■ Lim itations
Change Note on using A/D
Add About Software Reset of Synchronous Mode
Change ❍ Unique characteristic of the evaluation chip MB91FV319A
(MB91FV319A → MB91FV319A/R)
30
70
70
74
81
83
85
87
90
Change Figure 3.1-1 Memory Map
(MB91F318→MB91F318A/S and MB91FV319R)
(MB91F318, MB91316
→MB91F318A/S, MB91316)
Add Reference: to ■ Software Reset (STCR: SRST Bit Writing)
Change ■ Watchdog Reset (watchdog reset postpone register (WPR) → time base counter clear
register (CTBR))
Add Reference: to ■ Synchronous Reset Operation
Add items to Notes: for ■ External Bus Clock (CLKT)
Change Figure 3.11-1 Block Diagram of Clock Generation Controller
(Delete WPR register)
Change [bit9, bit8] WT1, WT0 (Watchdog interval Time select) (WPR → CTBR)
Add Reference: to [bit4] SRST (Software ReSeT)
Add Note: to [bit9] SYNCR (SYNChronous Reset enable)
Page 20
PageChanges (For details, refer to main body.)
90
91
94
100
106
111
130
131
137 to 150
180
182
240
240
241
Add Note: to [bit8] SYNCS (SYNChronous Standby enable)
Change ■ Time Base Counter Clear Register (CTBR)
Delete ■ Watchdog Reset Post pone Register (WPR)
Change [P ostponing a watchdog reset] (watchdog reset postpone register (WPR)
→ time base counter clear register (CTBR))
Change Figure 3.12-1 Transition of Device States
Delete [Normal and synchronous standby operations]
Change Figure 4.2-1 Configuration of the Port Data Registers (PDR) (P75 → − )
Change Figure 4.2-2 Configuration of the Data Direction Registers (DDR) (P75 → − )
Replace the entire chapter CHAPTER 5 16-BIT RELOAD TIMER
Change ■ Capture Data Register (TxCRR)
Add 7.2.8 Used Bit Description for Each Mode
Change ■ Features of the 10-Bit A/D Converter
Change Figure 12.1-2 Block Diagram of the 10-Bit A/D Converter
(Add AN9)
(Add AN8)
Change Figure 12.2-1 Register Configuration of the 10-Bit A/D Converter
244
244
247
254
254
256
258
269
276
293
353
362
365
Change the bit9 and bit8 of Figure 12.2-3 Bit Configuration of the Software Conversion Analog
Input Select Register
("0" → i9)
(
"0" → i8)
Change the [bit9 to bit0] i9 to i0 (i7 to i0 → i9 to i0)
Change ■ A/D Conversion Started by External Trigger
Change ❍ Asynchronous (start-stop synchronization) mode
Change ❍ CLK synchronous mode
Change the ■ Features (Delete "The DMAC interrupt source is cleared if the DRCL register is
written to.")
Change Figure 14.2-1 UART Registers (Delete DMA req uest clear register (DRCL))
Delete DRCL Register description
Change ■ Precautions on Usage (Delete "Write to the DRCL register befor e starting DMA transfer
due to an interrupt for the first time.")
Add a sentence to Note:
Change the second bullet under the ■ Address Register Specifications
Change ■ DMA Transfer during Sleep
Change ■ Timing to Stop a Demand Transfer Request and Timing to Inv alidate the DREQ Pin Inpu t
366
Change Figure 16.3-6 Example of the Timing for Negating the DREQ Pin Input for 2-Cycle Transfer
from an External Circuit to an Internal Circuit
xvi
Page 21
PageChanges (For details, refer to main body.)
366
367
367
456
546
632
633
634
635
636
644
644
Change • For transfer from internal to external circuits:
Change ❍ For fly-by transfer
Change Figure 16.3-7 Example of the Timing for Negating the DREQ Pin Input for Fly-by (Timing to
IORD Pin) Transfer
Change ❍ Interrupt functions (MAIN is connected to the exter n al int er rupt ch5, cc is connected to
the external interrupt ch6) (Add "MAIN is connected to the external interrupt ch5, cc is connected to
the external interrupt ch6" )
Change Table 18.3-5 Oscillating VCO Selection Control
Change Figure 19.1-2 Memory Mapping for Access in Flash Memory Mode/CPU Mode
Change the title of Figure 19.1-3 Sect or Configuration in CPU Mode (MB91FV319A, MB91F318 A)
(add (MB91FV319A, MB91F318A))
Add Figure 19.1-4 Sector Configuration in CPU Mode (MB91F318S, MB91FV319R)
Change the title of Figure 19.1-5 Sector Configuration in FLASH Mode (MB91FV319A,
MB91F318A) (add (MB91FV319A, MB91F318A))
Add Figure 19.1-6 Sector Configuration in FLASH Mode (MB91F318S, MB91FV319R)
Change ■ Basic Configuration of Serial Programming Connection
Change the title of Table 19.4-1 Command Sequence (MB91FV319A, MB91F318A) (add
(MB91FV319A, MB91F318A))
644
665
666
671 to 679
688
689
Add Table 19.4-2 Command Sequence (MB91F318S, MB91FV319R)
Change Notes: (MB91FV319A Write control pin → MB91FV319A/R MB91F318A/S Write control
pin)
Change Figure 20.1-1 Example of Serial Programming Connection
(Add *3: Reserved register. Access is disabled.)
Change Figure C-1 CP0 Pin Connection
Change the table and add a table
(Table C-2 0.25 µm: EVA, FLASH)
(Table C-3 0.18 µm: EVA, FLASH, MASK)
xvii
Page 22
xviii
Page 23
CHAPTER 1
OVERVIEW
This chapter provides basic inf ormation required to
understand the MB91319 series, and covers features, a
block diagram, and functions.
1.1 Features
1.2 Block Diagram
1.3 External Dimensions
1.4 Pin Layout
1.5 List of Pin Functions
1.6 Input-output Circuit Forms
1
Page 24
CHAPTER 1 OVERVIEW
1.1Features
The FR family is a single-chip microcontroller that has a 32-bit high-performance RISC
CPU as well as built-in I/O resources for embedded controllers requiring highperformance and high-speed CPU processing.
The FR family is the most suitable for embedded applications, for example, TV and PDP
control, that require a high level of CPU processing performance.
This model is an FR60 series model that is based on the FR30/40-family of CPUs. It has
enhanced bus access and is optimized for high-speed use.
■ FR CPU
•32-bit RISC, load/store architecture, five stages pipeline
•Operating frequency of 40 MHz [PLL used, original oscillation at 10 MHz]
•16-bit fixed-length instructions (basic instructions), one instruction per cycle
•Memory-to-memory transfer, bit processing, instructions including barrel shift, etc.:
instructions appropriate for embedded applications
•Function entry and exit instructions, multi load/store instructions:
instructions compatible with high-level languages
•Register interlock function to facilitate assembly-language coding
•Built-in multiplier/instruction-level support
•Signed 32-bit multiplication: 5 cycles
•Signed 16-bit multiplication: 3 cycles
•Interrupts (saving of PC and PS): 6 cycles, 16 priority levels
•Harvard architecture enabling simultaneous execution of both program access and data
access
•4-word queues in the CPU provided to add an instruction prefetch function
•Instructions compat ible with the FR family
■ Bus Interface
2
This bus interface is used for macro connections (USB and OSDC).
•Maximum operating fre quency of 20 MHz
•16-bit data inpu t-output (interface with USB and OSDC)
•Totally independent 8-area chip select outputs that can be defined in the minimum units of
64K bytes
The CS1
•CS1
•CS2
•CS3
•Basic bus cycle (2 cycles)
, CS2, and CS3 areas are reserved as shown below.
area: Reserved
area: USB function
area: OSDC
Page 25
•Automatic wait cycle generator that can be programmed for each area and can insert waits
because CS1
■ Built-in RAM
•EVA: 64KB RAM, FLASH: 48KB RAM, MASK: 32KB RAM
•This RAM can be used as data RAM and instruction RAM if instruction codes are written to it.
■ DMAC (DMA Controller)
•5 channels (channels 0 and 1 are connected to the USB function.)
•3 transfer sources (internal peri pherals, software)
•Addressing mode with 32-b it full address specifications (increase, decrease, fixed)
•Transfer modes (deman d transfer, burst transfer, step transf er, block transfer)
•Transfer data size that can be selected from 8, 16, and 32 bits
■ Bit Search Module (Used by REALOS)
•Searches for the position of the first bit varying between 1 and 0 in the MSB of a word
, CS2, and CS3 are reserved, the setting is fixed.
CHAPTER 1 OVERVIEW
■ Reload Timer (Including One Channel for REALOS)
•16-bit timer; 3 channels
•Internal clock that can be selected from those resulting from frequency divided by 2, 8, and 32
■ UART
•Full-duplex double buffer
•5 channels
•Parity or no parity can be selected.
•Either asynchronous (start-stop synchronization) or CLK synchronous communication can be
selected.
•Built-in timer for dedicated baud rates
•An external clock can be used as the transfer clock.
•Supply voltage: two sources of 3.3 V (-0.3 V to +0.3 V) and 2.5 V (-0.2 V to +0.2 V)
(0.25 µm : EVA(MB91FV319A), FLASH (MB91F318A))
two sources of 3.3 V (-0.3 V to +0.3 V) and 1.8 V (-0.15 V to +0.15 V)
(0.18 µm : MASK(MB91316), EVA(MB91FV319R), FLASH (MB91F318S))
2
THE I
C LICENSE:
2
Purchase of Fujitsu I
C components conveys a license under the Philips I2C Patent Rights to
use, these components in an I
2
C system provided that the system conforms to the I2C
Standard Specification as defined by Philips.
6
Page 29
1.2Block Diagram
Figure 1.2-1 is a block diagram of the MB91319.
■ Block Diagram
Figure 1.2-1 Block Diagram
CHAPTER 1 OVERVIEW
Bit search
RAM
EVA 64KB
FLASH 48KB
MASK 32KB
Clock
control
Interrupt
controller
External
interrupt
32
32 to 16
adapter
FR
CPU Core
Bus converter
Font ROM
FLASH 512 KB*
ROM 384 KB*
UART
5ch
32
External
memory
I/F
2
C
I
4ch
2
2
A/D
10ch
DSU*
Flash 1MB
MASK 512KB
DMAC5ch
USB
function
OSDC
CCD
2ch
1
Port
PWC
4ch
PPG
4ch
Reload
timer 3ch
Multifunction
timer 4ch
*1 : DSU is loaded only in MB91FV319A/R
*2 : Font ROM: MB91FV319A/R: FLASH 512 KB
: MB91F318A/S, MB91316 : MASK ROM 384 KB
7
Page 30
CHAPTER 1 OVERVIEW
176-pin plastic LQFPLead pitch0.50 mm
Package width ×
package length
24.0 × 24.0 mm
Lead shapeGullwing
Sealing methodPlastic mold
Mounting height
1.70 mm MAX
Code
(Reference)
P-LQFP-0176-2424-0.50
176-pin plastic LQFP
(FPT-176P-M07)
(FPT-176P-M07)
C
2004 FUJITSU LIMITED F176013S-c-1-1
Details of "A" part
0˚~8˚
0.50±0.20
(.020±.008)
0.60±0.15
(.024±.006)
0.25(.010)
(Stand off)
(.004±.004)
0.10±0.10
1.50
+0.20
–0.10
+.008
–.004.059
(Mounting height)
0.08(.003)
(.006±.002)
0.145±0.055
"A"
INDEX
1
LEAD No.
44
45
88
89132
133
176
0.50(.020)
0.22±0.05
(.009±.002)
M
0.08(.003)
*24.00±0.10(.945±.004)SQ
26.00±0.20(1.024±.008)SQ
Dimensions in mm (inches).
Note: The values in parentheses are reference values.
Note 1)* : Values do not include resin protrusion.
Resin protrusion is +0.25(.010)Max(each side).
Note 2) Pins width and pins thickness include plating thickness
Note 3) Pins width do not include tie bar cutting remainder.
1.3External Dimensions
The MB91319 is available in one type of package.
Figure 1.3-1 shows the dimensions of the MB91319.
■ Dimensions of the MB91319
Figure 1.3-1 External Dimensions of MB91319
8
Page 31
1.4Pin Layout
This section shows the pin layout of the MB91319.
■ Pin Layout of the MB91 319
Figure 1.4-1 is a diagram of the pin layout of the MB91319 .
9VDDP1-Dot clock PLL power supply (2.5 V)
10VGS2/VCI2-Guard band ground
11CPO2KCharge pump output
12VSSP2-Dot clock PLL ground
13VDDP2-Dot clock PLL power supply (2.5 V)
14VGS3/VCI3-Guard band ground
15CPO3KCharge pump output
16VSSP3-Dot clock PLL ground
17VDDP3-Dot clock PLL power supply (2.5 V)
18VDDR-D/A power supply for Red
19VREF(1.1V)KVoltage reference input
20VRO(2.7kΩ)KResistor connection pin
21ROUTKOutput for Red (analog)
22VSSR-D/A ground for Red
23VDDG-D/A power supply for Green
24GOUTKOutput for Green (analog)
25VSSG-D/A ground for Green
26VDDB-D/A power supply for Blue
27BOUTKOutput for Blue (analog)
28VSSB-D/A ground for Blue
29VIN0KData slicer input 0
30VIN1KData slicer input 1
10
Page 33
Table 1.5-1 Pin Functions of the MB91319 (2 / 7)
Pin numberPin nameI/O circuit typeFunction
31VDDIS-Data slicer power supply (2.5 V)
32VSSS-Data slicer ground
33VDDI-Internal logic power supply (2.5 V)
34AVCC-A/D power supply
35AVRH-A/D reference power supply
36AVSS/AVRL-A/D ground
37
38
39
40
41
42
43
44
45
46
47P22CGene r al- pu rp o se po r t
48P23CGene r al- pu rp o se po r t
49P24CGene r al- pu rp o se po r t
50P25CGene r al- pu rp o se po r t
51P26CGene r al- pu rp o se po r t
52P27CGene r al- pu rp o se po r t
53P30CGene r al- pu rp o se po r t
54P31CGene r al- pu rp o se po r t
55P32CGene r al- pu rp o se po r t
56VDDE-3.3 V power supply
57X0A10 MHz oscillation pin
58VSS-Ground
59X1A10 MHz oscillation pin
DSU tool reset (this pin is open in the MB91F31x model
series. DO NOT CONNECT)
DSU clock (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU break (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU status (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU status (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU status (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU data (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU data (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU data (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
DSU data (this pin is open in the MB91F31x model series.
DO NOT CONNECT)
71M D0FMode pin
72M D1FMode pin
73M D2FMode pin
74M D3LMode pin
75INITXBInitial (res et) pin
76
77
78
79
80
81
82
83
P80
SCL0I
J
P81
SDA0I
J
P82
SCL1I
J
P83
SDA1I
J
P84
SI0UART 0 serial input
C
P85
SO0UART 0 serial output
C
P86
SCK0UART 0 clock I/O
C
P87
SI1UART 1 serial input
C
General-purpose port
2
C clock pin
General-purpose port
2
C data pin
General-purpose port
2
C clock pin
General-purpose port
2
C data pin
General-purpose port
General-purpose port
General-purpose port
General-purpose port
12
Page 35
Table 1.5-1 Pin Functions of the MB91319 (4 / 7)
Pin numberPin nameI/O circuit typeFunction
84
85
86
87
88
89
90
91
P90
SO1UART 1 serial output
C
P91
SCK1UART 1 clock I/O
C
P92
RINPWC input
C
P93
TMI0Multifunction timer 0 input
C
P94
TMI1Multifunction timer 1 input
C
P95
TMI2Multifunction timer 2 input
C
P96
TMI3Multifunction timer 3 input
C
P97
INT0External interrupt input 0
O
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
92VDDE-3.3 V power supply
93X0AA32 kHz oscillation pin
94VSS-Ground
95X1AA32 kHz oscillation pin
96VDDI-Internal logic power supply (2.5 V)
97
98
99
PA0
INT1External interrupt input 1
O
PA1
INT2External interrupt input 2
O
PA2
INT3External interrupt input 3
O
General-purpose port
General-purpose port
General-purpose port
100NMIXBNMIX input
101
102
103
104
105
P33
TRG0PPG 0 trigger input
C
P34
TRG1PPG 1 trigger input
C
P35
TRG2PPG 2 trigger input
C
P36
TRG3PPG 3 trigger input
C
P37
SCL2I
N
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
2
C clock pin
CHAPTER 1 OVERVIEW
13
Page 36
CHAPTER 1 OVERVIEW
Table 1.5-1 Pin Functions of the MB91319 (5 / 7)
Pin numberPin nameI/O circuit typeFunction
107
108
106
109
110
111
112
113
114
115
116
117
118
119
120
121
P41
N
SCL3I
P42
SCL4I
P40
SDA2I
P43
N
N
N
SDA3I
P44
SDA4I
N
P45
SI2UART 2 serial input
C
P46
SO2UART 2 serial output
C
P47
SCK2UART 2 clock I/O
C
P50
SI3UART 3 serial input
C
P51
SO3UART 3 serial output
C
P52
SCK3UART 3 clock I/O
C
P53
CS7XChip select
C
P54
CS6XChip select
C
P55
CS5XChip select
C
P56
CS4XChip select
C
P57
CS0XChip select
C
General-purpose port
2
C clock pin
General-purpose port
2
C clock pin
General-purpose port
2
C data pin
General-purpose port
2
C data pin
General-purpose port
2
C data pin
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
122VDDI-Internal logic power supply (2.5 V)
123VSS-Ground
124VDDE-3.3 V power supply
125P70CGeneral-purpose port
126P71CGeneral-purpose port
127P72CGeneral-purpose port
128P73CGeneral-purpose port
14
Page 37
Table 1.5-1 Pin Functions of the MB91319 (6 / 7)
Pin numberPin nameI/O circuit typeFunction
129P74CGeneral-purpose port
P00
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145P17CGeneral-purpose port
146PB0CGeneral-purpose port
147PB1CGeneral-purpose port
148PB2IGeneral-purpose port
149PB3CGeneral-purpose port
SI4UART 4 serial input
TIN0Reload timer 0 trigger input
P01
SO4UART 4 serial output
TIN1Reload timer 1 trigger input
P02
SCK4UART 4 clock I/O
TIN2Reload timer 2 trigger input
P03
TOUT0Reload timer 0 output
P04
TOUT1Reload timer 1 output
P05
TOUT2Reload timer 2 output
P06
TMO0Multifunction timer 0 output
P07
TMO1Multifunction timer 1 output
P10
TMO2Multifunction timer 2 output
P11
TMO3Multifunction timer 3 output
P12
PPG0PPG 0 output
P13
PPG1PPG 1 output
P14
PPG2PPG 2 output
P15
PPG3PPG 3 output
P16
ATRGA/D conversion trigger input
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
General-purpose port
CHAPTER 1 OVERVIEW
15
Page 38
CHAPTER 1 OVERVIEW
Table 1.5-1 Pin Functions of the MB91319 (7 / 7)
Pin numberPin nameI/O circuit typeFunction
150PB4CGeneral-purpose port
151PB5CGeneral-purpose port
152PB6HGeneral-purpose port
153PB7CGeneral-purpose port
154VDDI-Internal power supply (2.5 V)
155X1BA48 MHz oscillation pin
156VSS-Ground
157X0BA48 MHz oscillation pin
158VDDE-3.3 V power supply
159UDM
160UDPUSP-Function
161B0DRGB digital output
162B1DRGB digital output
163B2DRGB digital output
164G0DRGB digital output
165G1DRGB digital output
166G2DRGB digital output
167R0DRGB digital output
168R1DRGB digital output
169R2DRGB digital output
170VDDI-Internal logic power supply (2.5 V)
171VOB2DSemi-transparent color period output
172VOB1DOSD display period output
173FHDHorizontal synchronous output
174DCKODDot clock output
175DOCKIGDot clock input
176VSYNCGVertical synchronous output
USB
USB-Function
16
Page 39
CHAPTER 1 OVERVIEW
1.6Input-output Circuit Forms
This section describes the input-output circuit types of the MB91319.
■ Input-Output Circuit Types
Table 1.6-1 lists the input-output circuit types of the MB91319.
Table 1.6-1 Input-Output Circuit Types of the MB91319 (1 / 6)
ClassificationCircuit typeRemarks
Oscillation feedback
X1
A
XO
Standby control
Clock input
CMOS level hysteresis input with pull-up
resistors
B
Digital input
•CMOS level output
CMOS level hysteresis input with
standby control
Digital output
C
Standby control
Digital output
Digital input
17
Page 40
CHAPTER 1 OVERVIEW
Table 1.6-1 Input-Output Circuit Types of the MB91319 (2 / 6)
ClassificationCircuit typeRemarks
2.5 V CMOS level output
2.5V
Digital output
CMOS level hysteresis input with
standby control
D
Standby control
Digital output
Digital input
CMOS level output
CMOS level hysteresis input with
standby control
Digital output
Digital output
Use of analog input switch
E
Analog input
Control
Digital input
18
Standby control
CMOS level input without standby control
F
Digital input
Page 41
CHAPTER 1 OVERVIEW
Table 1.6-1 Input-Output Circuit Types of the MB91319 (3 / 6)
ClassificationCircuit typeRemarks
CMOS level hysteresis input without
standby control
G
Digital input
CMOS level output
CMOS level hysteresis input with
Pull down control
Digital output
standby control and pull-down resistor
H
Standby control
Digital output
Digital input
CMOS level output
CMOS level hysteresis input with
standby control and pull-up resistor
Digital output
I
Standby control
Digital output
Digital input
19
Page 42
CHAPTER 1 OVERVIEW
Table 1.6-1 Input-Output Circuit Types of the MB91319 (4 / 6)
ClassificationCircuit typeRemarks
Open-drain output
CMOS level hysteresis input with
standby control provided
Open-drain
control
J
Standby control
Digital output
Digital input
Analog pin
K
CMOS level hysteresis input with pulldown resistor
20
L
Digital input
Page 43
CHAPTER 1 OVERVIEW
Table 1.6-1 Input-Output Circuit Types of the MB91319 (5 / 6)
ClassificationCircuit typeRemarks
CMOS level output
Digital output
M
Digital output
2
3 ports for I
C
CMOS level hysteresis input
CMOS level output
Open-drain
control
Use of stop control
Digital output
Digital input
Control
Digital input
Control
N
Open-drain
control
Digital output
Digital input
Open-drain
control
Digital output
21
Page 44
CHAPTER 1 OVERVIEW
Table 1.6-1 Input-Output Circuit Types of the MB91319 (6 / 6)
ClassificationCircuit typeRemarks
CMOS level output
CMOS level hysteresis input without
standby control
Digital output
O
Digital output
Digital input
CMOS level output
CMOS level hysteresis input without
standby control
Digital output
Use of pull-down resistor
P
Digital output
Digital input
22
Page 45
CHAPTER 2
HANDLING THE DEVICE
This chapter provides precautions on handling the
MB91319 series.
2.1 Precautions on Handling the Device
23
Page 46
CHAPTER 2 HANDLING THE DEVICE
2.1Precautions on Handling the Device
This section contains information on preventing a latch up and on the handling of pins.
■ Preventing a Latch Up
A latch up can occur if, on a CMOS IC, a voltage higher than VCC or a voltage lower than VSS is
applied to an input or output pin or a voltage higher than the rating is applied between VCC and
VSS. A latch up, if it occurs, significantly increases the power supply current and may cause
thermal destruction of an element. When you use a CMOS IC, be very careful not to exceed the
maximum rating.
■ Unused Input Pins
Do not leave an unused input pin open, since it may cause a malfunction. Handle by, for
example, using a pull-up or pull-down resistor.
■ Power Supply Pins
If more than one VCC or VSS pin exists, those that must be kept at the same potential are
designed to be connected to one other inside the device to prevent malfunctions such as latch up.
Be sure to connect the pins to a power supply and ground external to the device to minimize
undesired electromagnetic radiation, prevent strobe signal malfunctions due to an increase in
ground level, and conform to the total output current rating. Given consideration to connecting the
current supply source to VCC and VSS of the device at the lowest impedance possible.
It is also recommended that a ceramic capacitor of around 0.1 µF be connected between VCC
and VSS at circuit points close to the device as a bypass capacitor.
■ Quartz Oscillation Circuit
Noise near the X0 or X1 pin may cause the device to malfunction. Design printed circuit boards
so that X0, X1, the quartz oscillator (or ceramic oscillator), and the bypass capacitor to ground
are located as near to one another as possible.
It is strongly recommended that printed circuit board artwork that surrounds the X0 and X1 pins
with ground be used to increase the expectation of stable operation.
Please ask the crystal maker to evaluate the oscillation characteristics of the crystal and this
device.
■ Mode Pins (MD0 to MD3)
These pins must be directly connected to VCC or VSS when they are used. Keep the pattern
length between a mode pin on a printed circuit board and VCC or VSS as short as possible so
that they can be connected at a low impedance.
■ Tool Reset Pins (TRST
Be sure to input the same signal as the INIT
processing is executed for the product.
24
)
, when this pin is not used for the tool. The same
Page 47
■ Power-on
CHAPTER 2 HANDLING THE DEVICE
Immediately after power-on, be sure to apply a reset with the INIT pin to initialize the settings
(INIT).
Also immediately after power-on, keep the INIT
the required frequency stability. (For initialization by INIT from the INIT
stabilization wait time is set to the minimum value.)
■ Source Oscillation Input at Power-on
At power-on, be sure to input a source clock until the oscillation stabilization wait time is reached.
■ Precautions at Power-On/Power-Off
❍ Precautions when turning on and off VDDI (intern al 2.5 V po wer suppl y) and VDDE (e xternal
3.3 V power supply)
To ensure the reliability of LSI devices, do not continuously apply only VDDE (external) when
VDDI (internal) is off.
When VDDE (external) is changed from off to on, the power noise may make it impossible to
retain the internal state of the circuit.
•Power-on: VDDI (internal) → analog → VDDE (external) → signal
•Power-off: Signal → VDDE (external)→ analog → VDDI (internal)
■ Clocks
pin at the L level until the oscillator has reached
pin, the oscillation
❍ Notes on using external clock
When using an external clock under normal conditions, supply clock signals to X0 (X0A, X0B)
pins and simultaneously supply the antiphase signals to X1 (X1A, X1B) pins. In this case,
however, do not use STOP mode (oscillation stop mode) because in the STOP mode, the X1
(X1A, X1B) pins stop at "H" output state. When operating at 12.5 MHz or lower frequency,
however, the clock signal input is needed only to the X0 (X0A, X0B) pins.
Examples of using an external clock are illustrated in Figure 2.1-1 and Figure 2.1-2.
Figure 2.1-1 Circuit Using External Clock (Normal)
X0, X0A, X0B
X1, X1A, X1B
MB91FV319A/MB91F318A
[STOP mode (oscillation stop mode) cannot be used.]
Figure 2.1-2 Circuit Using External Clock (12.5 MHz or Lower)
X0, X1A, X1B
OPEN
X1, X1A, X1B
MB91FV319A/MB91F318A
25
Page 48
CHAPTER 2 HANDLING THE DEVICE
Note:
Signal delay time between the X0 (X0A, X0B) and X1 (X1A, X1B) pins must be within
15 ns (operating at 10 MHz).
❍ Notes on using MS clock
For MSCLK, MS transfer clock signal is output externally from an internal I/O cell and then
reentered. Therefore, insert damping resistor exteriorly to reduce reflection noise that may affect
the internal circuit.
■ Limitations
❍ Common of MB91319 series
Clock controller
INIT
must be kept at the L level until the oscillation stabilization wait time is reached.
Bit search module
Data register for detection 0 (BSD0), data register for det ection 1 (BSD1) , and d ata regis ter for
change point detection BSDC are word access only.
I/O port
Only byte access is permitted for ports.
Low Power Consumption Mode
To switch to standby mode, use synchronous standby mode (set by the SYNCS bit, that is bit8
of the TBCR, time-base counter control register) and be sure to use the following sequence:
/* STCR write */
ldi#_STCR, r0; STCR register (0x0481)
ldi#val_of_Stby, rl; Val_of_Stby is write data to STCR
stbrl, @r0; Write to STCR
•Set a break point within the above sequence of instructions.
•Step of the instructions within the above sequence of instructions.
26
Page 49
CHAPTER 2 HANDLING THE DEVICE
Prefetch
When allowing prefetch in the little endian area, only word access (in 32-bit word) should be
used to access the area.
Byte access and half-word access are not workin g pr op e rly.
Notes on using PS register
PS register is processed by some instructions in advance so that exception operations as
stated below may cause breaks during interruption handling routine when using debugger,
and may cause updates to the display contents of PS flags.
In either case, this device is designed to carry out reprocessing properly after returning from
such EIT events. The operations before and after the events are performed as prescribed in
the specification.
1. The following operations may be performed (c) if an instruction immediately before a data
event or a DIVOU/DIVOS emulator menu instruction (a) receives a user interrupt/NMI, or (b)
breaks during stepping.
•D0 and D1 flags are updated in advance.
•EIT handling routine (u ser interrupt/NMI, or emulator) is executed.
•After returning from the EIT, a DIVOU/DIVOS instruction is e xecuted and the D0 and D1
flags are updated to the same values as in (1).
2. The following operations are performed if each instruction from ORCCR, STILM, MOV Ri and
PS is executed to allow an interruption while user interrupt/NMI trigger exists.
•PS register is updated in advance.
•EIT handling routine (user interrupt/NMI) is executed.
•After returning from the EIT, the above instructions are executed and the PS register is
updated to the same value as in (1).
Watchdog Timer Function
The watchdog timer equipped in this model operates to monitor programs to ensure that they
execute reset defer function within a certain period of time, and to reset the CPU if the reset
defer function is not executed due to the program runaway. For that reason, once the
watchdog timer function is enabled, it keeps its operation until it is reset.
By way of exception, the watchdog timer automatically defers a reset under the condition
where the CPU program executions are stopped. For more detail, refer to the description
section of the watchdog timer function.
If the system gets out of control and the situation becomes as mentioned above, watchdog
reset may not be generated. In that case, please rese t (IN IT) fro m the exte rn al INI T
pin.
Note on using A/D
Nevertheless the MB91319 series contains an A/D converter, be sure not to apply the higher
power supply than V
to the AVCC.
CC
About Software Reset of Synchronous Mode
To use the software reset of synchronous mode, be sure to meet the following 2 conditions.
•Set interrupt enable flag (I-Flag) to "disabled" (I-Flag= 0)
•Do not use NMl
27
Page 50
CHAPTER 2 HANDLING THE DEVICE
❍ Unique characteristic of the evaluation chip MB91FV319A/R
Simultaneous occurrences of software break and user interrupt/NMI (MB91FV319A/R only)
If software break and user interrupt/NMI occur together, emulator debugger may:
•Stop at a point other than the programmed break points.
•Not reexecute properly after halting.
If such failures occur, use hardware break instead of software break. When using monitor
debugger, do not set any break points within the corresponding instructions.
Stepping of the RETI Instruction
In the environment where interruptions occur frequently during stepping, the RETI is executed
repeatedly for the corresponding interrupt process routines after the stepping. As the result of
it, the main routine and low-interrupt-level programs are not executed. To avoid this situation,
do not step the RETI instruction. Otherwise, perform debugging by disabling the interruptions
when the debug on the corresponding interrupt ro utines becomes unnecessary.
Operand Break
Do not set the access to the areas containing the address of stack pointer as a target of data
event break.
Sample Batch File for Configuration
When a program is downloaded to internal RAM to execute debug, be sure to execute the
following batch file after RESET.
#------------------------------------------------------------------------------# Set MODR (0x7fd) = Enable In memory + 16bit External Bus
set mem/byte 0x7fd=0x5
#-------------------------------------------------------------------------------
28
Page 51
CHAPTER 3
CPU AND CONTROL UNITS
This chapter provides basic information required to
understand the functions of the MB91319 series. It
covers architecture, specifications, and instructions.
3.1 Memory Space
3.2 Internal Architecture
3.3 Programming Model
3.4 Data Configuration
3.5 Word Alignment
3.6 Memory Map
3.7 Branch Instructions
3.8 EIT (Exception, Interrupt, and Trap)
3.9 Operating Modes
3.10 Reset (Device Initialization)
3.11 Clock Generation Control
3.12 Device State Control
3.13 Watch Timer
3.14 Main Clock Oscillation Stabilization Wait Timer
29
Page 52
CHAPTER 3 CPU AND CONTROL UNITS
3.1Memory Space
The MB91319 has a logical address space of 4 GB (232 addresses), which the CPU
accesses linearly.
■ Memory Space
32
The MB91319 has a logical address space of 4GB (2
lineally.
❍ Direct addressing area
The areas in the address space listed below are used for input-output.
These areas called the direct addressing area. The address of an operand can be directly
specified in an instruction.
The size of the direct addressing area varies according to the size of data to be accessed:
•Byte data access: 000
•Half word data access: 000H to 1FF
•Word data access: 000H to 3FF
to 0FF
H
H
H
H
addresses), while the CPU access
■ Memory Map
Figure 3.1-1 shows the memory space of this product.
Figure 3.1-1 Memory Map
Single-chip mode
I/O
I/O
Access disabled
Font RAM
Internal RAM *
Access disabled
Access disabled
USB-FUNC
OSDC
FlashROM1
FlashROM2
1MB *
512KB *
2
3
Access disabled
0000 0000
Direct addressing area
0000 0400
Refer to I/O map
0001 0000
0002 F800
0003 0000
1
0004 0000
0005 0000
0006 0000
0007 0000
0008 0000
Program
0018 0000
Font
0020 0000
FFFF FFFF
H
H
H
H
H
H
H
H
H
H
H
H
H
30
*1: Internal RAM area of MB91F318A/S and MB91FV319R becomes 0003 4000H to 0003 FFFFH.
Internal RAM area of MB91316 becomes 0003 8000H to 0003 FFFFH.
*2: For the MB91316, MASK ROM 512KB is used (0008 0000H to 000F FFFFH).
*3: For the MB91F318A/S, MB91316, MASK ROM 384KB is used (0008 0000H to 0019 7FFFH).
Page 53
CHAPTER 3 CPU AND CONTROL UNITS
3.2Internal Architecture
The MB91319 CPU is a high-performance core that is designed based on a RISC
architecture with high-level function instructions for embedded applications.
■ Features
❍ RISC architecture used
Basic instruction: One instruction per cycle
❍ 32-bit architecture
General-purpose register: 32 bits × 16
❍ 4 GB linear memory space
❍ Multiplier installed
•32-bit by 32-bit multiplication: 5 cycles
•16-bit by 16-bit multiplication: 3 cycles
❍ Enhanced interrupt processing function
•Quick response speed: 6 cycles
•Support of multiple interrupts
•Level mask function: 16 levels
❍ Enhanced instructions for I/O operations
•Memory-to-memory transfer instruction
•Bit-processing instructions
❍ Efficient code
Basic instruction word length: 16 bits
❍ Low-power consumption
Sleep and stop modes
❍ Gear function
31
Page 54
CHAPTER 3 CPU AND CONTROL UNITS
■ Internal Architecture
The FR CPU uses the Harvard architecture, in which the instruction bus and data buses are
independent of each other.
A 32-bit ↔ 16-bit bus converter is connected to the 32-bit bus (F-bus) to provide an interface
between the CPU and peripheral resources. A Harvard ↔ Princeton bus converter is connected
to the I-bus and D-bus to provide an interface be tw ee n th e CPU an d th e bu s c ontroller.
Figure 3.2-1 shows connections in the internal architecture.
Figure 3.2-1 Internal Architecture
D-bus
FRex CPU
I-bus
Data
RAM
32 bits
16 bits
Bus converter
D address
D data
Address
Data
I address
I data
32
32
32
32
32
32
Harvard
Princeton
bus
converter
External address
24
External data
16
32
16
R-bus
Peripheral resources
F-bus
Bus controllersInternal I/O
Page 55
CHAPTER 3 CPU AND CONTROL UNITS
❍ CPU
The CPU is a compact implementation of the 32-bit RISC FR architecture.
Five instruction pipe lines are used to execute one instruction per cycle. A pipeline consists of the
following stages:
•Instruction fetch (IF): Outputs an instruction address to fetch an instructio n.
•Instruction decode (ID): Decodes a fetched instruction. Also reads a register.
•Execution (EX): Execute s an arithmetic operation.
•Memory access (MA): Performs a load or store access to memory.
•Write-back (WB): Writes an operation result (or loaded memory data) to a register.
Instructions are never executed randomly. If Instruction A enters a pipeline before Instruction B, it
always reaches the write-back stage before Instruction B.
In general, one instruction is executed per cycle. However, multiple cycles are required to
execute a load/store instructio n with a m emory wait, a branch instr uctio n with out a delay slot, or a
multiple-cycle instruction. The execution of instructions slows down if the instructions are not
supplied fast enough.
❍ 32-bit/16-bit bus converter
The 32-bit/16-bit bus converter provides an interface between the F-bus accessed with 32-bit
width and the R-bus accessed with 16-bit width and enables data access from the CPU to built-in
peripheral circuits.
WB
MAWB
EXMAWB
IDEXMAWB
IFIDEXMAWB
WBIFIDEXMA
If the CPU performs a 32-bit width access to the R bus, this bus convert er converts the access
into two 16-bit width accesses. Some of the built-in peripheral circuits have limitations on the
access bus width.
❍ Harvard/Princeton bus converter
The Harvard/Princeton bus converter coordinates instruction and data accesses of the CPU to
provide a smooth interface between it and external buses.
The CPU has a Harvard architecture with separate buses for instructions and data. On the other
hand, the bus controller that performs control of external buses has a Princeton architecture with
a single bus. The Harvard/Princeton bus converter assigns priorities to instruction and data
accesses from the CPU to control accesses to the bus controller. This function allows the order of
external bus accesses to be permanently optimized.
33
Page 56
CHAPTER 3 CPU AND CONTROL UNITS
■ Overview of Instructions
The FR supports the general RISC instruction set as well as logical operation, bit manipulation,
and direct addressing instructions optimized for embedded applications. For the instruction set,
see "APPENDIX I Instruction Lists". Each instruction is 16-bit long (except for some instructions
are 32- or 48-bit long), resulting in superior efficiency of memory use.
An instruction set is classified into the following function groups:
•Arithmetic operation
•Load and store
•Branch
•Logical operation and bit manipulation
•Direct addressing
•Other
❍ Arithmetic operation
Arithmetic operation instructions include standard arithmetic operation instructions (addition,
subtraction, and comparison) and shift instructions (logical shift and arithmetic shift). The addition
and subtraction instructions include an operation with carries for use with multiple-word-length
operations and an operation that does not change flag values, a convenience in address
calculations.
Furthermore, 32-bit-by-32-bit and 16-bit-by-16-bit multiplication instructions and a 32-bit-by-32-bit
step division instruction are provided.
Additionally, an immediate data transfer instruction that sets immediate data in a register and a
register-to-register transfer instruction are provided.
An arithmetic operation instruction is executed using the general-purpose registers and the
multiplication and division registers in the CPU.
❍ Load and store
Load and store instructions read and write to external memory. They are also used to read and
write to a peripheral circuit (I/O) on the chip.
Load and store instructions have three access lengths: byte, halfword, and word. In addition to
indirect memory addressing via general registers, indirect memory addressing via registers with
displacements and via registers with register incrementing or decrementing are provided for some
instructions.
❍ Branch
The branch group includes branch, call, interrupt, and return instructions. Some branch
instructions have delay slots while others do not. These may be optimized according to the
application. The branch instructions are described in detail later.
❍ Logical operation and bit manipulation
Logical operation instructions perform the AND, OR, and EOR logical operations between
general-purpose registers or a general-purpose register and memory (and I/O). Bit manipulation
instructions directly manipulate the contents of memory (and I/O). They access memory using
general register indirect addressing.
34
Page 57
CHAPTER 3 CPU AND CONTROL UNITS
❍ Direct addressing
Direct addressing instructions are used for access between an I/O and a general-purpose register
or between an I/O and the memory. High-speed and high-efficiency access can be achieved
since an I/O address is directly specified in an instruction instead of using register indirect
addressing. Indirect memory addressing via registers with register incrementing or decrementing
are provided for some instructions.
❍ Other types of instructions
Other types of instructions include instructions that provide flag setting, stack manipulation, sign/
zero extension, and other functions in the PS register. Also, function entry and exit instructions
that support high-level languages and register multi-load/store instructions are provided.
35
Page 58
CHAPTER 3 CPU AND CONTROL UNITS
3.3Programming Model
This section explains the programming model in detail.
■ Basic Programming Model
Figure 3.3-1 Basic Programming Model
32 bits
[Initial value]
R0
XXXX XXXX
R1
General-purpose
register
R12
R13
R14
R15
A C
F P
S P
XXXX XXXX
0000 0000
Program counterPC
Program statusPS ILM SCR CCR
H
H
H
36
Table base registerTBR
Return pointerRP
System stack pointer SSP
User stack pointerUSP
Multiply and divide registers MDH MDL
Page 59
■ Registers
CHAPTER 3 CPU AND CONTROL UNITS
❍ General-purpose registers
Figure 3.3-2 General-Purpose Registers
32 bits
[Initial value]
R0 XXXX XXXX
R1
R12
R13 A C
R14 F P XXXX XXXX
R15 S P 0000 0000
H
H
H
Registers R0 to R15 are general-purpose registers. They are used as the accumulator for various
operations and pointers for memory access.
Of these 16 registers, the following registers are intended for special applications and therefore
enhanced instructions are provided for them:
The initial value after reset is not defined for R0 though R14 and is 00000000
(SSP value) for
H
R15.
❍ Program status (PS)
The program status (PS) register holds the program status and consists of three parts: ILM, SCR,
and CCR.
In the figure, all the undefined bits are reserved. During reading, 0 is always read.
This register cannot be written.
Bit location 31 20 16 10 8 7 0
ILM
SCR
CCR
37
Page 60
CHAPTER 3 CPU AND CONTROL UNITS
❍ Condition code register (CCR)
76 5 4 3 2 1 0
- -SINZVC--00XXXX
[bit5] Stack flag
Specifies the stack pointer to be used as R15.
ValueDescription
The system stack pointer (SSP) is used as R15.
0
When an EIT occurs, this bit is automatically set to 0.
(Note that the value saved on the stack is the value befor e it is cleared.)
1The user stack pointer (USP) is used as R15.
Reset clears this bit to 0.
Set this bit to 0 when executing a RETI instruction.
[bit4] Interrupt enable flag
Enable or disable a user interrupt request.
ValueDescription
User interrupt disabled.
0
When the INT instruction is executed, this bit is cleared to 0.
(Note that the value saved on the stack is the value befor e it is cleared.)
[Initial value]
B
1
User interrupt enabled.
The mask processing of a user interrupt request is controlled by the value held in ILM.
Reset clears this bit to 0.
[bit3] Negative flag
Indicate the sign when the operation result is regarded as an integer represented by its 2's
complement.
ValueDescription
0Indicates that the operation result is a positive value.
1Indicates that the operation result is a negative value.
The initial value after reset is undefined.
[bit2] Zero flag
Indicate whether the operation result is 0.
ValueDescription
0Indicates that the operation result is not 0.
1Indicates that the operation result is 0.
38
The initial value after reset is undefined.
Page 61
CHAPTER 3 CPU AND CONTROL UNITS
[bit1] Overflow flag
Indicate whether an overflow has occurred as a result of the operation when the operand is
regarded as an integer represented by its 2's complement.
ValueDescription
0Indicates that the operation did not cause an overflow.
1Indicates that the operation caused an overflow.
The initial value after reset is undefined.
[bit0] Carry flag
Indicate whether a carry or a borrow has occurred from the most significant bit in the
operation.
ValueDescription
0Indicates that no carry or borrow has occurred.
1Indicates that a carry or borrow has occurred.
The initial value after reset is undefined.
❍ System condition code register (SCR)
10 9 8[Initial value]
D1D0TXX0
B
[bit10, bit9] Step division flag
Hold the intermediate data when step division is executed.
Do not change these bits during step division.
To execute other processing during a step division, save and restore the value of the PS
register to ensure that the step division is restar te d.
The initial value after reset is undefined.
When the DIVOS instruction is executed, the multiplicand and divisor are accessed and this
flag is set.
When the DIV0U instruction is executed, this flag is cleared.
[bit8] Step trace trap flag
This bit specifies whether the step trace trap is to be enabled.
ValueDescription
0The step trace trap is disabled.
The step trace trap is enabled.
1
All user NMIs and user interrupts are prohibited.
Reset clears this bit to 0.
The step trace trap function is also used by emulators. When being used by an emulator, this
function cannot be used in a user program.
39
Page 62
CHAPTER 3 CPU AND CONTROL UNITS
❍ ILM
20 19 18 17 16[Initial value]
ILM4 ILM3ILM2ILM1ILM001111
The interrupt level mask (ILM) register holds an interrupt level mask value. The value held in ILM
is used as a level mask.
An interrupt request to the CPU is accepted only when its interrupt level is higher than the level
indicated in this ILM.
B
The highest level is 0 (00000
), and the lowest level is 31 (11111B).
B
The program setting range is limited.
•When the original value is between 16 and 31:
A new value between 16 and 31 can be set. If an instruction that sets a value between 0 and
15 is executed, the specified value plus 16 is transferred.
•When the original value is between 0 and 15:
Any value between 0 and 31 can be set.
Reset initializes this bit to 15 (01111
).
B
❍ Program counter (PC)
310 [Initial value]
PCXXXXXXXX
H
[bit31 to bit0]
These are the bits of the program counter that indicates the address of the instruction being
executed.
Bit0 is set to 0 when the PC is upd ated after an instruction is executed. Bit0 can become 1
only if the branch address is an odd number address.
However, even if the branch address is an odd number address, bit0 is invalid and therefore
the instruction should be placed at an even number address.
40
The initial value after reset is undefined.
❍ Table base register (TBR)
310 [Initial value]
TBR000FFC00
H
The table base register holds the first address of the vector table to be used during EIT
processing.
The initial value after reset is 000FFC00
.
H
Page 63
CHAPTER 3 CPU AND CONTROL UNITS
❍ Return pointer (RP)
310 [Initial value]
RPXXXXXXXXH
The return pointer holds the address returned from a subroutine.
When a CALL instruction is executed, the PC value is transferred to this RP.
When a RET instruction is executed, the RP contents are transferred to PC.
The initial value after reset is undefined.
❍ System stack pointer (SSP)
310 [Initial value]
SSP00000000
SSP is the system stack pointer.
SSP functions as R15 when the S flag is 0.
SSP can also be specified explicitly.
H
This register is also used as a stack pointer that specifies the stack on which the PS and PC
contents are to be saved if an EIT occurs.
The initial value after reset is 00000000
.
H
❍ User stack pointer (USP)
310 [Initial value]
USPXXXXXXXX
H
USP is the user stack pointer
USP functions as R15 when the S flag is 1.
USP can also be specified explicitly.
The initial value after reset is undefined.
This register cannot be used by the RETI instruction.
41
Page 64
CHAPTER 3 CPU AND CONTROL UNITS
❍ Multiply and divide register
310
MDH
MDL
The multiply and divide registers are 32-bit long.
The initial value after reset is undefined.
When multiplication is executed
For a 32-bit-by-32-bit multiplication, the 64-bit long operation result is stored in the multiply
and divide registers as follows:
MDH: High-order 32 bits
MDL: Low-order 32 bits
For a 16-bit-by-16-bit multiplication, the result is stored as follows:
MDH: Undefined
MDL: 32-bit result
When division is executed
At the start of calculation, the dividend is stored in MDL.
If a DIV0S/DIV0U, DIV1, DIV2, DIV3, or DIV4S instruction is executed for a division, the result
is stored in MDL and MDH as follows:
MDH: Remainder
MDL: Quotient
42
Page 65
CHAPTER 3 CPU AND CONTROL UNITS
3.4Data Configuration
The MB91319 uses the following two data ordering methods:
Since instructions and data are accessed in byte units, the addresses at which they are
placed depend on the instruction length or the data width.
■ Program Access
A program must be placed at an address that is a multiple of 2.
Bit0 of the PC is set to 0 if the PC is updated when an instruction is executed.
Bit0 can be set to 1 only if an odd-number address is specified as the branch address.
If bit0 is set to 1, however, bit0 is invalid and an instruction must be placed at the address that is
a multiple of 2.
No odd-number address exception exists.
■ Data Access
If data is accessed, forced alignment is applied to the add re ss ba se d on the width.
Word access:An address must be a multiple of 4. (The lowest-order 2 bits are forcibly set
to 00.)
Halfword access: An address must be a multiple of 2. (The lowest-order bit is forc ibly set to
0.)
Byte access:-
During word or halfword data access, some of the bits in the result of calculating an effective
address are forcibly set to 0. For example, in @(R13, Ri) addressing mode, the register before
addition is used without change in th e calculation (even if the lowest-order bit is 1) and the loworder bits are masked. A register before calculation is not masked.
[Example] LD @(R13, R2), R0
R13 00002222
R2 00000003
H
H
+)
Addition result 00002225
H
Lower 2 bits forcibly masked
Address pin 00002224
H
44
Page 67
3.6Memory Map
This section shows the memory map for the MB91319.
■ Memory Map
The address space is 32 bits linear.
Figure 3.6-1 Memory Map
CHAPTER 3 CPU AND CONTROL UNITS
0000 0000
0000 0100
H
H
0000 0200H
0000 0400
000F FC00
000F FFFF
FFFF FFFF
H
H
H
H
❍ Direct addressing area
Byte data
Direct addressing areaHalfword data
Word data
Vector table
initial area
The following areas in the address space are the areas for I/O. When direct addressing is used in
these areas, an operand address can be directly specified in an instruction.
The size of an address area for which an address can be directly specified varies is determined
by the data length as follows:
•Byte data (8 bits): 000
•Halfword data (16 bits): 000H to 1FF
•Word data (32 bits): 000H to 3FF
to 0FF
H
H
H
H
❍ Vector table initial area
The area from 000FFC00
to 000FFFFFH is the initial EIT vector table area.
H
You can place the vector table that will be used during EIT processing at any address by rewriting
the TBR. Initialization by a reset places the table at this address.
45
Page 68
CHAPTER 3 CPU AND CONTROL UNITS
3.7Branch Instructions
An operation with or without a delay slot can be specified for a branch instruction used
in the MB91319.
■ Branch Instruction with Delay Slot
Instructions written as follows perform a branch operation with a de lay slot:
In operation with a delay slot, the instruction located just after a branch instruction (placed in a
"delay slot") is executed before the instruction that bra nches is executed.
Since an instruction in the delay slot is executed before the branch operation, the apparent
execution speed is one cycle. However, a NOP instruction must be placed in the delay slot if
there is no valid instruction put there.
[Example]
;List of instructions
ADDR1,R2,;
BRA:DLABEL;Branch instruction
MOVR2,R3,;Delay slot ... Executed before branch
...
LABEL:STR3,@R4;Branch destination
If a conditional branch instruction is used, an instruction placed in the delay slot is executed
whether or not the condition for branching is met.
If a delay branch instruction is used, the order of execution for some instructions seems to be
reversed. However, this occurs only for updating the PC and the instructions are executed in the
specified order for other operations (register update and reference, etc.)
46
The following is a concrete example.
Ri referenced by the JMP:D @Ri / CALL:D @Ri instruction is not affected even though Ri is
updated by the instruction in the delay slot.
Page 69
CHAPTER 3 CPU AND CONTROL UNITS
[Example]
LDI:32#Label,R0
JMP:D@R0;Branch to Label
LDI:8#0,R0;No effect on the branch destination address
...
RP referenced by the RET:D instruction is not affected even though RP is updated by the
instruction in the delay slot.
[Example]
RET:D;Branch to address defined beforehand in RP
MOVR8,RP;No effect on the return operation
...
The flag referenced by the Bcc:D rel instruction is not affected by the instruction in the delay slot.
[Example]
ADD#1,R0;Flag change
BC:DOverflow;Branch to execution result of above instruction
ANDCCR#0;This flag update is not referenced by the
above branch instruction.
...
If RP is referenced by an instruction in the delay slot of the CALL:D instruction, the data that has
been updated by the CALL:D instruction is read.
[Example]
CALL:DLabel;Updating RP and branching
MOVRP,R0;Transferring RP, execution result of above
CALL:D
...
❍ Instructions that can be placed in the delay slot
Only an instruction meeting the following conditions can be executed in the delay slot.
•One-cycle instruction
•Instruction other than a branch instruction
•Instruction whose operation is not affected even though the order is changed
A one-cycle instruction is an instruction denoted in the Number of Cycles column in the list of
instructions as 1, a, b, c, and d.
47
Page 70
CHAPTER 3 CPU AND CONTROL UNITS
❍ Step trace trap
A step trace trap does not occur between the execution of a branch instruction with a delay slot
and the delay slot.
❍ Interrupt NMI
An interrupt NMI is not accepted between the execution of a branch instruction with a delay slot
and the delay slot.
❍ Undefined instruction exception
An undefined instruction exception does not occur if there is an undefined instruction in the delay
slot. If an undefined instruction is in the delay slot, it oper ates as a NOP instruction.
■ Branch Instruction without Delay Slot
Instructions written as follows perform a branch operation without a delay slot:
In operation without a delay slot, instructions are executed in the order in which they are
specified. An instruction immediately following a branch is never executed before it.
[Example]
;List of instructions
ADD R1, R2,;
BRA LABEL;Branch instruction (without a delay slot)
MOV R2, R3,;Not executed
...
LABEL:ST R3, @R4;Branch destination
A branch instruction without a delay slot is executed in two cycles if a branch occurs and in one
cycle if no branch occurs.
Since no appropriate instruction can be placed in the delay slot, this instruction results in a more
efficient instruction code than a branch instruction with a delay slot and with NOP specified.
48
For both optimal execution speed and code efficiency, select an operation with a delay slot if a
valid instruction can be placed in the delay slot; otherwise, select an operation without a delay
slot.
Page 71
CHAPTER 3 CPU AND CONTROL UNITS
3.8EIT (Exception, Interrupt, and Trap)
EIT, a generic term for exception, interrupt, and trap, refers to suspending program
execution if an event occurs during execution and then executing another program.
■ EIT (Exception, Interrupt, and Trap)
An exception is an event that occurs related to the execution context. Execution restarts from the
instruction that caused the exception.
An interrupt is an event that occurs independently of execution context. The event is caused by
hardware.
A trap is an event that occurs related to the execution context. Some traps, such as system calls,
are specified in a program . Execution restarts from the ins truction following the one that ca used
the trap.
■ Features
■ EIT Causes
ETI for the MB91319 has the following featur es:
•Multi-interrupt support
•Level masking function (15 levels available to the user)
The interrupt levels are 0 to 31 and are managed with five bits.
■ Interrupt Levels
Table 3.8-1 shows the allocation of the levels.
Table 3.8-1 EIT Interrupt Levels
Level
BinaryDecimal
00000
...
...
00011
00100
00101
...
...
01110
0111115NMI (for user)
10000
10001
...
...
11110
11111
Operation is possible for levels 16 to 31.
The interrupt level does not affect an undefined instruction exception, no-coprocessor trap,
coprocessor error trap, or an INT instruction. It does not change the ILM, either.
0
...
...
3
4
5
...
...
14
16
17
...
...
30
31
(Reserved for system)
...
...
(Reserved for system)
INTE instruction
Step trace trap
(Reserved for system)
...
...
(Reserved for system)
Interrupt
Interrupt
...
...
Interrupt
-
If the original ILM value is between
16 and 31, a program cannot set a
value in this ILM range.
User interrupts prohibited if ILM is set
Interrupts prohibited if ICR is set
■ I Flag
50
A flag that specifies whether an interrupt is permitted or prohibited. This flag is provided as bit4 of
the PS register.
ValueDescription
Interrupts prohibited
0
1
Cleared to 0 if the INT instruction is executed.
(Note that a value saved on the stack is the value before it is cleared.)
Interrupts permitted
The mask processing of an interrupt request is controlled by th e value in the ILM register.
Page 73
■ Interrupt Level Mask (ILM) Register
A PS register (bit20 to bit16) that holds an inte rrupt level mask value.
The CPU accepts only an interrupt request sent to it with an interrupt level higher than the level
indicated by the ILM.
CHAPTER 3 CPU AND CONTROL UNITS
The highest level is 0 (00000
Values that can be set by a program have a limit. If the original value is between 16 and 31, the
new value must be between 16 and 31. If an instruction that sets a value between 0 and 15 is
executed, the specified value plus 16 is transferred.
If the original value is between 0 and 15, any value between 0 and 31 may be set.
Note:
Use the STILM instruction to set this register.
■ Level Mask for Interrupt and NMI
If an NMI or interrupt request occurs, the interrupt level (Table 3.8-1) of the interrupt source is
compared with the level mask value held in the ILM. A request meeting the following condition is
masked and is not accepted:
Interrupt level of cause
) and the lowest level is 31 (11111B).
B
≥ Level mask value
51
Page 74
CHAPTER 3 CPU AND CONTROL UNITS
3.8.2Interrupt Control Unit (ICR)
The interrupt control register (ICR: Interrupt Control Register), located in the interrupt
controller, sets the level of an interrupt request. An ICR is provided for each of the
interrupt request inputs. The ICR is mapped on the I/O space and is accessed from the
CPU through a bus.
■ Configuration of Interrupt Control Register (ICR)
The system stack pointer (SSP) is used to point to the stack to save and restore data
when EIT is accepted or a return operation occurs.
■ System Stack Pointer (SSP)
bit 31 0 [Initial value]
SSP00000000
Eight is subtracted from the register value during EIT processing and eight is added to the
register value during the return operation from EIT that occurs when the RETI instruction is
executed.
H
The system stack pointer (SSP) is initialized to 00000000
by a reset.
H
The SSP is also used as general-purpose register R15 if the S flag in the CCR is set to 0.
■ Interrupt Stack
The value in the PC or PS is saved to or restored from the area indicated by SSP. After an
interrupt occurs, the PC contents are stored at the address indicated by SSP and the PS contents
are stored at the address indicated by SSP plus 4.
Figure 3.8-1 Interrupt Stack
[Example][Before interrupt][After interrupt]
SSP80000000
H
SSP7FFFFFF8
Memory
80000000
7FFFFFFC
7FFFFFF8
H
H
H
80000000
7FFFFFFC
7FFFFFF8
H
H
H
H
PS
PC
53
Page 76
CHAPTER 3 CPU AND CONTROL UNITS
3.8.4Table Base Register (TBR)
Indicate the beginning address of the vector table for EIT.
■ Table Base Register (TBR)
The table base register (TBR) consists of 32 bits as shown below:
bit 31 0 [Initial value]
TBR000FFC00
Obtain a vector address by adding to the TBR the offset value predetermined for an EIT cause.
H
The table base register (TBR) is initialized to 000FFC00
■ EIT Vector Table
A 1 KB area from the address indicated in the table base register (TBR) is the vector area for EIT.
The size for each vector is 4 bytes. The relationship between a vector number and a vector
address can be expressed as follows:
The low-order two bits of the addition result are always handled as 00.
The area from 000FFC00
Special functions are allocated to some of the vectors.
Table 3.8-3 shows the vector table on the architecture.
vctadr= TBR + vctofs
= TBR + (3FC
vctadr: Vector address
vctofs: Vector offset
vct: Vector number
H
by a reset.
H
- 4 × vct)
H
to 000FFFFFH is the initial area for the vector table upon reset.
54
Page 77
Table 3.8-3 Vector Table (1 / 3)
CHAPTER 3 CPU AND CONTROL UNITS
Interrupt number
Interrupt source
Interrupt levelOffset
DecimalHexadecimal
*1
Reset
Mode vector
*1
000-3FC
101-3F8
Reserved for system202-3F4
Reserved for system303-3F0
Reserved for system404-3EC
Reserved for system505-3E8
Reserved for system606-3E4
No-coprocessor trap707-3E0
623EICR46304
Delayed interrupt source bit633FICR47300
Reserved for system (used in REALOS)6440-2FC
Reserved for system (used in REALOS)6541-2F8
Reserved for system6642-2F4
Reserved for system6743-2F0
Reserved for system6844-2EC
Reserved for system6945-2E8
Reserved for system7046-2E4
Reserved for system7147-2E0
Reserved for system7248-2DCH000FFEDC
Reserved for system7349-2D8
Reserved for system744A-2D4
Reserved for system754B-2D0
H
H
H
000FFED8
000FFED4
000FFED0
Reserved for system764C-2CCH000FFECC
Reserved for system774D-2C8
Reserved for system784E-2C4
Reserved for system794F-2C0
Used in INT instruction
80
:
255
50
FF
2BC
:
000
H
H
H
H
:
H
000FFEC8
000FFEC4
000FFEC0
000FFEBC
:
000FFC00
*1:Even though the TBR value is changed, the reset vector and the mode vector are always fixed
addresses. 000FFFFC
and 000FFFF8H are used.
H
*2:The maskable interrupt source is defined for each model.
For the vector table, see "APPENDIX B Interrupt Vector".
H
H
H
H
H
H
H
H
H
H
57
Page 80
CHAPTER 3 CPU AND CONTROL UNITS
3.8.5Multiple EIT Processing
If multiple EIT causes occur at the same time, the CPU repeats the operation of
selecting and accepting one of the EIT causes, executing the EIT sequence, and then
detecting EIT causes again. If there are no more EIT causes be accepted while the CPU
is detecting EIT causes, the CPU executes the handler instruction of the last accepted
EIT cause. As a result, the order of executing handlers for multiple EIT causes that
occur at the same time is determined according to the following two elements:
• Priority of EIT causes to be accepted
• How other causes can be masked when one cause is accepted
■ Priority of EIT Causes To Be Accepted
The priority of EIT causes to be accepted is the order of causes for which the EIT sequence is to
be executed (that is, saving the PS and PC, updating the PC, and masking other causes, if
required). The handler of a cause accepted earlier is not necessarily executed earlier.
Table 3.8-4 lists the acceptance priority of EIT causes.
Table 3.8-4 Priority of EIT Causes to Be Accepted and Masking of Other Causes
Priority of
acceptance
1ResetOther causes are abandoned.
2Undefined instruction exceptionCanceled
3INT instructionI flag=0
4No-coprocessor trapCoprocessor error trap
5User interruptILM=level of cause accepted
6NMI (for users)ILM=15
7(INTE instruction)ILM=4
8NMI (for em u l at or s)ILM=4
9Step trace trapILM=4
10INTE instructionILM=4
*: The priority is 6 only if the INTE instruction and the NMI for emulators occur at the same time.
(The NMI for emulators is used for breaks due to data access).
CauseMasking of other causes
*
58
Page 81
CHAPTER 3 CPU AND CONTROL UNITS
In consideration of masking other causes after an EIT cause is accepted, the handlers of EIT
causes that occur at the same time are executed in the order shown in Table 3.8-5.
5NMI (for us er s)
6INT instruction
7User interrupt
8No-coprocessor trap, coprocessor error trap
*1: Other causes are abandoned.
*2: If the INTE instruction is executed in steps, only a step trace trap EIT occurs. An INTE
cause is ignored.
Figure 3.8-2 Multiple EIT Processing
[Example]
Main routine
Priority
(High) NMI occurring
(Low) INT instruction
executed
NMI handler
INT instruction
handler
(1) Executed first
(2) Executed next
59
Page 82
CHAPTER 3 CPU AND CONTROL UNITS
3.8.6EIT Operations
This section describes EIT operations.
■ EIT Operations
In the following, it is assumed that the destination source PC indicates the address of the
instruction that detected an EIT cause.
In addition, "address of the next instruction" means that the instruction that detected EIT is as
follows:
•If LDI is 32: PC + 6
•If LDI is 20 and COPOP, COPLD, COPST, and COPSV are used: PC + 4
•Other instructions: PC + 2
■ Operation of User Interrupt/NMI
If an interrupt request for a user interrupt or a user NMI occurs, whether the request can be
accepted is determined with the following procedure:
1. Compare the interrupt levels of requests that have occurred simultaneously and select the
request with the highest level (the smallest value). As levels to be compared, the value held in
the corresponding ICR is used for a maskable interrupt and a predetermined constant is used
for an NMI.
2. If multiple interrupt requests with the same level occur, select the interrupt requ est with the
smallest interrupt number.
3. Mask and do no accept an interrupt request with an interrupt level greater than or equal to the
level mask value. Go to Step 4. if the interrupt level is less than the level mask value.
4. Mask and do not accept the se lected interrupt reques t if it is maskable and the I flag is set to
0. Go to Step 5. if the I flag is 1. If the selected interrupt request is an NMI, go to Step 5)
regardless of the I flag value.
5. If the above co nditions are met, the interrupt re quest is accepted at a break in the instru ction
processing.
If a user interrupt or NMI request is accepted when EIT requests are detected, the CPU operates
as follows, using an interrupt number corresponding to the accepted interrupt request.
Parentheses in [Operation] show an address indicated by the register.
[Operation]
1. SSP-4 → SSP
60
2. PS → (SSP)
3. SSP-4 → SSP
4. Address of next ins tru ct ion → (SSP)
5. Interrupt lev el of ac ce pted request → ILM
6. "0" → S flag
7. (TBR + Vector offset of accepted interrupt request) → PC
Page 83
If a user interrupt or NMI request is accepted when EIT requests are detected, the CPU operates
as follows, using an interrupt number corresponding to the accepted interrupt request.
Parentheses show an address indicated by the register.
■ Operation of INT Instruction
INT #u8
A branch to the interrupt handler for the vector indicated by u8 generation.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. PC + 2 → (SSP)
5. "0" → I flag
6. "0" → S flag
CHAPTER 3 CPU AND CONTROL UNITS
7. (TBR + 3FC
-4 × u8) → PC
H
■ Operation of INTE Instruction
INTE
A branch to the interrupt handler for the vector indicated by vector number #9 generation.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. PC + 2 → (SSP)
5. "00100" → ILM
6. "0" → S flag
7. (TBR+3D8
) → PC
H
Do not use the INTE instruction in the processing routine of the INTE instruction or a step trace
trap.
During step execution, no EIT due to INTE generation.
61
Page 84
CHAPTER 3 CPU AND CONTROL UNITS
■ Operation of Step Trace Trap
Set the T flag in the SCR of the PS to enable the step trace function. A trap and a break then
occur every time an instruction is executed.
[Step trace trap detection conditions]
T flag =1
There is no delayed branch instruction.
A processing routine other than the INTE instruction or a step trace trap is in progress.
If the above conditions are met, a break occurs between instruction operations.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. Address of next ins tru ct ion → (SSP)
5. "00100" → ILM
6. "0" → S flag
7. (TBR+3CC
) → PC
H
Set the T flag to enable the step trace trap to prohibit a user NMI and a user interrupt. No EIT
occurs due to the INTE instruction.
A trap occurs in the instruction following the one in which the T flag has been se t.
■ Operation of Undefined Instruction Exception
If, during instruction decode, an undefined instruction is detected, an undefined instruction
exception occurs.
An undefined instruction exception is detected under the following conditions:
•An undefined instruction is detected during instruction decode.
•The instruction is not located in the delay slot (it does not immediately follow the delay branch
instruction).
If the above conditions are met, an undefined instruction exception and a break occur.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. PC → (SSP)
62
5. "0" → S flag
6. (TBR+3C4
) → PC
H
The PC value to be saved is the address of an instruction that detected an undefined instruction
exception.
Page 85
■ No-coprocessor Trap
If a coprocessor instruction using a coprocessor that is not installed is executed, a nocoprocessor trap occurs.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. Address of next ins tru ct ion → (SSP)
5. "0" → S flag
CHAPTER 3 CPU AND CONTROL UNITS
6. (TBR+3E0
) → PC
H
■ Coprocessor Error Trap
If an error occurs while a coprocessor is being used and then a coprocessor instruction that
operates on the coprocessor is executed, a coprocessor error trap occurs.
[Operation]
1. SSP-4 → SSP
2. PS → (SSP)
3. SSP-4 → SSP
4. Address of next ins tru ct ion → (SSP)
5. "0" → S flag
6. (TBR+3DC
) → PC
H
■ Operation of RETI Instruction
The RETI instruction specifies return from the EIT processing routine.
[Operation]
1. (R15) → PC
2. R15+4 → R15
3. (R15) → PS
4. R15+4 → R15
The RETI instruction must be executed while the S flag is set to 0.
■ Precaution on Delay Slot
A delay slot for a branch instruction has restrictions regarding EIT.
See "3.7 Branch Instructions".
63
Page 86
CHAPTER 3 CPU AND CONTROL UNITS
3.9Operating Modes
T wo operating modes are provided: bus mode and access mode. This section describes
these modes.
■ Operating Modes
Access modeBus mode
❍ Bus mode
❍ Access mode
■ Bus Modes
❍ Bus Mode 0 (single-chip mode)
Single chip
Internal ROM/external bus
External ROM/external bus
Bus mode refers to a mode in which the operations of internal ROM and the external access
function are controlled. A bus mode is specified using the setting pins (MD2, MD1, and MD0) and
the ROMA bit in the mode data.
An access mode is specified using the WTH1 and WTH0 bits in the mode register and the DBW1
and DBW0 bits in ACR0 to ACR7 (Area Configuration Register).
The MB91319 has the following three bus modes.
In this mode, internal I/O, DbusRAM, FbusRAM, and FbusROM are valid. Access to other areas
is invalid.
External pins do not serve as bus pins, but serve as peripheral or general-purpose I/O ports.
16-bit bus width
8-bit bus width
64
❍ Bus Mode 1 (internal-ROM/external- bus mode)
In this mode, internal I/O, Db usRAM, and FbusRAM, as well as FbusROM, are valid. Access to
an area that enables external access is handled as access to an external space. Some external
pins serve as bus pins.
❍ Bus Mode 2 (external-ROM/external-bus mode)
In this mode, internal I/O, DbusR AM, and FbusRA M are valid, but a ccess to FbusROM is invalid.
All accesses are handled as access to an external space. Some externa l pins serve as bus pins.
Page 87
■ Mode Settings
For the MB91319, set the operating mode using the mode pins (MD3, MD2, MD1, and MD0) and
the mode register (MODR).
❍ Mode pins
Use the three mode pins (MD3, MD2, MD1, and MD0) to specify mode vector fetch.
CHAPTER 3 CPU AND CONTROL UNITS
Note:
Note:
Mode pin
MD3MD2MD1MD0
0000
0100
Mode name
Internal ROM
mode vector
Serial write
mode vector
Reset vector
access area
Internal-
Remarks
-
Mode settings other than the above are prohibited.
❍ Mode register (MODR)
Mode data is data written to the mode register by a mode vector fetch (see "3.10.3 Reset
Sequence").
Mode data is always set in the mode register when any reset source arises. A user program
cannot write data to the mode register.
Nothing exists at the address (0000_07FF
) of the MB91319 mode register.
H
MODR
000FFFF8
Data can be rewritten to the mode register in emulator mode. Use an 8-bit long data transfer
instruction to rewrite data. A 16-bit or 32-bit long data transfer instruction cannot be used to
rewrite data to the mode register.
Figure 3.9-1 shows the bit configuration of the mode register (MODR).
Figure 3.9-1 Bit Configuration of the Mode Register (MODR)
Initial value
xxxxxxxx
B
H
00
000
1
WTH1
Operating mode setting bits
01234567
WTH0
[bit7 to bit3] Reserved bits
These bits are reserved.
65
Page 88
CHAPTER 3 CPU AND CONTROL UNITS
Note:
Be sure to set bit7 to bit3 to 00000. If any other value is set for these bits, operation is unpredictable.
These bits indicate the bus width specification to be used in external bus mode.
In external bus mode, this value is set in the BW1 and BW0 bits of AMD0 (CS0 area).
WTH1WTH0FunctionRemarks
00-Setting prohibited
01-Setting prohibited
1032-bit bus width11-Setting prohibited
66
Page 89
CHAPTER 3 CPU AND CONTROL UNITS
3.10Reset (Device Initialization)
This section describes a reset (that is, initialization) of the MB91319.
■ Reset (Device Initialization)
If a reset source occurs, the device stops all the programs and hardware operations and
completely initializes the state. This state is called the reset state.
When a reset source no longer exists, the device starts programs and hardware operations from
their initial state. The series o f operations from the reset state to the start of ope rations is called
the reset sequence.
67
Page 90
CHAPTER 3 CPU AND CONTROL UNITS
3.10.1Reset Levels
The reset operations of the MB91319 are classified into two levels, each of which has
different causes and initialization operations. This section describes these reset levels.
■ Settings Initialization Reset (INIT)
The highest-level reset, which initializes all settings, is called a settings initialization reset (INIT).
A settings initialization reset (INIT) mainly performs the following initialization:
❍ Items initialized in a settings initialization reset (INIT)
•Device operation mode (bus mode and external bus width settings)
•All settings on pin statuses other than the above settings
•All sections initialized by an operation initialization reset (RST)
For more information, see the description of each of these functions.
Note:
After power-on, be sure to apply the settings initialization reset (INIT) at the INIT
■ Operation Initialization Reset (RST)
A normal-level reset that initializes the operation of a program is called an operation initialization
reset (RST).
If a settings initialization reset (INIT) occurs, an operation initialization reset (RST) also occurs.
An operation initialization reset (RST) mainly initializes the following items:
❍ Items initialized by an operation initialization reset (RST)
•Program operation
•CPU and internal buses
•Register settings of peripheral circuits
•I/O port settings
pin.
68
•All CS0 area settings of external buses
For more information, see the description of each of these functions.
Page 91
CHAPTER 3 CPU AND CONTROL UNITS
3.10.2Reset Sources
This section describes the reset sources and the reset levels in the MB91319.
To determine reset sources that have occurred in the past, read the RSRR (reset source
register). For more information about registers and flags described in this section, see
"3.11.5 Block Diagram of Clock Generation Controller" and "3.11.6 Register of Clock
Generation Controller".
The INIT
A settings initialization reset (INIT) request is generated while the L level is being input to this pin.
Input the H level to this pin to clear a settings initialization reset (INIT) request.
If a settings initialization reset (INIT) is generated in response to a request from this pin, bit15
(INIT bit) of the RSRR (reset source register) is set.
Because a settings initialization reset (INIT) in response to a request from this pin has the highest
interrupt level among all reset sources, it has precedence over any other input, operation, or
state.
Immediately after power-on, be sure to apply a settings initialization reset (INIT) at the INIT
To assure the oscillation stabilization wait time for the oscillation circuit immediately after poweron, input the L level to the INIT
INIT at the INIT
•Reset source: L level input to the external INIT
•Source of clearing: H level input to the external INIT
If 0 is written to bit4 (SRSI bit) of the standby control register (STCR), a software reset request
occurs. A software reset request is an operation initialization reset (RST) request.
When the request is accepted and a operation initialization reset (RST) is generated, the software
reset request is cleared.
pin, which is an external pin, is used as the settings initialization reset pin.
pin initializes the oscillation stabilization wait time to the minimum value.
pin.
pin for the stabilization wait time required by the oscillation circuit.
pin
pin
If an operation initialization reset (RST) is generated due to a software reset request, a bit11
(SRST bit) in the RSRR (reset source register) is set.
An operation initialization reset (RST) is generated due to a software reset request only after all
bus access has stopped and if bit7 (SYNCR bit) of the time base counter control register (TBCR)
has been set (synchronization reset mode). Thus, depending on the bus usage status, a long
time is required before an operation initialization reset (RST) occurs.
•Reset source: Writing 0 to bit4 (SRST) of the standby control register (STCR)
•Source of clearing: Generation of an operation initialization reset (RST)
For details on using software reset of synchronous mode, see restrictions of bit7: SYNCR bit of TBCR (time
base counter control register).
■ Watchdog Reset
Writing to the watchdog timer control register (RSRR) starts the watchdog timer. Unless A5
H
/5A
is written to the time base counter clear register (CTBR) within the cycle specified in bit9 and bit8
(WT1 and WT0 bits) in the RSRR, a watchdog reset request occurs.
A watchdog reset request is a settings initia lization reset (INIT) request. If, after the request is
accepted, a settings initialization reset (INIT) occurs or an operation initialization reset (RST)
occurs, the watchdog reset request is cleared.
If a settings initialization reset (INIT) is generated due to a watchdog reset request, bit13 (WDOG
bit) in the reset source register (RSRR) is set.
Note that, if a settings initialization reset (INIT) is generated due to a watchdog reset request, the
oscillation stabilization wait time is not initialized.
•Reset source:Setting cycle of the watchdog timer elapses
•Source of clearing:Generation of a settings initialization reset (INIT) or an operation
initialization reset (RST)
•Reset level:Settings initialization reset (INIT)
•Corresponding flag:bit13 (WDOG)
H
70
Page 93
CHAPTER 3 CPU AND CONTROL UNITS
3.10.3Reset Sequence
When a reset source no longer exists, the device starts to execute the reset sequence.
A reset sequence has different operations depending on the reset level.
This section describes the operations of the reset sequence for different reset levels.
If a settings initialization reset (INIT) request is cleared, the following operations are performed
one step at a time for the device.
1. Clear the settings initialization reset (INIT) and enter the oscillation stabilization wait state.
2. For the oscillation stabilization wait time (set with bit3 and bit2 [OS1 and OS0 bits] in the
STCR), maintain the operation initialization reset (RST) state and stop the internal clock.
3. In the operation initialization reset (RST) state, start internal clock operation.
4. Clear the operation initialization reset (RST) and enter the normal operating state.
5. Read the mode vector from address 000FFFF8
6. Write the mode vector to the MODR (mode register) at address 000007FD
7. Read the reset vector from address 000FFFFC
8. Write the reset vector to the program counter (PC).
9. The program starts execution from the address loaded in the program counter (PC).
If an operation initialization reset (RST) request is cleared, the following operations are performed
one step at a time for the device.
1. Clear the operation initialization reset (RST) and enter the normal operating state.
2. Read the mode vector from address 000FFFF8
3. Write the mode vector to the mode register (MODR) at address 000007FD
4. Read the reset vector from address 000FFFFC
5. Write the reset vector to the program counter (PC).
6. The program starts execution from the address loaded in the program counter (PC).
.
H
.
H
.
H
.
H
.
H
.
H
71
Page 94
CHAPTER 3 CPU AND CONTROL UNITS
3.10.4Oscillation Stabilization Wait Time
If a device returns from the state in which the original oscillation was or may have been
stopped, the device automatically enters the oscillation stabilization wait state. This
function prevents the use of oscillator output after starting before oscillation has
stabilized.
For the oscillation stabilization wait time, neither an internal nor an external clock is
supplied; only the built-in time base counter runs until the stabilization wait time set in
the standby control register (STCR) has elapsed.
This section describes the oscillation stabilization wait operation.
■ Sources of an Oscillation Stabilization Wait
The following lists sources of an oscillation stabilization wait.
❍ Clearing of a settings initialization reset (INIT)
The device enters the oscillation stabilization wait state if a settings initialization reset (INIT) is
cleared for a variety of reasons.
When the oscillation stabilization wait time has elapsed, the device enters the operation
initialization reset (RST) state.
❍ Returning from stop mode
The device enters the oscillation stabilization wait state immediately after stop mode is cleared.
However, if it is cleared by a settings initialization reset (INIT) request, the device enters the
settings initialization reset (INIT) state. Then, after the settings initialization reset (INIT) is
cleared, the device enters the oscillation stabilization wait state.
When the oscillation stabilization wait time has elapsed, the device enters the state
corresponding to the source that cleared sto p m od e:
•Return due to input of a valid external interrupt request (including NMI):
The device enters the normal operating state.
•Return due to a settings initialization reset (INIT) request:
The device enters the operation initialization reset (RST) state.
•Return due to an operation initialization reset (RST) request:
The device enters the operation initialization reset (RST) state.
❍ Returning from an abnormal state when PLL is selected
72
If, while the device is operating with PLL as the source clock, an abnormal condition* occurs in
PLL control, the device automatically enters an oscillation stabilization wait to assure the PLL lock
time.
When the oscillation stabilization wait time has elapsed, the device enters the normal operating
state.
*: The multiply-by rate is changed while PLL is working, or an incorrect bit such as a bit
equivalent to PLL operation enable bit is gene ra te d .
Page 95
■ Selecting an Oscillation Stabilization Wait Time
The oscillation stabilization wait time is measured with the built-in time base counter.
If a source for an oscillation stabilization wait occurs and the device enters the oscillation
stabilization wait state, the built-in time base counter is initialized and then it starts to measure the
oscillation stabilization wait time.
Using bit3 and bit2 (OS1 and OS0 bits) of the standby control register (STCR), select and set one
of the four types of oscillation stabilization wait time.
Once selected, a setting is initialized only if a settings initialization reset (INIT) is generated due to
the external INIT
maintained if a settings initialization reset (INIT) is generated or an operation initialization reset
(RST) is generated due to a watchdog reset condit ion.
The four types of oscillation stabilization wait time settings are designed for the following four
types of use:
•OS1, OS0=00: No oscillation stabilization wait time (if neither PLL nor the oscillator should
•OS1, OS0=01: PLL lock wait time (if an oscillator should not stop in stop mode)
•OS1, OS0= 10: Oscillation stabilization wait time (intermediate) (if an oscillator that stabilizes
pin. The oscillation stabilization wait time that has been set before a reset is
stop in stop mode)
quickly, such as a ceramic vibrator, is used)
CHAPTER 3 CPU AND CONTROL UNITS
•OS1, OS0=11: Oscillation stabilization wait time (long) (if an ordinary quartz oscillator will be
used)
Immediately after power-on, be sure to apply the settings initialization reset (INIT) at the INIT
To assure the oscillation stabilization wait time of the oscillation circuit immediately after power-
on, maintain L-level input to the INIT
circuit. (INIT generated due to the INIT
to the minimum value.)
pin for the stabilization wait time required by the oscillation
pin initializes the oscillation stabilization wait time setting
pin.
73
Page 96
CHAPTER 3 CPU AND CONTROL UNITS
3.10.5Reset Operation Modes
Two modes for an operation initialization reset (RST) are provided: normal
(asynchronous) reset mode and synchronous reset mode. The operation initialization
reset mode is selected with bit7 (SYNCR bit) of the time base counter control register
(TBCR). This mode setting is initialized only by a settings initialization reset (INIT). A
settings initialization reset always results in an asynchronous reset.
This section describes the operation of these modes.
■ Normal Reset Operation
Normal reset operation refers to a transition to the operation initialization rest (RST) state
immediately after an operation initialization reset (RST) request.
If a rest (RST) request is accepted in this mode, the device immediately enters the reset (RST)
state regardless of the status of internal bus access.
In this mode, the result of a bus access being performed prior to each state transition is
unpredictable. However, these requests can certainly be accepted.
If bit7 (SYNCR bit) of the time base counter control register (TBCR) is set to 0, normal reset
mode is selected. The initial value after a settings initialization reset (INIT) is normal reset mode.
■ Synchronous Reset Operation
Synchronous reset operation refers to a transition to the operation initialization reset (RST) state
after all bus access has stopped when an operation initialization reset (RST) request occurs.
Even if a reset (RST) request is accepted in this mode, the device does not enter the reset (RST)
state while internal bus access is in progress.
If the above request is acce pted, a sleep req uest is issued to the in ternal buses. If all th e buses
stop and enter the sleep state, the device enters the operation initialization reset (RST) state.
In this mode, the result of all bus accesses is guaranteed because all bus access is stopped prior
to each status transition.
If bus access does not stop for some reason, no requests can be accepted while the bus access
is in progress. Even in this case, the settings initialization reset (INIT) is immediately valid.
Bus access may not stop in the following cases:
•A bus release request (BRQ) continues to be input to the external extended bus interface, bus
release acknowledge (BGRNT
bus.
•A ready request (RDY) continues to be input to the external extended bus interface and bus
wait is valid. In the following cases, the device eventually enters another state but only after a
long time:
Reference:
) is valid, and a new bus access request arrives from an internal
For details on using software reset of synchronous mode, see restrictions of bit7: SYNCR bit of TBCR (time
base counter control register).
The DMA controller, which stops transfer when a request is accepted, does not delay transition to another
state. If bit7 (SYNCR bit) of the time base counter control register (TBCR) is set to 1, synchronous reset mode
is selected. The initial value after a settings initialization reset (INIT) is normal reset mode.
74
Page 97
3.11Clock Generation Control
This section describes clock generation and control.
■ Clock Generation Control
The internal operating clock of the MB91319 is generat ed as follows:
•Selection of a source clock: Select a clock supply source.
•Generation of a base clock: Divide the source clock by two or perform PLL oscillation to
generate a base clock.
•Generation of an internal clock:Divide the base clock and generate four types of operating
clocks, which are supplied to each section.
Each clock generation and its control is described. The description of each register and the
detailed explanation of the flag ref er to this chapter of clock generation controller "3.11.5 Bloc k
Diagram of Clock Generation Controller" and "3.11.6 Register of Clock Generation Controller".
CHAPTER 3 CPU AND CONTROL UNITS
■ Selection of Source Clock
A resonator is connected to external oscillator pins X0/X1 and X0A/X1A, and the clock pulses
generated by the built-in oscillator circuit is used as the source clock.
The MB91319 is the source of all clocks, including the external bus clock.
The external oscillator pins and built-in oscillator circuit can use the main clock or subclock, and
these two clocks can be arbitrarily switched during operation.
•Main clock
The main clock, generated from the X0/X1 pins, is intended for use as a high-speed clock.
•Subclock
The subclock, generated from the X0A/X1A pins, is intended for use as a low-speed clock.
The main clock and subclock are multiplied by the built-in main PLL and subclock, each of which
can be independently controlled.
Generate an internal base clock by selecting one of the following source clocks:
•Main clock divided by two
•Main clock multiplied in the main PLL
•Subclock as is
Select a source clock by setting the clock source control register (CLKR).
75
Page 98
CHAPTER 3 CPU AND CONTROL UNITS
3.11.1PLL Controls
The operation (oscillation) enable and disable and multiply-by-rate setting can be
independently controlled for each of the PLL oscillator circuits provided for each of
main source cloc k and subc loc k. Eac h control is set in the clock sour ce contr ol register
(CLKR).
This section describes each control.
■ PLL Operation Enable
To enable or disable the main PLL oscillator circuit operation, set bit10 (PLL1EN bit) of the clock
source control register (CLKR).
To enable or disable the subclock oscillator circuit operation, set bit11 (PLL2EN bit) of the clock
source control register (CLKR).
After a setting initialization reset (INIT), bits PLL1EN and PLL2EN are initialized to 0, causing the
PLL oscillator circuit operation to stop. While it is stopped, PLL output cannot be selected as the
source clock.
When the program operation starts, set the multiply-by rate of the PLL to be used as the clock
source, enable it, and switch the source clock after the PLL lock wait time elapses. For the PLL
lock wait time, use of a time base timer interrupt is recommended.
While PLL output is selected as the source clock, the PLL cannot be stopped (writing to the
register is disabled). To stop a PLL upon transition to stop mode, reselect as the source clock the
main clock divided by two before stopping the PLL.
If bit0 (OSCD1 bit) or bit1 (OSCD2 bit) of the standby control register (STCR) is set to stop
oscillation in stop mode, the corresponding PLL automatically stops when the device enters stop
mode. As a result, you do not need to set operation stop. When the device returns from stop
mode later, the PLL automatically restarts the oscillation operation. If oscillation is not set to stop
in stop mode, the PLL does not automatically stop. In this case, set operation stop before
transition to stop mode as required.
76
Page 99
■ PLL Multiply-by Rate
Set the multiply-by rate of the main PLL in bit14 to bit12 (PLL1S2, PLL1S1, and PLL1S0 bits) of
the clock source control register (CLKR).
After a setting initialization reset (INIT), all bits are initialized to 0.
❍ PLL multiply-by rate setting
To change the PLL multiply-by rate setting from the initial value, do so before or as soon as the
PLL is enabled after the program has started execution. After changing the multiply-by rate,
switch the source clock after the lock wait time elapses. For the PLL lock wait time, use of a time
base timer interrupt is recommended.
To change the PLL multiply-by rate setting during operation, switch the source clock to a clock
other than the PLL in question before making the change. After changing the multiply-by rate,
switch the source clock after the lock wait time has elapsed, as described above.
You can also change the PLL multiply-by rate setting while using a PLL. In this case, however,
the program stops running after the device automatically enters the oscillation stabilization wait
state after the multiply-by rate setting is rewritten and does not resume execution until the
specified oscillation stabilization wait time has elapsed.
The program does not stop running if the clock source is switched to a clock other than a PLL.
CHAPTER 3 CPU AND CONTROL UNITS
77
Page 100
CHAPTER 3 CPU AND CONTROL UNITS
3.11.2Oscillation Stabilization Wait Time and PLL Lock Wait
Time
If a clock selected as the source clock is not already stabilized, an oscillation
stabilization wait time is required (See "3.10.4 Oscillation Stabilization Wait Time").
For a PLL, a lock wait time is required after operation starts until the output stabilizes to
the specified frequency.
This section describes the wait time used in various situations.
■ Wait Time after Power-On
After power-on, an oscillation stabilization wait time for the main clock oscillation circuit is
required.
Since the oscillation stabilization wait time setting is initialized to the minimum value due to INIT
pin input (settings initialization reset pin), assure the oscillation stabilization wait time by using the
time during which the L level is sent to the INIT
pin input.
In this state, since no PLL is enabled, no lock wait time needs to be considered.
■ Wait Time after Setting Initialization
If a settings initialization reset (INIT) is cleared, the device enters the oscillation stabilization wait
state. In this case, the specified oscillation stabilization wait is internally generated. In the first
oscillation stabilization wait state after input from the INIT
minimum value, soon ending this state, and the device enters the operation initialization reset
(RST) state.
If, after a program starts running, a settings initialization reset (INIT) is generated for a reason
other than INIT
program is internally generated.
In these states, since no PLL is enabled, no lock wait time needs to be considered.
■ Wait Time after Enabling a PLL
If you enable a stopped PLL after a program starts execution, use the PLL output only after the
lock wait time elapses. If the PLL is not selected as the source clock, the program can run even
during the lock wait time. For the PLL lock wait time, use of a time base timer interrupt is
recommended.
■ Wait Time after Changing the PLL Multiply-by Rate
If you change the multiply-by rate setting of a running PLL after a program starts execution, use
the PLL output only after lock wait time elapses.
If the PLL is not selected as the source clock, the program can run even during the lock wait time.
pin input and is then cleared, the oscillation stabilization wait time specified in the
pin, the setting time is initialized to the
78
For the PLL lock wait time, use of a time base timer inter ru pt is reco mm e nde d.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.