The MB91150 Series, hereafter referred to as MB91150, is a member of the "32-bit single-chip
microcontroller FR30 Series" family and has a CPU based on a new RISC architecture at its
core. This single-chip microcontroller contains peripheral I/O resources suited for audio
equipment and MD drives that require low power consumption.
This manual is for engineers who develop products incorporating the MB91150. It also
describes the functions and operation of the MB91150. Read this manual thoroughly. For details
on each instruction, see the Instructions Manual.
■ Trademarks
FR is an abbreviation of FUJITSU RISC controller and a product of FUJITSU LIMITED.
Embedded Algorithm
■ License
Purchase of FUJITSU I
use these components in the I
Standard Specification as defined by Philips.
TM
is a trademark of Advanced Micro Device Corporation.
2
C components conveys a license under the Philips I2C Patent Right to
2
C system, provided that the system conforms to the I2C
i
Page 6
■ Structure of This Manual
This manual contains 21 chapters and one appendix.
CHAPTER 1 "OVERVIEW OF THE MB91150"
This chapter provides basic items that are required to fully understand the MB91150, such
as a description of MB91150 features, block diagrams, and an outline of functions.
CHAPTER 2 "HANDLING THE DEVICE"
This chapter provides details on handling the MB91150.
CHAPTER 3 "MEMORY SPACE, CPU AND CONTROL UNIT"
This chapter describes basic items that are required to understand the FR Series CPU core
functions, its architecture, specifications, and instructions.
CHAPTER 4 "BUS INTERFACE"
This chapter describes the bus interface and bus operation.
CHAPTER 5 "I/O PORTS"
This chapter describes the I/O ports and provides the block diagrams of individual ports. It
also describes the structure and functions of registers.
CHAPTER 6 "8/16-BIT UP/DOWN COUNTER/TIMER"
This chapter describes the 8-bit and 16-bit up/down counter/timer and provides their block
diagrams. It also describes the structures and functions of registers and the operations of the
8-bit and 16-bit up/down counter/timer.
CHAPTER 7 "16-BIT RELOAD TIMER"
This chapter describes the 16-bit reload timer. It also describes the operations of the 16-bit
reload timer, block diagram, and the structures and functions of the timer registers.
CHAPTER 8 "PPG TIMER"
This chapter describes the PPG timer. It also describes the operations of the PPG timer,
block diagram, and the structures and functions of the timer registers.
CHAPTER 9 "MULTIFUNCTIONAL TIMER"
This chapter describes the multifunctional timer. It also describes the operations of the
multifunctional timer, block diagram, and the structures and functions of the timer registers.
CHAPTER 10 "EXTERNAL INTERRUPT CONTROL BLOCK"
This chapter describes the external interrupt control block. It also describes the operation of
the external interrupt control block, and the structures and functions of the related registers.
CHAPTER 11 "DELAYED INTERRUPT MODULE"
This chapter describes the delayed interrupt module. It also describes the operation of the
delayed interrupt module, and the structures and functions of related registers.
CHAPTER 12 "INTERRUPT CONTROLLER"
This chapter describes the interrupt controller and provides its block diagram. It also
describes the structures and functions of registers and the operation of the interrupt
controller.
CHAPTER 13 "8/10-BIT A/D CONVERTER"
This chapter describes the 8-bit D/A converter and provides its block diagram. It also
describes pins, structures and functions of registers, interrupts, device operation, and the A/
D conversion data protection function. The chapter also provides notes on using the 8/10-bit
A/D converter.
ii
Page 7
CHAPTER 14 "8-BIT D/A CONVERTER"
This chapter describes the 8-bit D/A converter. It also describes the operation of the
converter, block diagram, and the structures and functions of the converter registers.
CHAPTER 15 "UART"
This chapter describes the UART and provides its block diagram. It also describes pins,
structures and functions of registers, interrupts, timing, baud rates, and device operation.
The chapter also provides notes on using the UART.
CHAPTER 16 "I
This chapter describes the I
register structures and functions and I
2
C INTERFACE"
2
C interface and provides its block diagram. It also describes
2
C interface operation.
CHAPTER 17 "DMAC"
This chapter describes the DMAC and provides its block diagram. It also describes registers,
operation, DMA transfer sources, and DMAC timing. The chapter also provides notes on
using the DMAC.
CHAPTER 18 "BIT SEARCH MODULE"
This chapter describes the bit search module. It also describes the structures and functions
of bit search module registers, and the processing for saving and restoring.
CHAPTER 19 "PERIPHERAL STOP CONTROL"
This chapter describes peripheral stop control and structures and functions of the registers.
CHAPTER 20 "CALENDAR MACROS"
This chapter describes the calendar macros, structures and functions of registers, and the
operation of the calendar macro.
CHAPTER 21 "FLASH MEMORY"
This chapter describes the flash memory, structures and functions of the registers, device
operation, and the automation algorithm. It also provides detailed information on flash
memory writing and erasing.
APPENDIX
The appendix contains I/O maps and information on the interrupt vectors, pin status for
various CPU states, details regarding the little-endian area, and references 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 assumes 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-infringement 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 other rights of third parties which would result from the use of information contained
herein.
•The products described in this document are designed, developed and manufactured as contemplated for 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 damages 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 or 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 technologies subject to certain restrictions on
export under the Foreign Exchange and Foreign Trade Law of Japan, the prior authorization by Japanese
government will be required for export of those products from Japan.
An explanation of the most important terms in this manual is given in the table below.
TermMeaning
I-BUS16-bit bus for internal instructions. The FR Series employs internal Harvard
architecture; there are independent buses for instructions and data. A bus
converter is connected to the I-BUS.
D-BUSInternal 32-bit data bus. An internal resource is connected to the D-BUS.
C-BUSInternal multiplex bus. The C-BUS is connected to both the I-BUS and D-Bus
through a switch. An external interface module is connected to the C-BUS. On
external data buses, data and instructions are multiplexed.
R-BUSInternal 16-bit data bus. The R-Bus is connected to the D-BUS via an adapter.
Various I/O devices, a clock generator, and an interrupt controller are connected
to the R-BUS. The R-BUS has a bandwidth of 16 bits over which addresses and
data are multiplexed; CPU access time of these resources is several cycles.
E-unit Arithmetic execution unit
φSystem clock. It provides the clock signals output to each of the built-in
resources connected to the R-BUS from the clock generator. The maximum
clock speed (cycle) is identical to the original clock oscillation. The clock cycle
can be divided by 1, 1/2, 1/4, and 1/8 (or 1/2, 1/4, 1/8, and 1/16) depending on
the setting of the PCK1 and PCK0 bits of the GCR register in the clock
generator.
θSystem clock. Clock used by the CPU and resources connected to a bus other
than the R-BUS. The maximum clock speed (cycle) is identical to the original
clock oscillation. The clock cycle can be divided by 1, 1/2, 1/4, and 1/8 (or 1/2, 1/
4, 1/8, and 1/16) depending on the setting of the CCK1 and CCK0 bits of the
GCR register in the clock generator.
v
Page 10
vi
Page 11
CONTENTS
CHAPTER 1OVERVIEW OF THE MB91150 ..................................................................... 1
1.1MB91150 Features ................................................................................................................................ 2
CHAPTER 3MEMORY SPACE, CPU AND CONTROL UNIT ......................................... 29
3.1Memory Space ..................................................................................................................................... 30
3.11.7 PLL Control Register (PCTR) ......................................................................................................... 77
3.11.8 Watchdog Function ......................................................................................................................... 78
3.11.9 Gear Function ................................................................................................................................. 80
3.11.10 Retaining a Reset Source ............................................................................................................... 82
3.11.11 Example of Setting the PLL Clock .................................................................................................. 84
3.12.1 Stop Status .................................................................................................................................... 89
3.12.2 Sleep Status .................................................................................................................................. 92
3.12.3 Status Transition of the Low-power Consumption Mode .............................................................. 95
17.3.2 MAC control status register (DACSR) .......................................................................................... 366
17.3.3 DMAC pin control register (DATCR) ............................................................................................. 368
17.3.4 Register of the descriptor in RAM ................................................................................................. 370
17.4 Transfer Modes Supported by the DMA Controller ............................................................................ 373
17.4.1 Step Transfer (Single/Block Transfer) .......................................................................................... 376
17.4.2 Continuos Transfer ....................................................................................................................... 377
17.4.3 Burst Transfer ............................................................................................................................... 378
17.4.4 Differences Because of DREQ Sense Mode ................................................................................ 379
17.5 Transfer-Acceptance Signal Output and Transfer-End Signal Output ............................................... 381
17.6 Notes on the DMA Controller ............................................................................................................. 382
17.7 Timing Charts for the DMA Controller ................................................................................................ 384
xi
Page 16
17.7.1 Timing charts for the descriptor access section ........................................................................... 385
17.7.2 Timing charts for the data transfer section ................................................................................... 387
17.7.3 Timing charts for transfer termination in continuous transfer mode ............................................. 389
17.7.4 Timing charts for the transfer termination operation .................................................................... 391
21.4 Automatic Algorithm of Flash Memory .............................................................................................. 423
21.5 Checking the Automatic Algorithm Execution Status ........................................................................ 427
21.6 Writing and Erasing Flash Memory ................................................................................................... 432
21.6.1 Putting flash memory into read/reset status ................................................................................. 433
21.6.2 Writing data to flash memory ....................................................................................................... 434
21.6.3 Erasing data ................................................................................................................................. 436
21.6.4 Temporarily Stopping and Restarting Sector Erase ..................................................................... 438
D.4Debuggers (sim911, eml911, and mon911) ................................................................................... 465
APPENDIX E Instruction Lists .................................................................................................................... 466
INDEX ...................................................................................................................................487
xii
Page 17
CHAPTER 1OVERVIEW OF THE MB91150
This chapter provides basic information required to fully understand the MB91150,
such as a description of MB91150 features, block diagrams, and an outline of
functions.
1.1 "MB91150 Features"
1.2 "Comprehensive Block Diagram of MB91150"
1.3 "Exterior Dimensions"
1.4 "Pin Assignment Drawing"
1.5 "Pin Functions"
1.6 "I/O Circuit Types"
1
Page 18
CHAPTER 1 OVERVIEW OF THE MB91150
1.1MB91150 Features
The MB91150 is a single-chip microcontroller with peripheral I/O resources suited for
controlling devices such as audio equipment and MD drives that require operation
with low-power consumption. The core of the MB91150 is a 32-bit RISC CPU (FR30
Series).
•DMAC of the descriptor type according to which transfer parameters are allocated in main
storage
•Capable of transferring up to eight internal and external sources
•External source: 3 channels
❍ Bit search module
The bit search module makes a one-cycle search for the location of the first I/O bit change
starting with the MSB of a word.
❍ Timer
•16-bit OCU x 8 channels, ICU x 4 channels, free-run timer x 1 channel
•8-bit or 16-bit up/down timer/counter (8-bit x 2 channels or 16-bit x 1 channel)
•The AIN and BIN pins are shared with internal interrupts.
•16-bit PPG timer x 6 channels. The cycle and duty of an output pulse can be changed to an
arbitrary value.
•16-bit reload timer x 4 channels
❍ D/A converter
8 bits x 3 channels
❍ A/D converter (successive approximation type)
•10 bits x 8 channels
•Successive approximation type (conversion time: 5.0 µs@33 MHz)
•Singe and scan conversions can be selected, and single, continuous, and stop conversion
modes can be set.
•Hardware-driven or software-driven conversion function
3
Page 20
CHAPTER 1 OVERVIEW OF THE MB91150
❍ Serial I/O
•UART x 4 channels. Each UART can perform clock-synchronized serial transfer with the
LSB/MSB switching function.
•Serial data output and serial clock output can be selected by open-drain or push-pull
software.
•Built-in 16-bit timer (U-Timer) as a dedicated baud rate generator, which can generate any
baud rate
2
❍ I
C bus interface
•1-channel master/slave transmission/reception
•Arbitration function and clock synchronization function
•(As long as the customer uses this product in an I
Standard Specifications prepared by Philips, the customer is granted a license of the I
patent of Philips.)
❍ Clock switching function
The ratio of the operating clock to the base clock can independently be set with the gear
function to 1:1. 1:2, 1:4, or 1:8 for the CPU and for each peripheral device.
2
C system conforming to the I2C
2
C
❍ Clock function (calendar macro)
•Built-in 32 kHz clock function
•The 32 kHz oscillation clock function can operate in stop mode as well.
•(32-kHz oscillation does not stop in stop mode.)
❍ Interrupt controller
•External interrupt input (up to 16 channels)
•The leading edge, trailing edge, H level, or L level can be set.
•Internal interrupt source
•Resource interrupt, delayed interrupt
❍ Other features
•Reset sources
•Power-on reset, watchdog timer, software reset, and external reset
•Low-power consumption mode
•Sleep mode and stop mode
•Packages
•PGA-299 (MB91FV150)
•LQFP-144 [MB91F155A, MB91155, MB91154]
•CMOS technology (0.35 µm)
•Power supply
•3.15 V to 3.6 V
4
Page 21
CHAPTER 1 OVERVIEW OF THE MB91150
1ch
1.2Block Diagrams
This section provides MB91150 block diagrams separately for individual packages.
■ Block diagram for MB91FV150, MB91F155A and MB91155
Figure 1.2-1 "Block diagram (MB91FV150, MB91F155A and MB91155)" is a block diagram for
the MB91FV150, MB91F155A and MB91155.
Figure 1.2-1 Block diagram (MB91FV150, MB91F155A and MB91155)
■ Package dimensions of PGA-299C-A01 (MB91FV150 Only)
Figure 1.3-1 Package dimensions of PGA-299C-A01
299-pin ceramic PGALead pitch2.54mm(100mil)
Sealing methodMetal seal
CHAPTER 1 OVERVIEW OF THE MB91150
Pin matrix20
(PGA-299C-A01)
299-pin ceramic PGA
(PGA-299C-A01)
INDEX AREA
2.41 ± 0.10
(.095 ± .004)
1.65 ± 0.10
(.065 ± .004)
30.48 ± 0.31
(1.200 ± .012)
52.32 ± 0.56
(2.060 ± .022)
SQ
35.56 ± 0.41
(1.400 ± .016)
3.94 ± 0.10
(.155 ± .004)
5.59 (.220) MAX
+ 0.13
0.46
+ .005
(.018 )
2.54 (.100) MAX
48.26 (19.00)
REF
2.54 ± 0.25
(.100 ± .010)
1.27 ± 0.25
(.050 ± .010)
+ 0.41
3.40
+ .016
(.134 )
1.27 (.050) DIA TYP
(4 PLCS)
INDEX AREA
C
1994 FUJITSU LIMITED R299001SC-2-2
Dimensions in mm (inches).
7
Page 24
CHAPTER 1 OVERVIEW OF THE MB91150
■ Package dimensions of FPT-144P-M08 (MB91F155A, MB91155 and MB91154)
Figure 1.3-2 Package dimensions of FPT-144P-M08
144-pin plastic LQFPLead pitch0.50 mm
(FPT-144P-M08)
144-pin plastic LQFP
(FPT-144P-M08)
22.00±0.20(.866±.008)SQ
*
20.00±0.10(.787±.004)SQ
109
Package width ×
package length
20.0 × 20.0 mm
Lead shapeGullwing
Sealing methodPlastic mold
Mounting height
1.70 mm MAX
Weight1.20g
Code
(Reference)
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.
0.145±0.055
73108
72
(.006±.002)
P-LFQFP144-20×20-0.50
INDEX
144
136
LEAD No.
C
2003 FUJITSU LIMITED F144019S-c-4-6
0.50(.020)
0.22±0.05
(.009±.002)
0.08(.003)
0.08(.003)
Details of "A" part
+0.20
1.50
–0.10
(Mounting height)
+.008
.059
–.004
0.10±0.10
0˚~8˚
37
M
"A"
0.50±0.20
(.020±.008)
0.60±0.15
(.024±.006)
Dimensions in mm (inches).
Note: The values in parentheses are reference values.
(.004±.004)
(Stand off)
0.25(.010)
8
Page 25
CHAPTER 1 OVERVIEW OF THE MB91150
1.4Pin Assignment
This section shows the MB91150 pin assignment for each type of package.
■ Pin assignment of MB91FV150 (PGA-299C-A01)
Figure 1.4-1 "MB91FV150 (PGA-299C-A01) pin assignment" shows the MB91FV150 (PGA299C-A01) pin assignment. Table 1.4-1 "Correspondence between pin numbers and pin names
(MB91FV150 (PGA-299C-A01)) (Device: MB91FV150, Package: PGA-299C-A01)" lists the
correspondences between pin numbers and pin names.
Can be used as a port when the address bus is not
used.
45P80/RDYCExternal RDY input
Effective when external RDYU input is enabled.
"0" is input if the bus cycle in progress fails to be
complete.
Can be used as a port when external RDY input is not
used.
46P81/BGRNT
FExternal bus open acceptance output
Effective when external bus open acceptance output is
enabled.
Outputs L when the external bus is opened.
Can be used as a port when external bus open
acceptance output is disabled.
47P82/BRQCExternal bus open request input
Effective when external bus open request input is
enabled.
Input "1" to open the external bus.
Can be used as a port when external bus open
request input is disabled.
48P83/RD
FExternal bus read strobe output
Effective when external bus read strobe output is
enabled.
Can be used as a port when external bus read strobe
output is disabled.
49P84/WR0
FExternal bus write strobe output
Effective in external bus mode.
Can be used as a port in single chip mode.
50P85/WR1
FExternal bus write strobe output
Effective when MB91150 is in external bus mode and
bus width is 16 bits.
Can be used as a port when MB91150 is in single chip
mode or 8-bit external bus mode.
51P86/CLKFSystem clock output
Outputs a clock signal that is equal to the operating
frequency of the external bus. Can be used as a port
when the system clock is not used.
52
53
54
55RST
MD2
MD1
MD0
GConnect these pins directly to V
These pins set the basic MCU operation mode.
Mode pins
BExternal reset input
or VSS.
CC
13
Page 30
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
These inputs are always in use while the
corresponding external interrupts are enabled. Stop
port output in advance unless the resulting processing
is intentional.
This port can be used to release the standby status
because its input is enabled even during standby.
Can be used as a port when the pin is not used for
external interrupt request input.
HUsed for both chip select outputs and external interrupt
request inputs 4 to 7
Can be used for external interrupt request input or as a
port when chip select output is disabled.
These inputs are always in use while the
corresponding external interrupts are enabled. Stop
port output in advance unless the resulting processing
is intentional.
This port can be used to release the standby status
because its input is enabled even during standby.
Can be used as a port when the pin is not used for
external interrupt request input and chip select output.
These inputs are always in use while the
corresponding external interrupts are enabled. Stop
port output in advance unless the resulting processing
is intentional.
[AIN, BIN] Up/down timer input
[TRG] PPG external trigger input
These inputs are always in use while they are enabled.
Stop port output in advance unless the resulting
processing is intentional.
Can be used as a timer when the pin is not used for
external interrupt request input, up/down timer input,
and PPG external trigger input.
This input is always in use while the corresponding
external interrupt is enabled. Stop port output in
advance unless the resulting processing is intentional.
[DEOP2] DMA external transfer end output
Effective when DMAC external transfer end output
specification is enabled.
Can be used as a port when the pin is not used for
external interrupt request input or DMA external
transfer end output.
14
Page 31
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
This input is always in use while the corresponding
external interrupt is enabled. Stop port output in
advance unless the resulting processing is intentional.
[ATG
] A/D converter external trigger input
This input is always in use while the corresponding
external interrupt is enabled. Stop port output in
advance unless the resulting processing is intentional.
Can be used as a port when the pin is not used for
external interrupt request input and A/D converter
external trigger input.
FOutput compare output
Can be used as a port when output compare output
specification is disabled.
FInput capture input
Effective for input with input capture.
Can be used as a port when the pin is not used as
Input capture input.
Acts as output for Reload Timer 3 when UART3 clock
output is disabled and Reload Timer 3 output is
enabled.
Can be used as port when UART3 clock output and
reload timer output are disabled.
15
Page 32
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
Pin No.Pin nameCircuit type Function description
103PI4/SOT3PUART3 data output
Effective when UART3 data output specification is
enabled.
Can be used as a port when UART3 data output
specification is disabled.
104PI3/SIN3PUART3 data input
This input is always in use while UART3 is performing
input processing. Stop port output in advance unless
the resulting processing is intentional.
Can be used as a port when the pin is not used for
UART3 data input.
Acts as output for Reload Timer 2 when UART2 clock
output is disabled and Reload Timer 2 output is
enabled.
Can be used as port when UART2 clock output and
reload timer output are disabled.
106PI1/SOT2PUART2 data output
Effective when UART2 data output specification is
enabled.
Can be used as a port when UART2 data output
specification is disabled.
107PI0/SIN2PUART2 data input
This input is always in use while UART2 is performing
input processing. Stop port output in advance unless
the resulting processing is intentional.
Can be used as a port when the pin is not used for
UART2 data input.
Acts as output for Reload Timer 1 when UART1 clock
output is disabled and Reload Timer 1 output is
enabled.
Can be used as port when UART1 clock output and
reload timer output are disabled.
109PH4/SOT1PUART1 data output
Effective when UART1 data output specification is
enabled.
Can be used as a port when UART1 data output
specification is disabled.
110PH3/SIN1PUART1 data input
This input is always in use while UART1 is performing
input processing. Stop port output in advance unless
the resulting processing is intentional.
Can be used as a port when the pin is not used for
UART1 data input.
16
Page 33
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
Acts as output for Reload Timer 0 when UART0 clock
output is disabled and Reload Timer 0 output is
enabled.
Can be used as port when UART0 clock output and
reload timer output are disabled.
112PH1/SOT0PUART0 data output
Effective when UART0 data output specification is
enabled.
Can be used as a port when UART0 data output
specification is disabled.
113PH0/SIN0PUART0 data input
This input is always in use while UART0 is performing
input processing. Stop port output in advance unless
the resulting processing is intentional.
Can be used as a port when the pin is not used for
UART0 data input.
114PL0/DREQ0FDMA external transfer request input
This pin is always in use when the pin is selected for a
DMA controller transfer source. Stop port output in
advance unless the resulting processing is intentional.
Can be used as a port when the pin is not used for
DMA transfer request input.
115PL1/DACK0FDMA external transfer request acceptance output
Effective when external transfer request acceptance
output specification of the DMA controller is enabled.
Can be used as a port when external transfer request
acceptance output specification of the DMA controller
is disabled.
116PL2/DEOP0FDMA external transfer end output
Effective when external transfer end output
specification of the DMA controller is enabled.
117PL3/DREQ1FDMA external transfer request input
This pin is always in use when the pin is selected for a
DMA controller transfer source. Stop port output in
advance unless the resulting processing is intentional.
Can be used as a port when the pin is not used for
DMA transfer request input.
118PL4/DACK1FDMA external transfer request acceptance output
Effective when external transfer request acceptance
output specification of the DMA controller is enabled.
Can be used as a port when external transfer request
acceptance output specification of the DMA controller
is disabled.
119PL5/DEOP1FDMA external transfer end output
Effective when external transfer end output
specification of the DMA controller is enabled.
17
Page 34
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
Pin No.Pin nameCircuit type Function description
120PL6/DREQ2FDMA external transfer request input
This pin is always in use when the pin is selected for a
DMA controller transfer source. Stop port output in
advance unless the resulting processing is intentional.
Can be used as a port when the pin is not used as
DMA transfer request input.
121PL7/DACK2FDMA external transfer request acceptance output
Effective when external transfer request acceptance
output specification of the DMA controller is enabled.
Can be used as a port when external transfer request
acceptance output specification of the DMA controller
is disabled.
123
124
125
DA2
DA1
DA0
-D/A converter output
Effective when D/A converter output specification is
enabled.
126DAVS-Power supply pin of D/A converter
127DAVC-Power supply pin of D/A converter
128AV
CC
-V
power supply for A/D converter
CC
129AVRH-A/D converter reference voltage (high potential side)
Be sure to turn on or off this pin when a potential of
AVRH or higher is applied to V
CC
.
130AVRL-A/D converter reference voltage (low potential side)
Effective when the AIC register specifies analog input.
Can be used as a port when A/D converter analog
input is not used.
141TESTGAlways connect the pin to the V
142
143
27, 56,
68, 77,
X0A
X1A
V
CC
KOscillation pins for low-speed clock frequency (32 kHz)
-Power supply of digital circuit
Be sure to connect the power supply to all V
97, 122,
140
18
power supply.
CC
CC
pins.
Page 35
CHAPTER 1 OVERVIEW OF THE MB91150
Table 1.5-1 Functions of the MB91150 pins (Continued)
Pin No.Pin nameCircuit type Function description
9,26,
44, 59,
V
SS
-Ground level of digital circuit
Be sure to ground the power supply to all V
98, 101,
144
Note:
For most of the above pins, port I/O and resource I/O are multiplexed as in xxx/Pxx.
If port and resource outputs compete at these pins, resource output precedes port output.
Pull-up resistance: about 50 KΩ
(typically)
IOL=4mA
Hysteresis input
Standby control
•Open-drain I/O pin
•5 V dielectric strength
•CMOS hysteresis input
Nout
Q
(With standby control)
IOL=15mA
R
Hysteresis input
Standby control
22
Page 39
CHAPTER 2HANDLING THE DEVICE
This chapter provides details on handling the MB91150.
2.1 "Notes on Handling the MB91130"
2.2 "Notes on Using Devices"
2.3 "Power-On"
23
Page 40
CHAPTER 2 HANDLING THE DEVICE
2.1Notes on Handling Devices
This section describes latch-up prevention, pin processing, and circuit handling.
■ Latch-up prevention
CMOS ICs may suffer a latch-up when a higher voltage than V
applied to an input or output pin or when a voltage exceeding the applicable rating is applied
between V
thermal damage to an element. For this reason, ensure that the voltage to be applied does not
exceed the absolute maximum ratings.
■ Pin processing
❍ Unused pin processing
Leaving unused input pins open may result in a malfunction; pull them up or down.
❍ NC pin processing
Be sure to open the NC pin when using it.
❍ Output pin processing
Connecting one output pin with another, connecting an output pin with the power supply, or
connecting a large capacity load may cause flow of high current. Over a long period, this
condition results in device deterioration. For this reason, ensure that the current does not
exceed the absolute maximum ratings.
❍ Mode pins (MD0 to MD2)
or a lower voltage than VSS is
CC
and VSS. This latch-up may rapidly increase power supply current, resulting in
CC
24
Connect the MD0 to MD2 pins direct to V
or VSS when using them. To prevent MB91150 from
CC
entering the test mode mistakenly due to noise, make the pattern length between each mode
pin and V
or VSS on a PC board as short as possible and connect these in low impedance.
CC
❍ Power supply pins
If there are several V
and VSS pins, those that must be set to the same potential in the device
CC
are connected to each other in device design to prevent such malfunctions as latch-up. To
prevent the strobe signal from malfunctioning due to fluctuations in background radiation and
increase in ground level current or to observe the total output current regulations, be sure to
externally connect all these power supply pins to the power supply and ground.
Also, connect the power supply pins from the power supply source to the V
and VSS pins of
CC
this device at low impedance as far as possible. In addition, a ceramic capacitor of about 0.1µF
should be connected between V
and VSS pins near this device as a bypass capacitor.
CC
Page 41
■ Circuit handling
❍ Crystal oscillation circuit
Noise near the X0, X1, X0A, or X1A pin causes this device to malfunction. Design PC boards so
that the X0 and X1 (X0A and X1A) pins, crystal oscillators (or ceramic oscillators), and bypass
capacitors to the ground can be placed as close as possible.
In the interest of stable operation, it is strongly recommended that a PC board artwork that
encloses the surroundings of the X0, X1, X0A, and X1A pins with the ground should be used.
The MB91FV150 has a feedback resistor in the 32 kHz oscillation circuit (X0A, X1A), but the
MB91F155A, MB91155 and MB91154 do not. Therefore, when the clock function is used,
connect an external resistor as shown in Figure 2.1-1 "Resistor connection".
Figure 2.1-1 Resistor connection
X0A
CHAPTER 2 HANDLING THE DEVICE
X0A
X1A
MB91FV150
MB91F155A
X1A
MB91155/MB91154
25
Page 42
CHAPTER 2 HANDLING THE DEVICE
2.2Notes on Using Devices
This section provides notes on using external reset input and external clocks.
■ External reset input
To securely put the device into the reset state, at least five machine cycles of L level input to the
RST
pin are required.
■ External clock
When an external clock is used, feed the clock to the X0 pin and antiphase clock to the X1 pin
simultaneously. However, when the STOP mode (oscillation stop mode) is also used, the X1 pin
stops with H output in STOP mode. To prevent output collision, provide an external resistor of
about 1 kΩ.
Figure 2.2-1 "Example of using an external clock" shows an example of using an external clock.
Figure 2.2-1 Example of using an external clock
X0
■ Notes on during operation of PLL clock mode
If the PLL clock mode is selected, the microcontroller attempt to be working with the selfoscillating circuit even when there is no external oscillator or external clock input is stopped.
Performance of this operation, however, cannot be guaranteed.
■ Watchdog timer function
The watchdog timer supported by the FR family monitors the program that performs the reset
delay operation for a specified time. If the program hangs and the reset delay operation is not
performed, the watchdog timer resets the CPU. Therefore, once the watchdog timer is enabled,
operation continues until the CPU is reset.
As an exception, a reset delay automatically occurs if the CPU stops program execution. For the
conditions that apply to this exception, refer to the section that describes the watchdog function.
X1
MB91150
26
Page 43
CHAPTER 2 HANDLING THE DEVICE
2.3Power-On
This section provides notes on power-on and notes applicable when the clock function
is not used.
■ Notes on power-on
❍ Power-on
At power-on, be sure to start the RST
the V
elapsed, then set the RST
level, wait until the time for at least five cycles of the internal operating clock has
CC
pin to the H level.
pin at the L level. After the power supply level becomes
❍ Oscillation input
At power-on, be sure to continue inputting clock signals until the oscillation stabilization wait
status is released.
❍ Power-on reset
Be sure to perform a power-on reset to turn on power. Perform a power-on reset also when
powering on again if the power supply voltage has dropped to less than the voltage for assuring
operation.
❍ Power on order
Turn on power in the order of V
--> AVCC --> AVRH, and turn off power in the reverse order.
CC
❍ A/D converter
Even when the A/D converter is not used, connect AV
to the VCC level and AVSS to the V
CC
level.
❍ D/A converter
Even when the D/A converter is not used, connect DAVC to the V
level and DAVS to the V
CC
level.
SS
SS
27
Page 44
CHAPTER 2 HANDLING THE DEVICE
■ When the clock function (calendar macro) Is not used
When the clock function is not used, arrange the clock oscillation pins as shown in Figure 2.3-1
"Arrangement of clock oscillation pins when the clock function is not used".
Figure 2.3-1 Arrangement of clock oscillation pins when the clock function is not used
X0A
OPEN
X1A
MB91150
Note:
The crystal oscillator for the clock used in this type of product cannot be stopped by
software.
28
Page 45
CHAPTER 3MEMORY SPACE, CPU AND CONTROL
UNIT
This chapter provides basic information regarding the architecture, specifications,
instructions, and other topics, that is required to understand the CPU core functions of
the FR series.
Note: Access to the external area is prohibited in single chip mode.
Page 49
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.2CPU Architecture
The FR CPU is a high-performance core employing RISC architecture and using highlevel function instructions for insertion.
■ Features
❍ Use of the RISC architecture
❍ Basic instructions, one instruction for one cycle
❍ 32-bit architecture
•32-bit general-purpose registers: 16
❍ Linear 4-gigabyte memory space
❍ Multiplier mounted
•Multiplication of 32 bits x 32 bits: 5 cycles
•Multiplication of 16 bits x 16 bits: 3 cycles
❍ Enforced interrupt processing functions
•High-speed response (6 cycles)
•Multiple interrupts supported
•Level mask function (16 levels)
❍ Enforced I/O operation instructions
•Memory-to-memory transfer instructions
•Bit processing instructions
❍ High code efficiency
•Word length of a basic instruction: 16 bits
❍ Low power consumption
•Sleep mode and stop mode
33
Page 50
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ Internal architecture
The FR CPU uses the Harvard architecture in which the instruction bus and data bus are
mutually independent.
The bus converter for 32 bits <--> 16 bits is connected to the data bus (D-BUS) to provide the
interface between the CPU and peripheral resources.
The bus converter for Harvard <--> Princeton is connected to both I-BUS and D-BUS to provide
the interface between the CPU and bus controller.
Figure 3.2-1 "Internal architecture" shows the internal architecture of the device.
Figure 3.2-1 Internal architecture
FR CPU
D-BUSI-BUS
Harvard
Princeton
32bit
Bus-Converter
16bit
Bus-Converter
R-bus
Resource
C-bus
Bus-Controller
❍ CPU
The FR architecture of 32-bit RISC is compactly implemented in the CPU of this product. The
CPU uses the 5-stage instruction pipeline method to execute one instruction per cycle. The
pipeline consists of the following stages:
•Instruction fetch (IF): Outputs an instruction address and fetches the instruction.
•Instruction decode (ID): Decodes the fetched instruction. Also reads a register.
•Execution (EX): Executes arithmetic operations.
•Memory access (MA): Accesses the memory (loads or stores data in the memory).
•Write back (WB): Writes the arithmetic operation results (or loaded memory data) to the
register.
34
Figure 3.2-2 "Instruction pipeline" shows the instruction pipeline.
Page 51
CLK
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
Figure 3.2-2 Instruction pipeline
Instruction 1
Instruction 2
Instruction 3
Instruction 4
Instruction 5
Instruction 6
WB
MA
EX
ID
IF
WB
MA
EX
ID
IF
WB
MA
EX
Instructions are not executed out of sequence. In other words, when instruction A enters the
pipeline before instruction B, it will reach the write back stage before instruction B.
Instructions are generally executed at the speed of one instruction per cycle. However, the
following instructions require multiple cycles for their execution: load and store instructions
accompanied by memory wait, branch instructions having no delay slot, and instructions having
multiple cycles.
In addition, the instruction execution speed decreases when the instruction supply is slow.
❍ Bus converter for conversion between 32 bits and 16 bits
Provides an interface between the D-BUS for high-speed 32-bit access and the R-BUS for 16bit access to enable the CPU to access the built-in peripheral circuits.
When a 32-bit access is instructed from the CPU, this bus converter converts it into two 16-bit
accesses for R-BUS access. Some built-in peripheral circuits have restrictions with respect to
the access width.
WB
MAWB
WBMAEXID
❍ Bus converter for conversion between Harvard and Princeton architecture
Matches instruction and data accesses of the CPU to provide a smooth interface with external
buses.
The CPU employs the Harvard architecture, in which the instruction and data buses are
mutually independent.
The bus controller that controls the external buses employs the Princeton architecture and has a
single bus.
This bus converter assigns priority to instruction and data accesses of the CPU to control
accesses to the bus controller. With this function, the order of bus accesses to the outside is
always optimized.
This bus converter has a two-word write buffer for eliminating the bus wait time of the CPU and
a one-word prefetch buffer for fetching instructions.
35
Page 52
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.3Programming Model
This section describes the basic programming model and each register of the device.
■ Basic programming model
Figure 3.3-1 "Basic programming mode" shows the basic programming model.
Figure 3.3-1 Basic programming model
32 bits
[Initial value]
R0
R1XXXX XXXX
XXXX XXXX
H
H
…
General-purpose register
…
…
R12XXXX XXXX
R13ACXXXX XXXX
R14FPXXXX XXXX
R15
SP
0000 0000
Program counterPCXXXX XXXX
Program statusPS
ILM
SCR CCR
Table base registerTBRFC00000F
Return pointerRPXXXX XXXX
System stack pointerSSP0000 0000
User stack pointerUSPXXXX XXXX
Multiplication or division
result register
MDHXXXX XXXX
MDLXXXX XXXX
H
H
H
H
H
H
H
H
H
H
H
36
Page 53
■ General-purpose registers
Figure 3.3-2 "General-purpose register configuration" shows the configuration of the generalpurpose register.
Registers R0 to R15 are general-purpose registers. They are used as accumulators for various
types of operation or as for storing memory access pointers.
Of the 16 registers, those shown below are supposed to be used for special purposes, and
therefore some instructions have been enhanced.
•R13: Virtual accumulator
•R14: Frame pointer
•R15: Stack pointer
The initial values of R0 to R14 after resetting are undefined. The initial value of R15 is
00000000
(SSP value).
H
XXXX XXXX
XXXX XXXX
XXXX XXXX
0000 0000
37
Page 54
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ Program status (PS)
This register stores the program status. It is divided into three parts: ILM, SCR, and CCR.
All the undefined bits in the figure are reserved. They always return 0 in read access. Writing
operations have no effect.
Bit position -->
312016108 70
ILMSCRCCR
PS
❍ Condition code register (CCR)
7654321 0
INZVC
S
CCR
[Bit 5] Stack flag
Specifies the stack pointer to be used as R15.
ValueContent
0SSP is used as R15. When EIT is generated, the flag is automatically set to 0.
However, the value to be saved on the stack is the value before clearing.
1USP is used as R15.
[Initial value]
--00XXXX
The flag is cleared to 0 by resetting.
To execute the RETI instruction, select SSP.
[Bit 4] Interrupt enable flag
Allows or prohibits user interrupt requests.
ValueContent
0Disables user interrupts. The flag is cleared to 0 when an INT instruction is
executed.
However, the value to be saved on the stack is the value before clearing.
1Enables user interrupts.
Masking of user interrupt requests is controlled by the value stored in the ILM.
The flag is cleared to 0 by resetting.
38
Page 55
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
[Bit 3] Negative flag
Indicates the sign when the arithmetic operation result is assumed to be an integer
represented in twos-complement form.
ValueContent
0Indicates that the result of an arithmetic operation was a positive value.
1Indicates that the result of an arithmetic operation was a negative value.
The initial value after resetting is undefined.
[Bit 2] Zero flag
Indicates whether the result of an arithmetic operation is 0.
ValueContent
0Indicates that the result of an arithmetic operation is not 0.
1Indicates that the result of an arithmetic operation is 0.
The initial value after resetting is undefined.
[Bit 1] Overflow flag
Indicates whether an overflow occurred as a result of an arithmetic operation, assuming that
the operand for the arithmetic operation is represented in twos-complement form.
ValueContent
0Indicates that no overflow occurred as the result of an arithmetic operation.
1Indicates that an overflow occurred as the result of an arithmetic operation.
The initial value after resetting is undefined.
[Bit 0] Carry flag
Indicates whether a carry or borrow from the highest bit occurred during operation.
ValueContent
0Indicates that neither a carry nor borrow occurred.
1Indicates that a carry or borrow occurred.
The initial value after resetting is undefined.
❍ System condition code register (SCR)
The system condition code register (SCR) is configured as follows:
1098
D1D0XX0
SCR
[Initial value]
39
Page 56
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
[Bits 10 and 9] Step division flag
Stores intermediate data when executing step division. The flag must not be changed during
the division operation.
When another operation is performed while step division is being executed, the restart of the
step division operation is assured by saving and restoring the value of the PS register. The
initial status after resetting is undefined.
This flag is set after referencing a divisor and dividend when a DIV0S instruction is executed.
This flag is forcibly cleared by the DIV0U instruction.
[Bit 8] Step trace trap flag
Specifies whether to make the step trace trap instruction effective.
ValueContent
0Disables the step trace trap instruction.
1Makes the step trace trap instruction effective. In this case, all user NMIs and
user interrupts are disabled.
This flag is initialized to 0 by resetting. The emulator uses the step trace trap function. When
the emulator is used, the step trace trap function cannot be used in a user program.
❍ ILM
2019181716
ILM4 ILM3 ILM2 ILM1 ILM001111
ILM
[Initial value]
This register stores an interrupt level mask value that is used for level masking.
An interrupt request to be input to the CPU is accepted only when the associated interrupt level
is higher than the level indicated by this ILM. The highest level value is 0 (00000
lowest level value is 31 (11111
).
B
) and the
B
Restrictions apply to the value that can be set from programs. If the original values are 16 to 31,
the values that can be set as new ones are 16 to 31. When an instruction that sets 0 to 15 is
executed, the value that is transferred is the result of adding 16 to the specified value. If the
original values are 0 to 16, any value from 0 to 31 can be set.
The register value is initialized to 15 (01111
) by resetting.
B
40
Page 57
■ Program counter (PC)
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
This register indicates the address of the instruction being executed. Bit 0 is set to 0 when
updating the PC during instruction execution.
Bit 0 may be set to 1 only when an odd address is specified as a branch destination address.
However, bit 0 is invalid in this case, and the instruction must be placed at an address that is a
multiple of 2.
The initial value at reset is undefined.
■ Table base register (TBR)
This register stores the starting address of the vector table used for EIT processing. The initial
value at reset is 000FFC00
■ Return pointer (RP)
310
PC
PC
310
TBR
TBR
.
H
[Initial value]
XXXXXXX
[Initial value]
000FFC00
H
H
310
RP
RP
[Initial value]
XXXXXXXX
H
This register stores the address for return from a subroutine. When the CALL instruction is
executed, a PC value is transferred to this register. When the RET instruction is executed, the
content of the RP is transferred to the PC.
The initial value at reset is undefined.
41
Page 58
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ System stack pointer (SSP)
The SSP is a system stack pointer.
When the S flag is 0, this register functions as R15. The SSP can be explicitly specified.
At EIT generation, this register is also used for the stack pointer specifying the stack for saving
the values of the PS and PC.
The initial value at reset is 00000000
■ User stack pointer (USP)
The USP is a user stack pointer. When the S flag is 1, this register functions as R15. The USP
can be explicitly specified.
The initial value at reset is undefined.
To use the RETI instruction, use the SSP.
310
SSP
SSP
.
H
310
USP
USP
[Initial value]
00000000
[Initial value]
XXXXXXXX
H
H
■ Multiplication and division result registers (MDH and MDL)
310
MDH
MDL
Multiplication or division result register
These registers are used for multiplication and division. Each of them is 32 bits long. Their initial
values at reset are undefined.
❍ For multiplication
For a multiplication of 32 bits x 32 bits, the arithmetic operation result of a 64-bit length is stored
in the multiplication and division result storage registers as follows:
•MDH: Higher 32 bits
•MDL: Lower 32 bits
For a multiplication of 16 bits x 16 bits, the result is stored as follows:
•MDH: Undefined
•MDL: Result of 32 bits
[Initial value]
XXXXXXXX
XXXXXXXX
H
H
42
Page 59
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
❍ For division
At the start of the operation, the dividend is stored in the MDL.
When a division is performed by executing the DIV0S, DIV0U, DIV1, DIV2, DIV3, and DIV4
instructions, the result is stored in the MDL and MDH.
•MDH: Remainder
•MDL: Quotient
43
Page 60
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.4Data Structure
The following data structures are used in the FR series:
•Bit ordering: Little endian
•Byte ordering: Big endian
■ Bit ordering
FR uses little-endian bit ordering.
Figure 3.4-1 "Bit configuration of data items according to bit ordering" shows the bit
configuration of data items according to the specified bit ordering.
Figure 3.4-1 Bit configuration of data Items according to bit ordering
Figure 3.4-2 "Byte configuration according to byte ordering" shows the byte configuration of data
items according to byte ordering.
Address n
Address (n + 1)
Address (n + 2)
Address (n + 3)
Figure 3.4-2 Byte configuration according to byte ordering
MSBLSB
bit 31231570
Memory
bit
70
10101010
11001100
11111111
00010001
10101010 11001100 11111111 00010001
44
Page 61
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.5Word Alignment
Instructions and data are accessed in units of bytes. The address structure depends
on the instruction length and data length.
■ Program access
An FR program must be located at an address that is a multiple of 2. Bit 0 of the PC is set to 0
when the PC is updated during instruction execution. Bit 0 of the PC may be set to 1 only when
an odd address is specified as a branch destination address. However, bit 0 is invalid in this
case, and the instruction must be placed at an even address.
There is exception allowing odd addresses.
■ Data access
For data access, the FR series performs the following forcible alignment of addresses in
accordance with the bandwidth for data access:
Word access: Addresses are a multiple of 4 (the lower two bits are forcibly set to 00.)
Half word access: Addresses are a multiple of 2 (the lowest bit is forcibly set to 0.)
Byte access: -
At word or half word data access, some bits are forcibly set to 0 for calculating the effective
address. For example, in the addressing mode of @ (R13, Ri), the register value before addition
is used for calculation (even if the LSB is 1) and the lower bits of the addition result are masked.
[Example] LD @ (R13, R2), R0
R13 00002222H
R2 00000003
+ )
Addition result
Address pin00002224
00002225
H
H
Lower two bits forcibly masked
H
45
Page 62
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.6Special Memory Areas
This section shows a memory map of the MB91150.
■ Special memory areas
The address space for special memory areas is a 32-bit linear space.
Figure 3.6-1 "MB91150 memory map" shows a memory map of the MB91150.
Figure 3.6-1 MB91150 memory map
0000 0000
0000 0100
0000 0200
0000 0400
000F FC00
000F FFFF
FFFF FFFF
H
Byte data
H
Halfword data
H
Word data
H
H
Vector table initialization area
H
H
Direct addressing area
❍ Direct addressing area
The following area of the address space is an I/O area. This area enables an operand address
to be directly specified in an instruction by direct addressing.
The size of the address area for which direct addressing is possible differs for each data length.
•Byte data (8 bits): 0 to 0FF
H
46
•Half word data (16 bits): 0 to 1FF
•Word data (32 bits): 0 to 3FF
H
H
❍ Vector table initialization area
The area of 000FFC00
to 000FFFFFH is an EIT vector table initialization area.
H
The vector table used for EIT processing can be located at any address by rewriting the
contents of the TBR. However, it is located at this address after initialization by reset.
Page 63
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.7Overview of Instructions
In addition to the general RISC instruction system, the FR series supports logical
operation instructions and bit operation instructions that were optimized for insertion,
and direct addressing instructions. Each instruction is at least 16 bits long (some
instructions are 32 or 48 bits long), which makes for excellent memory use efficiency.
The instruction sets can be divided into the following functional groups:
•Arithmetic operation
•Load and store
•Branch
•Logical operation and bit operation
•Direct addressing
•Others
■ Overview of Instructions
❍ Arithmetic operation
This functional group includes the standard arithmetic operation instructions (addition,
subtraction, and comparison) and shift instructions (logical shift and arithmetic operation shift).
The operations for addition and subtraction that are supported include
multi-word length operations with carry-over, and operations in which flag values that are used
to support address calculation remain unchanged.
In addition, multiplication instructions of 32 bits x 32 bits and of 16 bits x 16 bits and the step
division instruction of 32 bits divided by 32 bits are provided.
The immediate data transfer instructions for setting immediate data in registers and the registerto-register transfer instructions are also provided.
The arithmetic operation instructions can use all of the general-purpose registers and
multiplication and division registers in the CPU.
❍ Load and store
The load and store instructions are used for read and write-accesses to external memory. They
are also used for read and write-accesses to the peripheral circuit (I/O) on the chip.
The load and store instructions support three types of access lengths: byte, half word and word.
In addition to direct memory addressing between general registers, some instructions support
register indirect memory addressing with displacement or with register increment and
decrement.
❍ Branch
This functional group includes branch, call, interrupt, and return instructions. Some branch
instructions have delay slots and others do not, which allows optimization in accordance with
usage.
The branch instructions are detailed later.
47
Page 64
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
❍ Logical operation and bit operation
The logical operation instructions can perform the logical operations AND, OR, and EOR
between general-purpose registers and between a general-purpose register and memory (and I/
O). The bit operation instructions can directly change the contents of the memory (and I/O).
General register indirect memory addressing is supported.
❍ Direct addressing
The direct addressing instructions are used for accesses between I/O and general-purpose
registers and between I/O and memory. High-speed and high-efficiency accesses can be
implemented by directly specifying an I/O address in an instruction, not by using register indirect
memory addressing. Some instructions support register indirect memory addressing with
register increment and decrement.
❍ Others
The following other instructions are supported: Instructions for setting flags in the PS register,
instructions for stack operations, instructions for sign and zero expansion, instructions for
function entry and exit that support high-level languages, and instructions for register multiload
and multistore.
48
Page 65
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.7.1Operations with Delay Slots
During operations with delay slots, a branch occurs at an instruction immediately after
a branch instruction (called a delay slot) before the branch destination instruction is
executed.
■ Branch instructions with delay slots
The following branch instructions with delay slots are provided:
■ Explanation of the operation of branch instructions with delay slots
During operation with delay slots, a branch occurs after an instruction immediately after the
branch instruction (called a delay slot) is executed before a branch destination instruction is
executed.
A delay slot instruction is executed before the branch operation. Consequently, the execution
speed appears to be one cycle. If an effective instruction cannot be placed in a delay slot, the
NOP instruction must be placed instead.
[Example]
; Instruction list
ADD R1, R2 ;
BRA:D LABEL ; Branch instruction
MOV R2, R3 ; Delay slot: Executed before a branch.
...
LABEL : STR3, @R4 ; Branch destination
In a conditional branch instruction, an instruction placed in a delay slot is executed regardless of
whether a branch condition is met.
For the delayed branch instruction, the execution order of some instructions appears to be
reversed. However, this appearance of reversal applies only for the PC update operation. In
other operations (register update and reference, etc.), the instructions are executed in the
specified order.
A specific example is given below.
49
Page 66
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
❍ Ri to be referenced by the JMP:D @Ri or CALL:D @Ri instruction is not affected even if an
instruction in a delayed slot updates Ri.
[Example]
LDI:32 #Label, R0
JMP:D @R0 ; Branch to Label
LDI:8 #0, R0 ; No effect on the branch destination address
...
❍ RP to be referenced by the RET:D instruction. The RET:D instruction is not affected even if
an instruction in a delayed slot updates the RP.
[Example]
RET:D ; Branch to the address indicated by the previous
value of the RP
MOV R8, RP ; No effect on the return operation
...
❍ The flag to be referenced by the Bcc: The D rel instruction is not affected by a delayed slot
instruction.
[Example]
ADD #1, R0 ; Flag change
BC:D Overflow ; Branch is made in accordance with the
execution result of the above instruction.
ANDCCR #0 ; The above branch instruction does not
reference this flag update.
...
❍ When an instruction in the delayed slot of the CALL:D instruction references the RP, the
content updated by the CALL:D instruction is read.
[Example]
CALL:D Label ; Branch after RP is updated
MOV RP, R0 ; Transfer of RP as an execution result of the above
CALL:D
...
50
Page 67
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ Restrictions on branch instructions with delay slots
❍ Instructions that can be placed in delay slots
Only instructions that satisfy the following conditions can be executed in delay slots:
•One-cycle instructions
•Instructions other than branch instructions
•Instructions that do not affect the operation although the execution order changes
A one-cycle instruction is indicated by writing 1, a, b, c, or d in the cycle count column of the
instruction list.
❍ Step trace trap
No step trace trap occurs between the execution of a branch instruction with the delay slot and
the delay slot.
❍ Interrupt and NMI
An interrupt and NMI are not accepted between the execution of a branch instruction with the
delay slot and the delay slot.
❍ Undefined instruction execution
No undefined instruction exception occurs if an undefined instruction exists in the delay slot. In
this case, the undefined instruction operates as the NOP instruction.
51
Page 68
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.7.2Branch Instructions without a Delay Slot
During operation without a delay slot, the instructions are executed in the order of the
instruction list.
■ Branch instructions without a delay slot
The following branch instructions without a delay slot are supported:
JMP @Ri CALL label12 CALL @Ri RET
BRA label9 BNO label9 BEQ label9 BNE label9
BC label9 BNC label9 BN label9 BP label9
BV label9 BNV label9 BLT label9 BGE label9
BLE label9 BGT label9 BLS label9 BHI label9
■ Explanation of operation for branch instructions without a delay slot
During operation without a delay slot, the instructions are executed in the order of the instruction
list. The succeeding instruction is not executed before a branch.
The execution cycle count of an instruction without a delay slot is two cycles for an instruction
with a branch and one cycle for an instruction without a branch. This increases the instruction
code efficiency as compared with branch instructions with a delay slot for which NOP was
specified because an appropriate instruction could not be entered in the delay slot. When an
effective instruction can be placed in the delay slot, the operation with a delay slot is selected. If
not, the operation without a delay slot is selected. This enables improvements with respect to
both execution speed and code efficiency.
52
Page 69
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.8EIT (Exception, Interrupt, and Trap)
EIT indicates that a program being executed is suspended by an event for the purpose
of executing another program. EIT is the generic name for exception, interrupt, and
trap.
■ Notes on EIT
❍ Exception
An exception is an event that is thrown in accordance with the context of program execution.
Execution resumes later, starting at the instruction that caused the exception.
❍ Interrupt
An interrupt is an event that is thrown by hardware with no relationship to the context of the
program execution.
❍ Trap
A trap is an event that is thrown in accordance with the context of the program execution. As
with system calls, some traps are instructed by the program. Execution resumes, beginning
from the instruction following the instruction that caused the trap.
EIT restrictions apply to the delay slots of branch instructions.
For more information, see Section 3.7.1 "Operations with Delay Slots".
53
Page 70
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.8.1Interrupt Level
The interrupt levels are 0 to 31 and are controlled with five bits.
■ Interrupt level
Table 3.8-1 "Interrupt level" shows the assignment of each interrupt level.
Table 3.8-1 Interrupt level
Interrupt level-
Binary
number
000000-
000011-
000102-
000113-
001004
00101 to
01110
0111115(System-reserved: NMI)-
10000 to
11110
1111131-
Operation is possible for levels 16 to 31.
Undefined instruction exceptions, coprocessor absence traps, coprocessor error traps, and INT
instructions are not affected by the interrupt levels. The level does not change the ILM, either.
Decimal
number
INTE instruction, step trace
trap
5 to 14(System-reserved)
16 to 30Interrupt
--
When the original value of the
ILM is 16 to 31, the values in
this range cannot be set in the
ILM with a program.
User interrupt is disabled while
making the ILM settings.
Interrupt is disabled while
making the ICR settings.
■ Level mask for interrupts
If an interrupt request occurs, the interrupt level of the interrupt source is compared with the
level mask value stored in the ILM. When the following condition is met, the interrupt request is
masked and is not accepted:
Interrupt level of the source greater than or equal to level mask value
54
Page 71
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.8.2Interrupt Stack Operation
This area is indicated by the system stack pointer (SSP). PC and PS values are saved
in, or restored from this area.
After an interrupt, the PC is stored at the address indicated by the SSP and the PS is
stored at the address of (SSP + 4).
■ Interrupt stack
Figure 3.8-1 "Interrupt stack operation" gives an example of using of the interrupt stack.
Figure 3.8-1 Interrupt stack operation
[Example][Example][Before the interrupt][After the interrupt]
The table base register (TBR) indicates the first address of the EIT vector table.
The vector area for EIT is a 1-KB area starting at the address indicated by the table
base register (TBR).
■ EIT vector table
The size per vector is four bytes. The relationship between a vector number and vector address
can be expressed as follows:
vctadr = TBR + vctofs = TBR + (03FC
vctadr: Vector address
vctofs: Vector offset
vct: Vector number
The lower two bits of the addition result are always handled as 00.
The area of 000FFC00
vectors are assigned special functions. Table 3.8-2 "Vector table" shows the vector table for the
architecture.
to 000FFFFFH is the initial area of the vector table for reset. Some
H
- 4 x vct)
H
56
Page 73
Table 3.8-2 Vector table
Vector No.Vector addressExplanation
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
000
101
H
H
000FFFFC
TBR + 03F8
202HTBR + 03F4
303
404
H
H
TBR + 03F0
TBR + 03EC
505HTBR + 03E8
606
707
H
H
TBR + 03E4
TBR + 03E0
808HTBR + 03DC
909
100A
110B
120C
130D
140E
H
H
H
H
H
H
TBR + 03D8
TBR + 03D4
TBR + 03D0
TBR + 03CC
TBR + 03C8
TBR + 03C4
H
H
H
H
H
H
H
H
H
H
H
H
H
H
H
Reset
System-reserved
System-reserved
System-reserved
System-reserved
System-reserved
System-reserved
Coprocessor absence trap
Coprocessor error trap
INTE instruction
Instruction break exception
Operand break trap
Step trace trap
System-reserved NMI (for emulator)
Undefined instruction exception
150F
1610
17 to 6311
6440
6541
66 to 25542
to 3F
H
to FF
H
H
H
H
H
H
H
TBR + 03C0
TBR + 03BC
TBR + 03B8
to
TBR + 0300
TBR + 02FC
TBR + 02F8
TBR + 02F4
to
TBR + 0000
H
H
H
H
H
H
H
H
System-reserved (NMI)
Interrupt source that can be masked #0 (IRQ0)
Interrupt source that can be masked #1 (IRQ2)
to
Interrupt source that can be masked #47 (IRQ47)
System-reserved (used for REALOS)
System-reserved (used for REALOS)
INT instruction
57
Page 74
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.8.4Multiple EIT Processing
If two or more EIT sources occur at the same time, the CPU selects and accepts one
EIT source. After executing the EIT sequence, the CPU repeats monitoring for EIT
sources.
If no acceptable EIT source can be found at EIT source detection, the CPU executes
the instruction of the handler for the EIT source it accepted last.
Therefore, if two or more EIT sources occur at the same time, the handler execution
order of the sources depends on the following two elements:
•EIT source acceptance priority
•How other sources were masked when the source was accepted
■ EIT source acceptance priority
EIT source acceptance priority means the order in which a source for EIT sequence execution is
selected after the PS and PC are saved, the PC updated as necessary, and other sources
masked. The handler of the source previously accepted is not always executed first.
Table 3.8-3 "EIT source acceptance priority and masking of other sources" shows the EIT
source acceptance priority.
Table 3.8-3 EIT source acceptance priority and masking of other sources
Acceptance
priority
1ResetOther sources are discarded.
2Undefined instruction exceptionCanceled
INT instructionI flag = 0
3
4User interruptILM = level of the accepted source
5(NMI)ILM=15
7INTE instructionILM=4
8Step trace trapILM=4
Table 3.8-4 "EIT handler execution order" shows the execution order of the handlers for the
concurrent EIT sources, considering the mask processing for other EIT sources after an EIT
source is accepted.
Coprocessor absence trap
Coprocessor error trap
SourceMasking for other sources
None
58
Page 75
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
Table 3.8-4 EIT handler execution order
Handler execution orderSource
1Reset
*1
2Undefined instruction exception
3Step trace trap
4INTE instruction
*2
*2
5(NMI)
6INT instruction
7User interrupt
8
Coprocessor absence trap
Coprocessor error trap
*1: The other sources are discarded.
*2: If the INTE instruction is subject to step execution, only the EIT for the step trace trap
occurs.
Sources caused by INTE are ignored.
Figure 3.8-2 "Example for multiple EIT processing" gives an example for multiple EIT
processing.
Figure 3.8-2 Example for multiple EIT processing
Main routine
NMI handler
Priority
INT instruction
(High) NMI generation
(Low) INT instruction
execution
handler
(1) Executed first
(2) Executed next
59
Page 76
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.8.5EIT Operation
This section describes EIT operation.
Assume that the PC of the transfer source in the explanation below indicates the
address of the instruction for which an EIT source was detected.
"Address of the next instruction" means that the instruction for which EIT was
detected satisfies the following conditions:
•LDI:32: PC + 6
•LDI:20, COPOP, COPLD, COPST, and COPSV: PC + 4
•Other instructions: PC + 2
■ User interrupt operation
If a user interrupt request occurs, the system determines whether the request can be accepted
in the following order:
❍ Determination of whether the interrupt request can be accepted
1. The interrupt levels of concurrent requests are compared with each other. The request with
the highest level (smallest value) is selected. For an interrupt that can be masked, the value
stored by the associated ICR is used as the level for comparison.
2. If two or more interrupt requests with the same level occur, the interrupt request having the
smallest number is selected.
3. The interrupt level of the selected interrupt request is compared with the level mask value
determined by the ILM.
•In case the interrupt level is equal to or greater than the level mask value, the interrupt
request is masked and is not accepted.
•If the interrupt level is smaller than the level mask value, the system proceeds with step 4.
4. When the selected interrupt request can be masked and the I flag is 0, the interrupt request
is masked and is not accepted.
•If the I flag is 1, the system proceeds with step 5.
5. When the above condition is met, the interrupt request is accepted at a pause of instruction
processing.
❍ Operation
When a user interrupt request is accepted at EIT request detection, the CPU operates as shown
below while using the interrupt number associated with the accepted interrupt request.
60
The items in parentheses in 1. to 7. below show the address indicated by the register.
1. SSP-4 --> SSP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. Address of the next instruction --> (SSP)
5. Interrupt level of the accepted request --> ILM
Page 77
6. 0 --> S flag
7. (TBR + vector offset of the accepted interrupt request) --> PC
At the end of the interrupt sequence, the CPU detects a new EIT before executing the first
instruction of the handler. If there is an acceptable EIT at this time, the CPU proceeds with the
EIT processing sequence.
■ Operation for INT instruction
The INT #u8 instruction operates as follows:
Control branches to the interrupt handler of the vector indicated by u8.
Each item in parentheses in 1. to 7. below shows the address indicated by the register.
❍ Operation
1. SSP-4 --> SSP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. PC + 2 --> (SSP)
5. 0 --> I flag
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
6. 0 --> S flag
7. (TBR + 3FCH - 4 x u8) --> PC
■ Operation for INTE instruction
The INTE instruction operates as follows:
Control branches to the interrupt handler of the vector with vector number 9.
Each item in parentheses in 1. to 7. below shows the address indicated by the register.
❍ 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 + 3D8H) --> PC
Do not use the INTE instruction within another INTE instruction or in the step trace trap
processing routine.
No EIT is generated by INTE during step execution.
61
Page 78
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ Operation for step trace trap
If the T flag in SCR of the PS is set and the step trace function is enabled, a trap occurs and a
break in processing occurs each time one instruction is executed.
❍ The conditions for detecting a step trace trap are as follows:
1. T flag = 1
2. The instruction in execution is not a delayed branch instruction
3. An operation other than execution of the INTE instruction or the step trace trap processing
routine is being executed.
4. When the above conditions are met, a processing break occurs at a pause in operation for
the instruction.
❍ Operation
Each item in parentheses in 1. to 7. below shows the address indicated by the register.
1. SSP-4 --> SSP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. Address of the next instruction --> (SSP)
5. 00100 --> (SSP)
6. 0 --> S flag
7. (TBR + 3CCH) --> PC
When the T flag is set and the step trace trap is enabled, both user NMI and user interrupt are
disabled.
No EIT is generated by the INTE instruction in this case.
■ Operation for an undefined instruction exception
If an undefined instruction is detected at instruction decoding, an undefined instruction
exception occurs.
❍ The conditions for detecting the undefined instruction exception are as follows:
1. An undefined instruction is detected at instruction decoding.
2. The instruction is located outside the delay slot (not immediately after the delayed branch
instruction).
3. When the above conditions are met, an undefined instruction exception occurs, causing a
break.
❍ Operation
62
Each item in parentheses in 1. to 6. below shows the address indicated by the register.
1. SSP-4 --> SSP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. PC --> (SSP)
5. 0 --> S flag
6. (TBR + 3C4H) --> PC
Page 79
The address of the instruction that detected the undefined instruction exception is saved in the
PC.
■ Coprocessor absence trap
If there is an attempt to execute a coprocessor instruction for a coprocessor that is not mounted,
a coprocessor absence trap occurs.
❍ Operation
Each item in parentheses in 1. to 6. below shows the address indicated by the register.
1. SSP-4 --> SP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. Address of the next instruction --> (SSP)
5. 0 --> S flag
6. (TBR + 3E0H) --> PC
■ Coprocessor error trap
Assume that an error occurred while the coprocessor was used. When a coprocessor instruction
using that coprocessor is executed next, a coprocessor error trap occurs.
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
Note:
The MB91150 is not equipped with a coprocessor.
❍ Operation
Each item in parentheses in 1. to 6. below shows the address indicated by the register.
1. SSP-4 --> SP
2. PS --> (SSP)
3. SSP-4 --> SSP
4. Address of the next instruction --> (SSP)
5. 0 --> S flag
6. (TBR + 3DCH) --> PC
■ Operation for RETI instruction
The RETI instruction returns from the EIT processing routine.
❍ Operation
Each item in parentheses in 1. to 4. below shows the address indicated by the register.
1. (R15) --> PC
2. R15 + 4 --> R15
3. (R15) --> PS
4. R15 + 4 --> R15
Note that the stack pointer to be referenced for resetting the PS and PC is selected in
accordance with the content of the S flag. To execute the instruction that manipulates R15
(stack pointer) in the interrupt handler, set the S flag to 1 to use the USP as R15. In this case,
be sure to return the S flag to 0 before executing the RETI instruction.
63
Page 80
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.9Reset Sequence
This section describes the reset operation for placing the CPU in operation status.
■ Reset sources
The causes for reset are as follows:
•Input from an external reset pin
•Software reset by the SRST bit operation of the standby control register (STCR)
•Count-up of the watchdog timer
•Power-on reset
■ Initialization by reset
If a reset source occurs, the CPU is initialized.
❍ Releasing the reset source from an external reset pin or software reset
•Set the pin to the specified status.
•Set each resource in the device to reset status. The control register is initialized to the
•The slowest gear is selected as a clock.
■ Reset sequence
When a reset source is released, the CPU executes the following reset sequence:
(000FFFFC
Note:
predetermined value.
) --> PC
H
After reset, the operating mode must be set via the mode register.
64
Page 81
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.10Operation Mode
The FR Series controls the operation mode using the mode pins (MD2, 1, 0) and mode
register (MODR).
■ Operation mode
Two operation modes, bus mode and access mode, are used.
Bus modeAccess mode
Single chip
Internal ROM external bus32-bit bus
16-bit bus
External ROM external bus8-bit bus
❍ Bus mode
In bus mode, the FR Series controls the operations of the internal ROM and external access
function. The mode setting pins (MD2, 1, 0) and the M1 and M0 bits of the mode register
(MODR) are used to specify the bus mode.
❍ Access mode
In access mode, the FR Series controls the width of the external data bus. The mode setting
pins (MD2, 1, 0) and BW1 and BW0 bits of AMD0, AMD1, AMD32, AMD4, and AMD5 address
mode registers are used to specify the access mode.
■ Mode pins
Three pins MD2, MD1, and MD0 are used to specify operation modes as shown in Table 3.10-1
"Mode pins used to set modes".
system runs in the mode specified by this register. Data can be written to the mode register only
once after resetting.
The setting in this register becomes effective immediately.
Initial value Access
MODR
: 0000 07FF
H
M1M0
******
Bus mode setting bits
XXXXXXXXW
[Bits 7, 6] M1, M0
These bits set the bus mode. Specify the bus mode to be used after mode register writing.
M1M0FunctionRemarks
00Single chip mode
01Internal ROM external bus mode
10External ROM external bus mode
11-This setting is not allowed
[Bits 5-0] *
These bits are reserved for the system.
Keep these bits set to 0.
❍ Notes on writing to MODR
Before writing to MODR, be sure to set AMD0-5 to decide the bus width of each Chip Select
(CS) area.
MODR has no bits for setting the bus width.
As for bus width, the value set for mode pins MD2 to MD0 is effective before MDR writing, and
the value set in BW1 and BW0 of AMD0-5 is effective after MODR writing.
For instance, an external reset vector is normally handled in Area 0 (in which CS0 is active) and
the bus width is determined by mode pins MD2 to MD0. Suppose MD2 to MD0 are set to
determine the bus width as 32 or 16 bits, while nothing is set in AMD0 (default bus width of 8
bits). If MODR is written under this condition, area 0 enters 8-bit bus mode, which results in a
malfunction.
To prevent this problem, always set AMD0-5 before writing to MODR.
66
MODR writing
RST (reset)
Bus width specification: MD2, 1, 0BW1, 0 of AMD0-5
The clock generator is a module for the following functions:
•CPU clock generation (this includes the gear function)
•Peripheral clock generation (this includes the gear function)
•Generating resets and storing sources
•Standby function
•Built-in PLL (gradual-double circuit)
■ Register configuration
Figure 3.11-1 "Registers of the clock generator" shows the registers of the clock generator.
Figure 3.11-1 Registers of the clock generator
Address
000480
000481
000482
000483
000484
000485
000488
70
H
H
H
H
H
H
H
RSRR/WTCR
STCR
PDRR
CTBR
GCR
WPR
PCTR
Reset source and watchdog cycle control register
Standby control register
DMA request suppression register
Time-base timer clear register
Gear control register
Watchdog reset generation delay register
PLL
67
Page 84
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
■ Block diagram of the clock generator
Figure 3.11-2 "Block diagram of the clock generator" shows the block diagram of the clock
generator.
Figure 3.11-2 Block diagram of the clock generator
[Gear control block]
GCR register
CPU gear
Peripheral
gear
X0
X1
Power-on detection circuit
Oscil-
lation
circuit
Internal interrupt
Internal reset
DMA request
V
CC
R
GND
RST pin
1/2
PLL
[Stop and sleep control block]
STCR register
PDRR register
[Reset source circuit]
RSRR register
[Watchdog control block]
Status
transition
control circuit
Internal clock
generation
circuit
generation
CPU Clock
Internal bus clock
Internal peripheral clock
STOP status
SLEEP status
CPU hold request
Reset
Internal reset
F/F
68
WPR register
Watchdog F/F
Count clock
CTBR register
Time-base timer
Page 85
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.1Reset Source Register (RSRR) and Watchdog Cycle
Control Register (WTCR)
The reset source register (RSRR) is used to store the type of the generated reset. The
watchdog cycle control register (WTCR) is used to specify the cycle of the watchdog
timer.
■ Reset source register (RSRR) and watchdog cycle control register (WTCR)
The reset source register (RSRR) and watchdog cycle control register (WTCR) are configured
as follows:
76543210
RSRR/WTCRPONRWDOGERSTSRSTWT1WT01-XX X-00
000480H( R )()( R )( R )( R )( )(W)(W)
[Bit 7]: PONR
If this bit is 1, the last reset was a power-on reset, and bits other than this bit are invalid.
[Bit 6]: (Reserved)
This bit is a reserved bit. Its value during read accesses is undefined.
[Bit 5]: WDOG
If this bit is 1, the last reset was a watchdog reset.
[Bit 4]: ERST
If this bit is 1, the last reset was caused by the external reset pin.
[Bit 3]: SRST
If this bit is 1, the last reset was caused by a software reset request.
[Bit 2]: (Reserved) LRST: not implemented on the MB91100 series
This bit is reserved. Its value during read accesses is undefined.
[Bits 1 and 0]: WT1 and WT0
Initial value after
power-on
B
These bits specify the watchdog cycle. The relationship between these bits and the cycle to
be selected is shown below. These bits are initialized by all resets.
69
Page 86
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
Interval of writing to the
WT1WT0
required minimum WPR to
suppress watchdog reset
generation
00φ x 2
01φ x 2
10φ x 2
11φ x 2
15
17
19
21
-
[Initial value]φ x 215 to φ x 2
-φ x 217 to φ x 2
-φ x 219 to φ x 2
-φ x 221 to φ x 2
Time from writing the last
5AH to the WPR to
watchdog reset generation
16
18
20
22
However, for GCR CHC = 1, the cycle of φ is two cycles of X0. For GCR CHC = 0, it is one
cycle of X0.
70
Page 87
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.2Standby Control Register (STCR)
The standby control register (STCR) controls standby operation and specifies the
oscillation stabilization wait time.
■ Standby control register (STCR)
The register is configured as follows:
Initial value
STCRSTOPSLEPHIZXSRSTOSC1OSC0--0001 11--
000481( R/W)(R/W)(R/W)( W)(R/W)(R/W)( - )( - )
[Bit 7]: STOP
If this bit is set to 1, the stop status is entered to stop the internal peripheral clock, internal
CPU clock, and oscillation.
[Bit 6]: SLEP
If this bit is set to 1, the standby status is entered to stop the internal CPU clock. If both the
STOP bit and this bit are set to 1, the STOP bit is given priority and stop status is entered.
[Bit 5]: HIZX
If the stop status is entered while this bit is 1, the device pin is set to high impedance.
[Bit 4]: SRST
If this bit is set to 0, a software reset request is generated.
Its value during read access is undefined.
[Bits 3 and 2]: OSC1 and OSC0
These bits specify the oscillation stabilization wait time. The relationship between these bits
and the cycle to be selected is shown below. These bits are initialized by power-on reset,
and are not affected by other reset sources.
OSC1OSC0Oscillation stabilization wait time
3
00φ x 2
01φ x 2
10φ x 2
11φ x 213 [Initial value]
80msx2x8
16
18
However, for GCR CHC = 1, the cycle of φ is two cycles of X0. For GCR CHC = 0, it is one
cycle of X0.
[Bits 1 and 0]: (Reserved)
This bit is reserved. Its value during read accesses is undefined.
71
Page 88
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.3Time-base Timer Clear Register (CTBR)
This register is used to initialize the time-base timer to 0.
■ Time-base timer clear register (CTBR)
The register is configured as follows:
CTBRD7D6D5D4D3D2D1D0XXXX XXXX
000483( W )( W )( W )( W )( W )( W )( W )( W )
[Bits 07 to 00]
If A5H and 5AH are consecutively written to this register, the time-base timer is set to 0
immediately after 5AH was written. The value of this register during read accesses is
undefined. There are no restrictions with respect to the time between writing A5H and 5AH.
Initial value
Note:
If the time-base timer is cleared by using this register, the oscillation stabilization wait interval
and watchdog cycle change temporarily.
72
Page 89
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.4Gear Control Register (GCR)
This register controls the gear function of the CPU and peripheral system clocks.
■ Gear control register (GCR)
The register is configured as follows:
Initial value
GCRCCK1CCK0 DBLAK DBLONPCK1PCK0-CHC110011-1
000484( R/W)(R/W )( R )( R/W )(R/W)(R/W)( - )( R/W)
❍ [Bits 7 and 6]: CCK1 and CCK0
These bits specify the CPU system gear cycle. The relationship between these bits and the
cycle to be selected is shown below. These bits are initialized at reset.
CCK1CCK0CHC
000PLL x 1
010PLL x 1/2
100PLL x 1/4
110PLL x 1/8
001Oscillation x 1/2
011Oscillation x 1/2 x 1/2
101Oscillation x 1/2 x 1/4
111Oscillation x 1/2 x 1/8 [Initial value]
❍ [Bit 5] DBLAK
This bit indicates a clock doubler operation status. This bit is read-only, and attempts to access
it for writing are ignored. The bit is initialized at reset.
A time lag occurs when switching the bus frequency. However, this bit allows checking whether
switching was actually performed.
DBLAKInternal operating frequency: same as external operating frequency
CPU machine clock (oscillation: input frequency
from X0)
0Operating in 1:1 relationship [Initial value]
1Operating in 2:1 relationship
73
Page 90
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
❍ [Bit 4] DBLON
This bit specifies the operation status of the clock doubler. It is initialized at reset.
DBLONInternal operating frequency: same as external operating frequency
0Operating in 1:1 relationship [Initial value]
1Operating in 2:1 relationship
[Bits 3 and 2]: PCK1 and PCK0
These bits specify the peripheral system gear cycle. The relationship between these bits and
the cycle to be selected is shown below. These bits are initialized at reset.
PCK1PCK0CHC
000PLL x 1
010PLL x 1/2
100PLL x 1/4
110PLL x 1/8
001Oscillation x 1/2
011Oscillation x 1/2 x 1/2
101Oscillation x 1/2 x 1/4
111Oscillation x 1/2 x 1/8 [Initial value]
[Bit 0]: CHC
This bit specifies the divided-by-2 system or PLL system of the oscillation circuit as the basic
clock.
Setting this bit to 1 specifies the divided-by-2 system. Setting this bit to 0 specifies the PLL
system.
The watchdog reset generation delay register is used for clearing the watchdog timer
flip-flop. It can delay the watchdog reset generation.
■ Watchdog reset generation delay register (WPR)
The register is configured as follows:
Initial value
WPRD7D6D5D4D3D2D1D0XXXX XXXX
000485
H
[Bits 7 to 0]
(W) (W) (W)(W) (W) (W)(W) (W)
When A5
set to 0 immediately after 5A
and 5AH are consecutively written to this register, the watchdog timer flip-flop is
H
in order to delay watchdog reset generation.
H
The value of this register during read accesses is undefined. The time between A5H and 5A
is not restricted. However, if neither of these values is written within the period listed in the
table below, a watchdog reset occurs.
WT1WT0
00φ x 2
01φ x 2
10φ x 2
11φ x 2
Minimum interval required
for writing to WPR to
suppress watchdog reset
generation
15
17
19
21
Time from the last time 5AH was
written to the WPR to watchdog
reset generation
φ x 2
φ x 2
φ x 2
φ x 2
15
to φ x 2
17
to φ x 2
19
to φ x 2
21
to φ x 2
16
18
20
22
However, for GCR CHC = 1, the cycle of φ is two cycles of X0. For GCR CHC = 0, it is a one
cycle of PLL.
H
75
Page 92
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.6DMA Request Suppression Register (PDRR)
The DMA request suppression register temporarily suppresses a DMA request so as to
enable CPU operation.
If these bits are set to a value other than 0, DMA transfer from subsequent DMAs to the CPU
is suppressed. Afterwards, DMA can be used only when these bits are set to 0.
Note:
Do not use the PDRR register alone. Be sure to use it together with HRCL.
----
D3D2D1D0——0000
Initial value
76
Page 93
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.7PLL Control Register (PCTR)
The PLL control register controls PLL oscillations.
The setting of this register can be changed only when GCR CHC is 1.
■ PLL control register (PCTR)
The PLL control register (PCTR) has the following configuration:
15141312111098
PCTRSLCT1SLCT0--VSTP---00XX0XXX
000488(R/W)(R/W)(R/W)
[Bits 15 and 14]: SLCT1 and SLCT0
These bits control the Multiply ratio of the PLL. They are initialized only at power-on.
The setting of these bits indicates the internal operating frequency when GCR CHC is set to
0.
SLCT1SLCT0Internal operating frequency (oscillation: 16.5 MHz)
008.25-MHz operation [Initial value]
0116.5-MHz operation
1X33.0-MHz operation
[Bits 13, 12, and 10-8]: Reserved
Always set these bits to 0. Their values during read access are undefined.
[Bit 11]: VSTP
This bit controls the PLL oscillation. It is initialized at power-on or an external reset.
If PLL is used in stopped state, it must be stopped every time the reset is canceled.
( - )( - )( - )( - )( - )
Initial value
VSTPPLL operation
0Oscillation [Initial value]
1Stop of oscillation
Note:
When the stop mode is entered, the PLL stops regardless of the setting of this bit.
77
Page 94
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.8Watchdog Function
The watchdog function can detect a "program crashed" status. Assume that A5H and
5AH could not be written to the watchdog reset delay register within the given time due
to a program crash. In this case, the watchdog timer generates a watchdog reset
request.
■ Diagram of the watchdog function
Figure 3.11-3 "Block diagram of the watchdog control block" shows a diagram of the watchdog
function.
Figure 3.11-3 Block diagram of the watchdog control block
Time-base
timer
■ Activating the watchdog timer
The watchdog timer starts its operation when a value is written to the watchdog control register
(WTCR). The interval time of the watchdog timer is set with bits WT1 and WT0. Only the time
set in the first writing operation becomes valid as the interval time. Subsequent settings are
ignored.
Once the watchdog tim er is activated, the program must periodically write A5
watchdog reset delay register (WPR).
The watchdog reset flip-flop st ores the falli ng edge of the tap selec ted by the time-ba se timer. If
this flip-flop is not cleared at the second falling edge, a reset is generated.
Figure 3.11-4 "Watchdog timer operation" shows the timing of watchdog timer operation.
The following cause the watchdog timer to automatically delay generation of a reset:
1. Stop or sleep state
2. DMA transfer
3. A break occurs when the emulator debugger or the monitor debugger is being used.
4. The INTE instruction is executed.
5. Step trace trap (a break occurs at each instruction by specifying 1 for T in the PS register)
and 5AH to the
H
Notes:
•There is no rule for the writing interval between the first A5
•If a va lue other than 5A
■ Time-base timer
The time-base timer is used for su pplying clock pulses to the watchdog time r and for waiting for
oscillation stabilization. For GCR CHC = 1, the cycle of the operating clock φ is two cycles of X0.
For GCR CHC = 0, it is one cycle of X0.
1/211/221/23
and the next 5AH. The watchdog
H
reset can be d elayed only when th e interval between two i nstances of writin g 5A
the time specified by the WT bit and A5
instances of writing 5A
this case, A5
must be written again.
H
.
H
is written after the firs t A5H, the first A5H written is invalidated . In
H
is written at least once between these two
H
Figure 3.11-5 Time-base timer configuration
......
1/218 1/219 1/2
20
1/2
21
is within
H
79
Page 96
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.9Gear Function
The gear function allows the elimination of some clock pulses from clock signals. It
has two independent circuits: A CPU and a peripheral circuit. These circuits allow the
exchange of data between the CPU and peripherals even when the gear ratio is
different. This function allows also to specify whether to use the same clock cycle as
that of the oscillation circuit or that from the divided-by-2 circuit.
■ Block diagram of the gear control block
Figure 3.11-6 "Block diagram of the gear control block" shows a block diagram of the gear
control block.
Figure 3.11-6 Block diagram of the gear control block
CPU system gear interval
indication signal
Internal bus
X0
X1
Oscillation
circuit
CCK
PCK
CHC
1/2
(Gradually doubled)
PLL
CPU clock system
gear interval
generation circuit
Peripheral clock
system gear
interval generation
circuit
Selection
circuit
Peripheral system gear
interval specification signal
For the CPU clock control, the desired gear ratio can be set by setting the CCK1 and CCK0 bits
of the gear control register (GCR) to the desired values. For the peripheral clock control, the
desired gear ratio can be set by setting the PCK1 and PCK0 bits of that register to the desired
values.
When the CHC bit of the gear control register is set to 1, the output of the divided-by-2 circuit is
selected as the original clock. When it is set to 0, the same clock cycle as that from the
oscillation circuit is used.
To switch the original clock, the change with respect to the CPU and peripheral system is made
at the same time.
[Example]
Figure 3.11-7 "Timing for gear switching" shows the timing for gear switching.
Original clock
CPU clock (a)
CPU clock (b)
Peripheral clock (a)
Peripheral clock (b)
CHC
CCK value
PCK value
The system stores the last generated reset source. All related flags are set to 0 during
a read access.
A source flag that was set remains as long as it is not read.
■ Block diagram of the reset source retention circuit
Figure 3.11-8 "Block diagram of the reset source retention circuit" shows the block diagram of
the reset source retention circuit.
Figure 3.11-8 Block diagram of the reset source retention circuit
■ Setting
Power-on detection
RST pin
watch-dog Timer
reset detect Circuit
Reset input circuit
Status
transition
circuit
PONR
WDOG
ERST
SRST
decoder
.or.
PONR
WDOG
Internal bus
ERST
SRST
SRST
No special setting is required to use this function. Set the instruction for reading the reset source
register and the instruction for branching to an appropriate program at the beginning of the
program to be stored at the reset entry address.
[Example]
82
RESET-ENTRY
LDI:32 #RSRR,R10
LDI:8 #10000000B,R2
LDUB @R10,R1; GET RSRR VALUE INTO R1
MOV R1,R10; R10 USED AS A TEMPORARY REGISTER
AND R2,R10; WAS PONR RESET?
BNE PONR-RESET
LSR #1,R2; POINT NEXT BIT
MOV R1,R10; R10 USED AS A TEMPORARY REGISTER
AND R2,R10; WAS WATCH DOG RESET?
BNE WDOG-RESET
...
Page 99
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
Notes:
•If the PONR bit is 1, consider the other bits as being undefined. When a check of reset
sources is to be performed afterwards, be sure to place the instruction for confirming poweron reset at the beginning.
•Any reset source check other than a power-on reset check can be performed at any location.
The priority of the sources depends on the order in which the check was performed.
83
Page 100
CHAPTER 3 MEMORY SPACE, CPU AND CONTROL UNIT
3.11.11 Example of Setting the PLL Clock
This section gives an example of setting the PLL clock and also provides an example
of the related assembler source code.
■ Example of setting the PLL clock
Figure 3.11-9 "Example of setting the PLL clock" gives an example of the procedure for
switching to 33-MHz operation using the PLL.
Figure 3.11-9 Example of setting the PLL clock
CHC = 1
Ye s
DBLON = 1
Ye s
VSTP = 0
Ye s
No
CHC <-- 1
No
DBLON <-- 1
DBLACK = 1
Ye s
No
VSTP <-- 0
WAIT 300 s
Before making the PLL-related settings, be sure to
switch to the clock signal of the divided-by-2
system.
The gear is fixed to CPU = 1/1 by setting the
doubler to ON. The peripheral system can be set
arbitrarily.
(Note: If no external bus is used, the doubler need
not be used. In this case, the CPU gear can
arbitrarily be set as well.)
No
If the PLL stops, it restarts automatically. However,
for PLL restart, the software needs a stabilization
wait time of 300 s or more.
84
SLCTO <-- 1
CHC <-- 0
The output tap from the PLL is switched to 33 MHz.
The clock is switched from the divided-by-2 system
to the PLL system.
Notes:
•No particular setting order of the DBLON, VSTP, and SLCT1 bits shown here was specified
in the example.
•For a restart of PLL VC0, be sure to program a wait time of at least 300µs to ensure
stabilization.
Ensure that the wait time does not become insufficient by cache ON or OFF operations.
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.