Document No. U17763EE1V1UD00
Date Published September 2005
NEC Electronics 2005
Printed in Germany
Page 2
2
User’s Manual U17763EE1V1UD00
Page 3
NOTES FOR CMOS DEVICES
VOLTAGE APPLICATION WAVEFORM AT INPUT PIN
1
Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the
CMOS device stays in the area between V
malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed,
and also in the transition period when the input level passes through the area between V
IH (MIN).
V
HANDLING OF UNUSED INPUT PINS
2
Unconnected CMOS device inputs can be cause of malfunction. If an input pin is unconnected, it is
possible that an internal input level may be generated due to noise, etc., causing malfunction. CMOS
devices behave differently than Bipolar or NMOS devices. Input levels of CMOS devices must be fixed
high or low by using pull-up or pull-down circuitry. Each unused pin should be connected to V
via a resistor if there is a possibility that it will be an output pin. All handling related to unused pins must
be judged separately for each device and according to related specifications governing the device.
3
PRECAUTION AGAINST ESD
A strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as
much as possible, and quickly dissipate it when it has occurred. Environmental control must be
adequate. When it is dry, a humidifier should be used. It is recommended to avoid using insulators that
easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static
container, static shielding bag or conductive material. All test and measurement tools including work
benches and floors should be grounded. The operator should be grounded using a wrist strap.
Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken for
PW boards with mounted semiconductor devices.
IL (MAX) and VIH (MIN) due to noise, etc., the device may
IL (MAX) and
DD or GND
4
STATUS BEFORE INITIALIZATION
Power-on does not necessarily define the initial status of a MOS device. Immediately after the power
source is turned ON, devices with reset functions have not yet been initialized. Hence, power-on does
not guarantee output pin levels, I/O settings or contents of registers. A device is not initialized until the
reset signal is received. A reset operation must be executed immediately after power-on for devices
with reset functions.
5
POWER ON/OFF SEQUENCE
In the case of a device that uses different power supplies for the internal operation and external
interface, as a rule, switch on the external power supply after switching on the internal power supply.
When switching the power supply off, as a rule, switch off the external power supply and then the
internal power supply. Use of the reverse power on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degradation of internal
elements due to the passage of an abnormal current.
The correct power on/off sequence must be judged separately for each device and according to related
specifications governing the device.
INPUT OF SIGNAL DURING POWER OFF STATE
6
Do not input signals or an I/O pull-up power supply while the device is not powered. The current
injection that results from input of such a signal or I/O pull-up power supply may cause malfunction and
the abnormal current that passes in the device at this time may cause degradation of internal elements.
Input of signals during the power off state must be judged separately for each device and according to
related specifications governing the device.
User’s Manual U17763EE 1V 1UD00
3
Page 4
•
The information in this document is current as of September, 2005. The information is subject to
change without notice. For actual design-in, refer to the latest publications of NEC Electronics data
sheets or data books, etc., for the most up-to-date specifications of NEC Electronics products. Not
all products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
No part of this document may be copied or reproduced in any form or by any means without the prior
•
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
•
NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
Descriptions of circuits, software and other related information in this document are provided for illustrative
•
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
•
While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
•
NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"Standard":
"Special":
"Specific":
Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment
and industrial robots.
Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support).
Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1)
"NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2)
"NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
M8E 02 . 11-1
4
User’s Manual U17763EE1V1UD00
Page 5
All (other) product, brand, or trade names used in this pamphlet are the trademarks or
registered trademarks of their respective owners.
Product specifications are subject to change without notice. To ensure that you have
the latest product data, please contact your local NEC Electronics sales office.
User’s Manual U17763EE 1V 1UD00
5
Page 6
Regional Information
T
T
Some information contained in this document may vary from country to country. Before using any NEC
product in your application, please contact the NEC office in your country to obtain a list of authorized
representatives and distributors. They will verify:
•Device availability
•
Ordering information
Product release schedule
•
•
Availability of related technical literature
•
Development environment specifications (for example, specifications for third-party tools and
components, host computers, power plugs, AC supply voltages, and so forth)
Network requirements
•
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary
from country to country.
Readers This manual is intented for users who want to understand the functions of the
V850ES/DJ2.
PurposeThis manual presents the hardware manual of the V850ES/DJ2.
This User’s Manual is an extension of the F_Line User’s Manual.
F_Line Items:
For all of the items regarding the FG2 please refer to the F_Line User’s
Manual/Data sheet (U17215EJ2V0UD00 (2nd edition) and further releases).
MTRC of D_Line:
In this User’s Manual/Data Sheet all of the MTRC relevant items and the
internal connection or pinout of the D_Line device are regarded.
OrganizationThis system specification describes the following sections:
•Pin function
•Port function
•Internal peripheral function
•Electrical target specification
LegendSymbols and notation are used as follows:
Weight in data notation : Left is high-order column, right is low order column
Active low notation: xxx
(pin or signal name is over-scored) or
/xxx (slash before signal name)
Memory map address: : High order at high stage and low order at low stage
Note : Explanation of (Note) in the text
Caution : Item deserving extra attention
Remark : Supplementary explanation to the text
Numeric notation : Binary . . .
Decimal . . .
XXXX or XXXB
XXXX
Hexadecimal . . . XXXXH or 0x XXXX
Prefixes representing powers of 2 (address space, memory capacity)
The V850ES/DJ2 is a product of the NEC’s V850 D_Line Series of single-chip microcontroller designed
for application with up to 6 stepper motor channels.
It provides low-power operation for real-time control ap plications especial for automotive Da shboard
applications.
1.1 General
The V850ES/DJ2 is a 32-bit System in Package (SiP) microcontroller that includes a V850ES CPU core
device of the F_Line (V850ES/FG2) and a Meter Controller/Driver (MTRC) in one package.
The F_Line includes peri pheral f unctions such as ROM/RA M, a timer /count er, serial interfaces, and an
A/D converter.
In addition to high real- time r espo nse char acte rist ics and 1-c lock-p itch bas ic i nstruct ion s, the V850E S/
FG2 features multiply instructions, satu rated operation ins tructions, bit manip ulation instructi ons, etc.,
realised by a h ardware multi plier, as optimum i nstruc tions for di gital se rvo c ontrol a pplic ations. More over, as a real-time control system, the V850ES/FG2 enables extremely high cost-performance for applications that require a low power consumption, such as automotive applications.
For an overview of the V850ES/FG3 refer to “V850ES/FG2 Introduction” on page 25.
The integrated MTRC sup plies a meter co ntroller driv er macro for up to 6 st epper motor channels and
GPIOs. Via the dedicated interface the controlling will be handled with a dedicated protocol.
For this in ter n al in te r f ac e t he 3-wire serial int e r face CSIB1 of the F G2 d ev ice is used for the se ri al communication and the PCM0 port of the FG2 device is used as the CS function for the MTRC.
1.2 Features (V850ES/D_Line)
Table 1-1: Features (V850ES/D_Line)
Part NumberNameFG2 devicePin
µPD70F3325V850ES/DJ2µPD70F3235(A)/FG21442561226
Internal Memory
Flash (KB)RAM (KB)
CANSM
User’s Manual U17763EE 1V 1UD00
17
Page 18
Chapter 1 Introduction
1.3 About the Subject of this User’s Manual
This User’s Manual is an extension of the F_Line User’s Manual.
F_Line Items:
For all of the items regarding the FG2 please refer to the F_Line User’s Manual/Data Sheet
(U17215EJ2V0UD00 (2 nd edit ion ) and furthe r relea se s).
MTRC of D_Line:
In this User ’s Manual/Data Sh eet all of t he MTRC rel evant item s and the i nternal con nection or p inout
of the D_Line device are regarded.
1.4 Internal Connection
The following pins of the FG2 device are connected to the MTRC:
•CSI I/F:SIB1, SOB1, SCKB1
•Chip select: PCM0 as CS
1.4.1 System in Package (SiP)
Figure 1-1: D_Line SiP
1 chip
FG2 DeviceMTRC
CPU
CSI
CLKOUT
PCM0
SCKB1
SIB1
SOB1
CLK
CS
SCK
SO
SI
CSI
RegCTL
SM
Macro
18
User’s Manual U17763EE1V1UD00
Page 19
Chapter 1 Introduction
1.5 Communication Between the FG2 and MTRC
The clocked synchr onous ser ial interface CSIB1 o f the FG 2 devi ce is used for the co mmunic ation with
the MTRC.
The communication I/F of the MTRC is fixed to the following settings:
•I/F:CSI
•Mode:Slave mode
•Data length: 8-bits
(support continuous data transfer,
therefore the FG2 CSIB1can use 16-bit data
length)
•Transfer:MSB first
•Transmission:transmission/reception mode
1.5.1 Communication
The software for the comm unicatio n betwe en the FG2 d evice and the MT RC has to ma nage th e I/F of
the CSIB1 and the PCM0 pin as chip select signal.
The CSI1B of the FG2 device has been set to master mode, because the MTRC CSI is always in slave
mode. Therefore it is ne cessary, that the CSIB1 send s dummy data if the FG2 device wants to r ead
data from the MTRC.
The MTRC CSI is always in 8-bit mode but is capa ble of con tinuou s data tra nsfer. Therefore the 16-bit
mode of the CSIB1 can be used for faster communication for example.
User’s Manual U17763EE 1V 1UD00
19
Page 20
Chapter 1 Introduction
1.5.2 Internal or external communication via CSIB1
Via the PCM0/CS signal the output functionality of the PMT4 port will be controlled, too.
Figure 1-2: CS Functionality
V850ES/FG2
CLKOUT
SIB1
SOB1
SCKB1
PCM0
MTRC
CLK
SO
SI
SCK
Last byte
control
CS
PMT43/EXCLO
SM
Macro
PMT40/EXSI1
PMT41/EXSO1
PMT42/EXSCK1
DJ2 pins
EXCSI1
MTCS
If the PMT4 port is configured for periphe ral mode the PCM0/CS signal controls the out put function of
the external CSIB1 (EX CSI1) functionality. The EXCSIB1 provide the FG 2 CSIB1 communication for
external components, too. This function can b e u se d, if ther e’s no i nte rn al c omm uni ca tio n b etwe en the
FG2 device and the MTRC.
With special regard to the las t byte transfer of the inte rnal commu nicat ion proto col a s witch control will
delay the switching until the last byte was transferred between FG2 and the MTRC.
PCM0/CS
and
EX_CSIB1 signals
MTCS
1EX_CSIB1 signals are in inactive state regardless to the communication of the CSIB1
0EX_CSIB1 signals are active, dependent of the communication of the CSIB1
If PMT4 is in port mode the signal of PMT4 depends only on the settings of the PMT4 SFRs.
11HCompare Control Register 6MCMPC600H×R/W
12HTimer Mode Control Register 0MCNTC000H×R/W
13HTimer Mode Control Register 1MCNTC100H×R/W
20HPort MT0PMT0Undefined×R/W
21HPort MT1PMT1Undefined×R/W
22HPort MT2PMT2Undefined×R/W
23HPort MT3PMT3Undefined×R/W
24HPort MT4PMT4Undefined×R/W
25HPort MT0 Mode RegisterPMMT0FFH×R/W
26HPort MT1 Mode RegisterPMMT1FFH×R/W
27HPort MT2 Mode RegisterPMMT2FFH×R/W
28HPort MT3 Mode RegisterPMMT3FFH×R/W
29HPort MT4 Mode RegisterPMMT4FFH×R/W
2AHPort MT1 Mode Control RegisterPMCMT100H×R/W
2BHPort MT2 Mode Control RegisterPMCMT200H×R/W
2CHPort MT4 Mode Control RegisterPMCMT400H×R/W
2DHSM1SM2 Mode Control RegisterSM12MC00H×R/W
2EHRing Oscillator Control RegisterMRCTL50H×R/W
31HCalibration RegisterMRCAL10H×R/W
Initial Value
After Reset
Access
1-bit8-bit16-bit
R/W
User’s Manual U17763EE 1V 1UD00
23
Page 24
[MEMO]
24
User’s Manual U17763EE1V1UD00
Page 25
Chapter 2V850ES/FG2 Introduction
The V850ES/FG2 is o ne of the products of NE C Electronics’ V85 0 Series of single-ch ip microcontrollers for real-time control.
The V850ES/FG2 is a 32-bit si ngle-chip mi crocontroller that includes the V850ES CPU core and integrate peripheral functi ons such as ROM/RA M, DMA controller, and timers/counte rs. These microco ntrollers also incorporate a CAN (Controller Area Network) as an automotive LAN.
In addition to highly real-time responsive, 1-clock-pitch basic instructions, this microcontroller have
instructions ideal for digital servo applications, such as multiplication instructions using a hardware multiplier, sum-of-products ope ration instructions, and bi t manipulation instructio ns. This microcontroller
can also realize a real-ti me control system that is highly cost effective and can be used in automotive
instrumentation fields.
EV
FLMD0, FLMD1:
INTP0 to INTP10:
KR0 to KR7:
NMI:
P00 to P06:
P10, P11:
P30 to P39:
P40 to P42:
P50 to P55:
P70 to P715:
P90 to P915:
PCL:
A/D trigger input
Analog input
Asynchronous seri al clock
Analog reference voltage
Analog V
SS
Power supply for bus interface
Ground for bus interface
Clock output
Receive data for controller area network
Transmit data for controller area network
Debug clock
Debug data input
Debug data output
Debug mode select
Debug reset
Power supply for port
Ground for port
Flash programming mode
Interrupt request from peripherals
Key return
Non-maskable interrupt request
Port 0
Port 1
Port 3
Port 4
Port 5
Port 7
Port 9
Programmable clock output
PCM0 to PCM3:
PCS0, PCS1:
PCT0, PCT1,
PCT4, PCT6:
PDL0 to PDL13:
REGC:
RESET:
RXDA0 to RXDA2:
SCKB0, SCKB1:
SIB0, SIB1:
SOB0, SOB1:
TIP00, TIP01,
TIP10, TIP11,
TIP20, TIP21,
TIP30, TIP31,
TIQ00 to TIQ03,
TIQ10 to TIQ13:
TOP00, TOP01,
TOP10, TOP11,
TOP20, TOP21,
TOP30, TOP31,
TOQ01 to TOQ03,
TOQ11 to TOQ13:
TXDA0 to TXDA2:
DD:
V
SS:
V
X1, X2:
XT1, XT2:
Port CM
Port CS
Port CT
Port DL
Regulator control
Reset
Receive data
Serial clock
Serial input
Serial output
Timer i nput
Timer output
Transmit data
Power supply
Ground
Crystal for main clock
Crystal for subclock
26
Preliminary User’s Manual U17763EE1V1UD00
Page 27
Chapter 2 V850ES/FG2 Introduction
Figure 2-1: Block Diagram
NMI
INTP0 to INTP10
TIQ00 to TIQ10
TIQ01 to TIQ11
TIQ02 to TIQ12
TIQ03 to TIQ13
TOQ00 to TOQ10
TOQ01 to TOQ11
TOQ02 to TOQ12
TOQ03 to TOQ13
TIP00 to TIP30
TIP01 to TIP31
TOP00 to TOP30
TOP01 to TOP31
SOB0, SOB1
SIB0, SIB1
SCKB0, SCKB1
TXDA0 to TXDA2
RXDA0 to RXDA2
ASCKA0
CTXD0, CTXD1
CRXD0, CRXD1
ANI0 to ANI15
AV
AVREF0
ADTRG
KR0 to KR7
INTC
16-bit timer/
counter Q:
2 ch
16-bit timer/
Flash Memory
256 KB,
384 KB
or
Mask Rom
128 KB,
256 KB
RAM
6 KB ,
12 KB,
16 KB
DMAC
PC
32-bit barrel
shifter
System
registers
Generalpurpose register
32 bits × 32
CPU
Multiplier
16 × 16 → 32
ALU
Instruction
queue
BCU
counter P:
4 ch
16-bit
interval
timer M:
1 ch
CSIB: 2 ch
UARTA: 3 ch
Ports
PCS0, PCS1
P90 to P915
PCM0 to PCM3
PDL0 to PDL13
P10, P11
P50 to P55
P40 to P42
P30 to P39
P70 to P715
P00 to P06
CG
PLL
RG
PCL
CLKOUT
XT1
XT2
X1
X2
RESET
FLMD0
FLMD0
FLMD1
PCT0, PCT1, PCT4, PCT6
CAN: 2 ch
BVDD
BVSS
EVDD
EVSS
SS
A/D
converter
Key return
function
Watchdog
timer 2
RCU
RSU
ROMC
DRST
DMS
DDO
DCK
DDI
On chip debug
Regulator
CLM
POC/LVI
VDD
VSS
REGC
Watch timer
Preliminary User’s Manual U17763EE1V1UD00
27
Page 28
Chapter 2 V850ES/FG2 Introduction
2.1 Pin Functions
This section explains the names and functions of the pins of the V850ES/FG2.
Three I/O buffer power supplies, AV
REF0, BVDDand EVDD, are availa ble. The rela tionship between the
power supplies and the pins is shown below.
Table 2-1: Pin I/O Buffer Power Supplies (V850ES/FG2
Power SupplyCorresponding Pin
AV
EV
BV
REF0
DD
DD
Port 7
Port 0, Port 1, Port 3, Port 4, Port 5, Port 9, RESET
Port CM, Port CS, Port CT, Port DL
Serial receive data input (CSIB0)P40
SIB1Serial receive data input (CSIB1)P97/TIP20/TOP20
SOB0
Serial transmit data output (CSIB0)P41
Output
SOB1Serial transmit data output (CSIB1)P98
SCKB0
SCKB1Serial clock I/O (CSIB1)P99
I/O
RXDA0
RXDA1Serial receive data input (UARTA1)P91/KR7
Input
Serial clock I/O (CSIB0)P42
Serial receive data input (UARTA0)P31/INTP7
RXDA2Serial receive data input (UARTA2)P39/INTP8
TXDA0
TXDA1Serial transmit data output (UARTA1)P90/KR6
Output
Serial transmit data output (UARTA0)P30
TXDA2Serial transmit data output (UARTA2)P38
ASCKA0InputBaud rate clock input to UARTA0P32/TIP00/TOP00/TOP01
CRXD0
CRXD1CAN receive data input (CAN1)P37
CTXD0
Input
Output
CAN receive data input (CAN0)P34/TIP10/TOP10
CAN transmit data output (CAN0)P33/TIP01/TOP01
CTXD1CAN transmit data output (CAN1)P36
ANI0 to ANI15InputAnalog voltage input to A/D converterP70 to P715
Input: Independently connect to EVDD or EVSS via a resistor
Output: Leave open
P912
P913/INTP4/PCL
5-WP914/INTP5
P915/INTP6
PCM0
PCM1/CLKOUT
5
Input: Independently connect to BVDD or BVSS via a resistor
Output: Leave open
PCM2, PCM3
PCS0, PCS15
PCT0, PCT1, PCT4, PCT65
Input: Independently connect to BVDD or BVSS via a resistor
Output: Leave open
Input: Independently connect to BVDD or BVSS via a resistor
Output: Leave open
PDL0 to PDL4
PDL5/ FLMD1
5
Input: Independently connect to BVDD or BVSS via a resistor
Output: Leave open
PDL6 to AD13
AV
REF0
AV
SS
FLMD0
a
-Directly connect to V
--
-Directly connect to V
DD
SS
REGC-RESET2X1-X2-XT116Connect to VSS via a resistor
XT216Leave open
V
V
BV
BV
EV
EV
DD
SS
DD
SS
DD
SS
--
--
--
--
--
--
a.If noise that exceeds the noise elimination width is input to th e RESET pin durin g self pro gram m ing , the fl ash
on-board mode may b e entered de pending o n the capa citance c harge end timing whe n a capac itor is co nnected to the FLMD0 pin. Therefore, do not connect a capacitor to the FLMD0 pin.
34
Preliminary User’s Manual U17763EE1V1UD00
Page 35
Chapter 2 V850ES/FG2 Introduction
T
Figure 2-2: Pin I/O Circuit Types (1/2)
Type 2Type 5-AF
Pullup
enable
IN
Input enable
Schmitt-triggered input with hysteresis characteristics
• Port pins function alternately as other peripheral-function I/O pins
• Can be set in input or output mode in 1-bit units.
The V850ES/FG2 has a total of 84 I/O ports, ports 0, 1, 3 to 5, 7, 9, CM, CS, CT, and DL. The port configuration is shown below.
Figure 2-4: Port Configuration
Port 0
Port 1
Port 3
Port 4
Port 5
Port 7
P00
P06
P10
P11
P30
P39
P40
P42
P50
P55
P70
P715
P90
P915
PCM0
PCM3
PCS0
PCS1
PCT0
PCT1
PCT4
PCT6
PDL0
PDL13
Port 9
Port CM
Port CS
Port CT
Port DL
Preliminary User’s Manual U17763EE1V1UD00
37
Page 38
Chapter 2 V850ES/FG2 Introduction
2.3 CPU Functions
Based on the RISC ar ch ite ct ure, the CPU of the V850ES/FG 2 exe cu tes most of the instruction s in o ne
clock under control of a five-stage pipeline.
The following clock generation functions are available.
•Main clock oscillator
•In clock-through mode
X = 4 to 5 MHz (fXX = 4 to 5 MHz)
f
•In PLL (Phase Locked Loop) mode
f
X = 4 to 5 MHz (fXX = 16 to 20 MHz)
•Subclock oscillator (sub-resonator)
•32.768 kHz
•20 kHz (RCR = 390 kΩ, C = 47 pF)
•Multiply (×4) function via PLL (Phase Locked Loop)
•Clock-trough mode/PLL mode selectable
•Ring OSC
R = 100 to 400 kHz
•f
•Internal system clock generation
•7 steps (f
XX, fXX/2, fXX/4, fXX/8, fXX/16, fXX/32, fXT)
•Peripheral clock generation
•Clock output function
•Programmable clock output (PCL) function
Preliminary User’s Manual U17763EE1V1UD00
39
Page 40
XT1
XT2
FRC bit
Subclock
oscillator
MFRC bit
X1
Main clock
oscillator
X2
Main clock
oscillator
stop control
Software STOP mode
Xtal
1/2 divider
RC
PLLON
bit
f
X
PCK1,
PCK0 bit
Chapter 2 V850ES/FG2 Introduction
Figure 2-5: Clock Generator
f
XT
PLL
Select
oscillator
IDLE mode0, 1
Selector
SELPLL bit
Selector
IDLE
control
IDLE
control
IDLE mode 0, 1
Prescaler 3
f
XX
Prescaler 2
CK2 to CK0 bits
f
XX
/32
f
XX
/16
f
XX
/8
f
XX
/4
f
XX
/2
f
XX
Selector
X
/2 to fX/2
f
CK3 bit
f
XT
XT
f
Selector
Watch timer clock
12
Watch timer (WT) clock,
CSIB0 clock
Main clock oscillator
stop detection
HALT mode
HALT
control
Selector
f
CPU
f
CLK
CPU clock
Internal
system clock
PCL
CLKOUT
Port CM
Ring-OSC
RSTOP bit
Selector
Prescaler 1
Prescaler 4
1/8 divider
fXX to fXX/1024
f
X-fX
/1024
8
f
R
Watchdog timer 2 (WDT2) clock
Peripheral clock
Watchdog timer 2 (WDT2)
40
Preliminary User’s Manual U17763EE1V1UD00
Page 41
Chapter 2 V850ES/FG2 Introduction
2.5 16-bit Ti mer /event Counter P
The V850ES/FG2 includes 16-bit timer/event counter P (TMP0 to TMP3).
Features
Timer P (TMP) is a 16-bit timer/event counter that can be used in various ways.
TMP can perform the following operations.
•PWM output
•Interval timer
•External event counter (operation disabled when clock is stopped)
•One-shot pulse output
•Pulse width measurement function
•Timer synchronized operation function
•Free-running function
•External trigger pulse output function
Functional Outline
•Capture trigger input signal × 2
•External trigger input signal × 1
•Clock selection × 8
•External event count input × 1
•Readable counter × 1
•Capture/compare reload regis ter × 2
•Capture/compare match interru pt × 2
•Timer output (TOPn0, TOPn1) × 2
Remark:n = 0 to 3
Preliminary User’s Manual U17763EE1V1UD00
41
Page 42
Figure 2-6: Figure 6-1. Block Diagram of Timer P
TPnCTL0
TPnCE TPnCKS2 TPnCKS1 TPnCKS0
TPnCE
fXX
fXX/2
f
XX/4
f
XX/8
f
XX/16
XX/32
fXX/128
f
XT
f
XX/64
f
Note 1
Note 2
Selector
Edge
detector
Chapter 2 V850ES/FG2 Introduction
Internal bus
TPnIOC2
TPnEES1 TPnEES0 TPnETS1 TPnETS0
TPnCCR0
TPnCNT0
Counter control
16-bit counter
CCR0 buffer
register
Load
Clear
INTTPnCC0
SelectorSelector
TPnCE
INTTPnOV
Edge
detector
TIPn0
Note 3
TIPn1
Note 4
SELCNT0
ISEL04 to ISEL02,
ISEL00
TPnIS3 to TPnIS0
TPnIOC1
detector
detector
SelectorSelector
Edge
Edge
TPnCTL1
Notes: 1. TMP0, TMP2
2. TMP1, TMP3 (when main clock is stopped, count operation by subclock cannot be per-
formed.)
3. TSOUT signal of CAN0 block (TMP0)
RXDA0 pin (TMP1)
Trigger
control
TPnSYE TPnEST TPnEEE TPnMD2 TPnMD1 TPnMD0
Internal bus
CCR1 buffer
register
TPnCCR1
Capture/compare
selection function
TPnCCS1 TPnCCS0 TPnOVF
TPnOPT0
Load
Output
controller
TPnOL1 TPnOE1 TPnOL0 TPnOE0
TPnIOC0
INTTPnCC1
TOPn0
TOPn1
4. INTTM0EQ0 interrupt of TMM block or TSOUT signal of CAN1 block (TMP0)
RXDA1 pin (TMP1)
Remark:n = 0 to 3
42
Preliminary User’s Manual U17763EE1V1UD00
Page 43
Chapter 2 V850ES/FG2 Introduction
2.6 16-bit Ti mer /event Counter Q
The V850ES/FG2 includes 16- bit tim er /ev ent counte r Q (TMQ0, TMQ1) .
Features
Timer Q (TMQ) is a 16-bit timer/event counter that can be used in various ways.
TMQ can perform the following operations.
• PWM output
• Interval timer
• External event counter (operation disabled when clock is stopped)
• One-shot pulse output
• Pulse width measurement function
• Triangular wave PWM output
• Timer synchronized operation function
Functional Outline
• Capture trigger input signal × 4
• External trigger input signal × 1
• Clock selection × 8
• External event count input × 1
• Readable counter × 1
• Capture/compare reload register × 4
• Capture/compare match interrupt × 4
• Timer output (TOQn0 to TOQn3) × 4
Remark:n = 0, 1
Preliminary User’s Manual U17763EE1V1UD00
43
Page 44
TQnCTL0
TQnCE TQnCKS2 TQnCKS1 TQnCKS0
TQnCE
fXX
fXX/2
f
XX/4
f
XX/8
f
XX/16
XX/32
f
XX/64
f
f
XX/128
Selector
Chapter 2 V850ES/FG2 Introduction
Figure 2-7: Figure 7-1. Block Diagram of Timer Q
Internal bus
TQnIOC2
TQnEES1 TQnEES0 TQnETS1 TQnETS0
TQnCCR0
TQnCNT0
CCR0 buffer
register
Load
INTTQnCC0
SelectorSelector
detector
detector
TIQn0
TIQn1
TIQn2
TIQn3
detector
detector
detector
detector
TQnIS7 to TQnIS0
TQnIOC1
Edge
Edge
Counter control
Trigger
control
Edge
Edge
Edge
Edge
TQnSYE TQnEST TQnEEE TQnMD2 TQnMD1 TQnMD0
TQnCTL1
Internal bus
16-bit counter
CCR1 buffer
register
TQnCCR1
16-bit counter
CCR2 buffer
register
TQnCCR2
16-bit counter
CCR3 buffer
register
TQnCCR3
Capture/compare
selection function
TQnCCS3 to TQnCCS0TQnOVF
INTTQnOV
TQnCUF
TQnOPT0
Clear
TQnCE
INTTQnOV
Load
Load
INTTQnCC1
INTTQnCC2
Selector
Load
INTTQnCC3
Selector
Output
controller
TOQn0
TOQn1
TOQn2
TOQn3
TQnOL3 to TQnOL0 TQnOE3 to TQnOE0
TQnIOC0
Remark:n = 0, 1
44
Preliminary User’s Manual U17763EE1V1UD00
Page 45
Chapter 2 V850ES/FG2 Introduction
2.7 16-bit Interval Timer M
The V850ES/FG2 includes 16-bit interval timer M (TMM0).
Features
Timer M (TMM) supports only a cle ar & start mode. It does not support a fre e-running mode . To use
timer M in a manner equivalent to in the free-running mode, set the compare register to FFFFH and
start the 16-bit counter. A match interrupt will occur when the timer overflows.
• Interval function
• Clock selection × 8
• Simple counter × 1
(The simple counter is a counter that does not use a counter read buffer. This counter cannot
be read during timer count operation.)
• Simple compare × 1
(The simple compare register is a register that does not use a compare write buffer. No data
can be written to this compare register during timer count operation.)
• Compare match interrupt × 1
TM0CTL0
TM0CE
Figure 2-8: Block Diagram of Timer M
TM0CKS2 TM0CKS1 TM0CKS0
fXX
fXX/2
XX/4
f
f
XX/64
f
XX/512
INTWT
R/8
f
f
XT
Selector
Controller
Internal bus
TM0CMP0
16-bit counter
INTTM0EQ0
Clear
Preliminary User’s Manual U17763EE1V1UD00
45
Page 46
Chapter 2 V850ES/FG2 Introduction
2.8 Watch Timer Functions
Features
The watch timer has the following functions.
• Watch timer
• Interval timer
The watch timer and interval timer functions can be used at the same time.
Figure 2-9: Block Diagram of Watch Timer
Reset
fX
Prescaler
Note
3
fXT
f
BRG
Clear
f
W
Selector
11-bit prescaler
fW/24fW/25fW/26fW/27fW/28fW/210fW/211fW/2
Selector
9
Selector
3
Watch timer operation mode register
(WTM)
Internal bus
5-bit counter
Clear
Note: For details of prescaler 3, see Figure 2-10 “Block Diagram of Prescaler 3”.
Remarks: 1. f
BRG:Prescaler 3 output frequency
2. f
X:Oscillation frequency
INTWT
Selector
INTWTI
WTM0WTM1WTM2WTM3WTM4WTM5WTM6WTM7
46
3. f
XT:Sub cl oc k freque nc y
4. f
W:Watch timer clock frequency
5. INTWT:Watch timer interrupt
6. INTWTI:Interval timer interrupt
Preliminary User’s Manual U17763EE1V1UD00
Page 47
Chapter 2 V850ES/FG2 Introduction
Figure 2-10: Block Diagram of Prescaler 3
fX
3-bit prescaler
fX/8
f
X/4
f
X/2
X
f
fBGCS
Selector
8-bit counter
Match
Output
control
fBRG
Remark:f
2
BGCS00BGCS01BGCE0
BGCS:Prescaler 3 count clock frequency
1. f
BRG:Prescaler 3 output frequency
2. f
X:Oscillation frequency
Prescaler compare register0
(PRSCM0)
Prescaler mode register 0 (PRSM0)
Preliminary User’s Manual U17763EE1V1UD00
47
Page 48
Chapter 2 V850ES/FG2 Introduction
2.9 Functions of Watchdog T imer 2
Features
Watchdog timer 2 has the following functions.
• Default-start watchdog timer
- →Reset mode: Reset operation upon overflow of watchdog timer 2 (generation of WDT2RES
signal)
- →Non-maskable interrupt request mode: NMI operation upon overflow of watchdog timer 2
(generation of INTWDT2 signal)
• Input selectable from main clock and Ring-OSC as the source clock
Note: Restoring using the RETI instruction follo wing non-maskable interr upt servicing due to a non-
maskable interrupt r equest signal (INTWDT2) is not p ossible. Ther efore, following completion
of interrupt servicing, perform a system reset.
Figure 2-11: Block Diagram of Watchdog Timer 2
Note
Watchdog timer enable
register (WDTE)
Remarks: 1. f
2. f
3. INTWDT2: Non-maskable interrupt request signal from watchdog timer 2
4. WDT2RES: Watchdog timer 2 reset signal
7
fX/2
fR/2
X: Oscillation frequency
R: Ring-OSC clock frequency
3
RUN2
Clock
input
controller
2
16-bit
counter
Clear
0
WDM21 WDM20
Watchdog timer mode
register 2 (WDTM2)
Internal bus
fX/216 to fXX/223,
12 to
fR/2
19
R/2
f
Selector
3
WDCS22
Output
controller
WDCS21WDCS20WDCS23WDCS24
INTWDT2
WDT2RES
(internal reset signal)
3
48
Preliminary User’s Manual U17763EE1V1UD00
Page 49
Chapter 2 V850ES/FG2 Introduction
2.10 A/D Converter
Features
The A/D converter converts anal og in put sig nal s in to dig ita l va lue s, has a r eso lu tion of 10 bits, and can
handle 16 analog input signal channels (ANI0 to ANI15).
The A/D converter has the following features.
•10-bit reso lu ti o n
•16 channels
•Successive approximation method
•Operating voltage: AV
•Analog input voltage: 0 V to AV
REF0 = 4.0 to 5.5 V
REF0
•The following functions are provided as operation modes.
• Continuous select mode
• Continuous scan mode
• One-shot scan mode
•The following functions are provided as trigger modes.
• Software trigger mode
• External trigger mode (external, 1)
• Timer trigger mode
•Power-fail monitor function (conversion result compare function)
Figure 2-12: Block Diagram of A/D Converter
ANI0
ANI1
ANI2
:
:
ANI13
ANI14
ANI15
Selector
Sample & hold circuit
ADA0CE
bit
SAR
ADA0CE bit
Voltage
comparator
D/A converter
AV
REF0
AVSS
INTTP2CC0
INTTP2CC1
ADTRG
ADA0ETS0 bit
ADA0ETS1 bit
ADA0CR0
Edge
detection
Controller
ADA0M1 ADA0M2 ADA0S
ADA0M0
Internal bus
ADA0CR1
ADA0CR2
•
•
•
•
•
•
ADA0CR13
ADA0CR14
ADA0CR15
Preliminary User’s Manual U17763EE1V1UD00
49
Page 50
Chapter 2 V850ES/FG2 Introduction
2.1 1 Asynchronous Serial Interface A (UARTA)
The V850ES/FG2 includes asynchronous serial interface A (UARTA).
Features
• Transfer rate: 300 bps to 312.5 kbps (using internal system clock of 20 MHz and dedicated
baud rate generator)
• Full-duplex communication
- UARTA receive data register n (UAnRX)
- UARTA transmit data register n (UAnTX)
• 2-pin configurationTXDAn:
- Output pin of transmit data
- RXDAn: Input pin of receive data
• Reception error detection function
- Parity error
- Framing er ror
- Overrun error
• Interrupt sources: 2 types
- Reception complete interrupt (INTUAnR): An interrupt is generated in the reception enabled
status by ORing three types of reception errors. It is also generated when receive data is
transferred from the shift register to receive buffer register n after completion of serial
transfer.
- Transmission enable interrupt (INTUAnT): Generated when transmit data is transferred from
the transmit buffer register to the shift register in the transmission enabled status.
• Character length of transmit/receive data is specified by the UAnCTL0 register.
• Character length: 7 or 8 bits
• Parity function: Odd, even, 0, none
• Transmission stop bit: 1 or 2 bits
• Dedicated baud rate generator
• MSB/LSB first transfer selectable
• Transmit/receive data reversible
• 13 to 20 bits selectable for SBF (Sync Break Field) transmission in LIN (Local Interconnect
Network) communication format
• 11 or more bits recognizable for SBF reception in LIN communication format
• SBF reception flag
Remark:n = 0 to 2
50
Preliminary User’s Manual U17763EE1V1UD00
Page 51
INTUAnT
INTUAnR
Chapter 2 V850ES/FG2 Introduction
Figure 2-13: Block Diagram of Asynchronous Serial Interface A
Internal bus
XX to fXX/2
f
10
ASCKA0
Clock
Remark:n = 0 to 2
UAnRX
Receive shift
register
Filter
Selector
selector
UAnCTL1
UAnCTL2
Reception unitTransmission unit
Reception
controller
Baud rate
generator
Internal bus
Transmission
controller
Baud rate
generator
UAnTX
Transmit
shift register
Selector
UAnOTP0UAnCTL0UAnSTR
TXDAn
RXDAn
Preliminary User’s Manual U17763EE1V1UD00
51
Page 52
Chapter 2 V850ES/FG2 Introduction
2.12 3-Wire Serial Interface (CSIB)
The V850ES/FG2 includes a 3-wire serial interface (CSIB).
Features
• Master mode and slave mode selectable
• 3-wire serial interface for 8-bit to 16-bit transfer
• Interrupt request signals (INTCBnT and INTCBnR)
• Serial clock and data phase selectable
• Transfer data length selectable from 8 to 16 bits in 1-bit units
• Data transfer with MSB- or LSB-first selectable
• 3-wireSOBn:
- Serial data output
- SIBn:Serial data input
- SCKBn:Serial clock I/O
• Transmission mode, reception mode, and transmission/reception mode selectable
Remark:n = 0, 1
fXX/2
f
XX/4
XX/8
f
f
XX/16
XX/32
f
XX/64
f
fBRG (n = 0)
TOP01 (n = 1)
SCKBn
SIBn
Figure 2-14: Block Diagram of 3-Wire Serial Interface
Internal bus
CBnCTL1
Selector
CBnSTR
Controller
Phase control
CBnTX
Shift register
CBnCTL2CBnCTL0
SO latch
Phase
control
INTCBnT
INTCBnR
SOBn
Remark:n = 0, 1
52
CBnRX
Preliminary User’s Manual U17763EE1V1UD00
Page 53
Chapter 2 V850ES/FG2 Introduction
2.13 CAN Controller
This product features an on-chip 2-channel CAN (Controller Area Network) controller that complies with
the CAN protocol as standardized in ISO 11898. The number of channels varies dependin g on the
product as shown below.
Features
• Compliant with ISO 11898 and tested according to ISO/DIS 16845 (CAN conformance test)
• S tan dar d frame and extend ed frame tra ns miss io n/rec ept ion enabl ed
• Mask setting of four patterns is possible for each channel
Figure 2-15: Block Diagram of CAN Module
Interrupt request
INTCnTRX
INTCnREC
INTCnERR
INTCnWUP
CPU
NPB
interface
(NEC peripheral I/O bus)
CAN module
(Memory Access Controller)
CAN RAM
Message
buffer 0
Message
buffer 1
Message
buffer 2
Message
buffer 3
Message
buffer 31
NPB
MAC
CnMASK1
CnMASK2
...
CnMASK3
CnMASK4
CAN
protocol
layer
CANTXn
CANRXn
CAN
transceiver
CAN bus
CAN_Hn
CAN_Ln
Remark:n = 0, 1
Preliminary User’s Manual U17763EE1V1UD00
53
Page 54
Chapter 2 V850ES/FG2 Introduction
2.14 Interrupt/Exception Processing Function
The V850ES/FG2 is provided with a dedicated interrupt controller (INTC) for interrupt servicing.
An interrupt is an event that occ urs independ ently of progra m execution, an d an exception is an event
whose occurrence is dependent on program execution.
The V850ES/FG2 can process interrupt request signals from the on-chip peripheral hardware and
external sources. M oreover, exception processing can be s tarted by the TRAP instr uction (software
exception) or by generation of an exception event (i.e. fetching of an illegal opcode) (exception trap).
The V850ES/FG2 inco rporates a direct memory access (DMA) controller (DMAC) that execu tes and
controls DMA transfer. The V850ES/FG2 incorporates four independent DMA channels.
The DMAC controls data transfer between memory and I/O, between memories, or between I/Os based
on DMA requests iss ued by the on-chip p eripheral I/O (serial in terface, real-time pu lse unit, and A/D
converter), interrupts from external input pin s, or software triggers (m emory refers to intern al RAM or
external memory).
Features
• 4 independent DMA channels
• Transfer unit: 8/16 bits
16
• Maximum transfer count: 65,536 (2
• Transfer type: Two-cycle transfer
• Transfer mode: Single transfer mode
• Transfer re que sts
- Request by interrupts from on-chip peripheral I/O
(serial interface, timer/counter, A/D converter)
or interrupts from external input pin
- Requests by software trigger
)
• Transfer tar get s
- Peripheral I/O ⇔ Peripheral I/O
- Peripheral I/O ⇔ Internal RAM
Figure 2-16: Block Diagram of DMA Controller
CPU
Internal RAM
Data
control
Channel
Count
control
control
Internal bus
Address
control
On-chip
peripheral I/O
On-chip peripheral I/O bus
DMA source address
register n (DSAnH/DSAnL)
DMA destination address
register n (DDAnH/DDAnL)
DMA transfer count
register n (DBCn)
DMA channel control
register n (DCHCn)
DMA addressing control
register n (DADCn)
Remark:n = 0 to 3
Preliminary User’s Manual U17763EE1V1UD00
DMAC
V850ES/FG2
55
Page 56
Chapter 2 V850ES/FG2 Introduction
2.16 Key Interrupt Function
Features
A key interrupt request sign al (INTKR) can be generated by inputting a falli ng edge to the eight key
input pins (KR0 to KR7) by setting the key return mode register (KRM).
Table 2-5: Assignment of Key Return Detection Pins
FlagPin Description
KRM0Controls KR0 signal in 1-bit units
KRM1Controls KR1 signal in 1-bit units
KRM2Controls KR2 signal in 1-bit units
KRM3Controls KR3 signal in 1-bit units
KRM4Controls KR4 signal in 1-bit units
KRM5Controls KR5 signal in 1-bit units
KRM6Controls KR6 signal in 1-bit units
KRM7Controls KR7 signal in 1-bit units
KR7
KR6
KR5
KR4
KR3
KR2
KR1
KR0
KRM7
Figure 2-17: Key Return Block Diagram
KRM6
KRM5 KRM4 KRM3 KRM2 KRM1 KRM0
Key return mode register (KRM)
INTKR
56
Preliminary User’s Manual U17763EE1V1UD00
Page 57
Chapter 2 V850ES/FG2 Introduction
2.17 Standby Function
Overview
The power consumptio n of the sys tem can be effective ly reduced by usi ng the sta ndby m odes in combination and selecting the appropriate mode for the application. The available standby modes are
listed below.
Table 2-6: Standby Modes
ModeFunctional Outline
HALT modeMode in which only the operating clock of the CPU is stopped
IDLE1 mode
IDLE2 modeMode in which all the internal operations of the chip except the oscillator are stopped
Software STOP mode
Subclock operation
mode
Sub-IDLE mode
Mode in which all the internal operations of the chip except the oscillator, PLL
flash memory are stopped
Mode in which all the in ternal o peratio ns of the c hip ex cept the subcl ock os cill ator are
stopped
Mode in which the subclock is used as the internal system clock
Mode in which all the internal operations of the chip except the oscillator, PLL
flash memory are stopped, in the subclock operation mode
a
, and
a
, and
a.The PLL holds the previous operating status (in clock-through mode or PLL mode).
Preliminary User’s Manual U17763EE1V1UD00
57
Page 58
Chapter 2 V850ES/FG2 Introduction
2.18 Reset Function
The reset function is outlined below.
• Reset function by RESET pin input
• Reset function by overflow of watchdog timer 2 (WDT2RES)
• System reset by low voltage detector (LVI)
• System reset by clock monitor (CLM)
58
Preliminary User’s Manual U17763EE1V1UD00
Page 59
Chapter 2 V850ES/FG2 Introduction
2.19 Clock Monitor
The clock monitor samples the main clock by using the on-chip Ring-OSC and generates a reset
request signal when oscillation of the main clock is stopped.
Once the operation o f the clock monitor has been enabled by an operation enab le flag, it cannot be
cleared to 0 by any means other than reset.
The clock monitor automatically stops under the following conditions.
• While oscillation stabilization time is being counted after software STOP mode is released
• When the main clock is stopped (MCK bit of the PCC register = 1 during subclock operation, or
CLS bit of the PCC register = 0 during main clock operation)
• When the sampling clock is stopped (Ring-OSC)
• When the CPU operates with Ring-OSC
Figure 2-18: CLM Block Diagram
Main clock
Ring-OSC clock
Internal reset signal
Enable/disable
CLME
Clock monitor mode
register (CLM)
Preliminary User’s Manual U17763EE1V1UD00
59
Page 60
Chapter 2 V850ES/FG2 Introduction
2.20 Low-voltage Detector
Features
The low-voltage detector (LVI) has the following functions.
• Compares the supply voltage (V
interrupt signal or internal reset signal when V
DD) and detected voltage (VLVII) and generates an internal
DD < VLVI.
• The level of the supply voltage to be detected can be changed by software (in two steps).
• Interrupt or reset signal can be selected by software.
• Can operate in STOP mode too.
• Operation can be stopped by software.
If the low-voltage detec tor is us ed to g ene rate a r es et si gna l, bit 0 ( LVIRF) of the reset source fla g r eg ister (RESF) is set to 1 when the reset signal is generated.
Figure 2-19: Block Diagram of Low-Voltage Detector
VDD
VDD
Low
voltage
detection
level
selector
Detected voltage
N-ch
source (V
LVI )
Internal reset signal
+
−
Selector
INTLVI
60
LVIS0
Low voltage detection level
selection register (LVIS)
Internal bus
LVION
Preliminary User’s Manual U17763EE1V1UD00
LVIMD
LVIF
Low voltage detection
register (LVIM)
Page 61
Chapter 2 V850ES/FG2 Introduction
c
2.21 Voltage Regulator
Features
This product has an on-chip regulator to lower the power consumption and noise.
This regulator supplie s a voltage lower than the su pply voltage V
logic circuits (except the A/D converter and I/O buffers). The output voltage of the regulator is set to 2.5
V (±0.2 V).
Figure 2-20: Regulator
DD
I/O buffer
AV
REF0
A/D converter
4.0 to 5.5 V
BV
(normal port)
3.5 to 5.5 V
DD to the oscillator block an d internal
BV
DD
V
REGC
EV
DD
DD
Regulator
Main and sub
oscillators
Flash
memory
Internal digital circuit
2.5 V
EVDD I/O buffer (normal port)
3.5 to 5.5 V
Bidirectional level shifter
The regulator of this p roduct operates i n all operation modes (norma l operation, HALT, ID LE1, IDLE2,
STOP, and sub-IDLE modes, and during reset).
To stabilize the output voltage of the regulator, connect a capacitor (4.7 µF
Note
) to the REGC pin.
Note: Connect the REGC pin as illustrated below.
Figure 2-21: Connection of REGC Pin (REGC = Capacitance)
4.7 F
VDD
REGC
µ
REG
Supply voltage to
oscillators/internal logi
2.5 V
Input voltage
3.5 to 5.5 V
Preliminary User’s Manual U17763EE1V1UD00
61
Page 62
Chapter 2 V850ES/FG2 Introduction
2.22 Flash Memory
The following products are flash memory versions of the V850ES/FG2.
Caution: There are differences in the amount of noise tolerance and noise radiation between
flash memory versions and mask ROM versions. When considering changing from a
flash memory version to a mask ROM ve rsion during th e process from exper imental
manufacturing to mass production, make sure to sufficiently evaluate commercial
samples (CS) (not engineering samples (ES)) of the mask ROM versions.
µPD70F3235 On-chip 256 KB flash memory
When fetching an instruction, 4 bytes of the flash memory can be accessed in 1 clock in the same manner as the mask ROM versions.
The flash memory can be written m ounted on th e target b oard (on- board write ), by conne cting a d edicated flash programmer to the target system.
Flash memory is commonly used in the following development environments and applications.
• For altering software after solder-mounting the V850ES/FG2 on the target system
• For differentiat ing software in small-sca le production of various models.
• For data adjustment when starting mass production
Note: 8 blocks, blocks 0 to 7, for the 256 KB version (µPD70F3235).
62
Preliminary User’s Manual U17763EE1V1UD00
Page 63
Chapter 2 V850ES/FG2 Introduction
2.23 ROM Mask Options Function
Mask Options (Flash ROM Product)
The flash memory ver sions in this product series have a n option data area where a block s ubject to
mask options is specified.
When writing a program to a fl as h mem ory v ers ion , be s ure to s et the opti on d ata c orr esp ond ing to the
following option in the program at address 007AH as default data.
The data in this area cannot be rewritten during program execution.
Table 2-7: Mask Options
AddressSet Value Setting
007AH
00H
01H
02H
03H
C0H
C1H
C2H
C3H
Ring-OSC:Can be stopped.
WDT2:Count clock can be selected.
Overflow signal can be selected from INTWDT2 or WDT2RES.
Subclock:Crystal resonator connection
Ring-OSC:Cannot be stopped.
WDT2:Count clock can be selected.
Overflow signal can be selected from INTWDT2 or WDT2RES.
Subclock:Crystal resonator connection
Ring-OSC:Can be stopped.
WDT2:Count clock is fixed to Ring-OSC.
Overflow signal is fixed to WDT2RES.
Subclock:Crystal resonator connection
Ring-OSC:Cannot be stopped.
WDT2:Count clock is fixed to Ring-OSC.
Overflow signal is fixed to WDT2RES.
Subclock:Crystal resonator connection
Ring-OSC:Can be stopped.
WDT2:Count clock can be selected.
Overflow signal can be selected from INTWDT2 or WDT2RES.
Subclock:RC oscillation connection
Ring-OSC:Cannot be stopped.
WDT2:Count clock can be selected.
Overflow signal can be selected from INTWDT2 or WDT2RES.
Subclock:RC oscillation connection
Ring-OSC:Can be stopped.
WDT2:Count clock is fixed to Ring-OSC.
Overflow signal is fixed to WDT2RES.
Subclock:RC oscillation connection
Ring-OSC:Cannot be stopped.
WDT2:Count clock is fixed to Ring-OSC.
Overflow signal is fixed to WDT2RES.
Subclock:RC oscillation connection
Caution: Do not make any settings other than the above.
Preliminary User’s Manual U17763EE1V1UD00
63
Page 64
Chapter 2 V850ES/FG2 Introduction
2.24 On-chip Debug Unit (Flash Memory Versions only)
The V850ES/FG2 i nclud es a n on-c hip d ebug u nit. By connect ing an N-Wire em ulator, on-chip de bugging can be executed with the V850ES/FG2 alone.
Caution: The following debug functions are supported by the V850ES/FG2, and whether they
are usable or not differs depending on the debugger. For details of the debugging
function, refer to the user’s manual of the debugger to be used.
Functional Outline
The on-chip debug unit of the V850ES/FG2 is RCU1 (Run Control Unit 1).
Debug interface
Communication with the host mac hine is established by using the DRST, DCK, DMS, DDI, and DDO
signals via an N-Wire emulator. The communication specifications of N-Wire are used for the interface.
On-chip debug
On-chip debugging can b e exec uted by prepar i ng wir ing and a con nec to r for o n-ch ip d ebug gi ng on the
target system. An N-Wire emulator is used as the connector that connects the emulator.
Clear the OCDM0 bit of the OCDM register (special register) to 0 when you use on-chip debug mode.
Forced reset function
The V850ES/FG2 can be forcibly reset.
Break reset function
The CPU can be started in the debug mode immediately after reset of the CPU is released.
Forced br ea k function
Execution of the use r program can be for cibly aborted (howev er, the illegal operation code exce ption
handler (first address: 00000060H) cannot be used).
Hardware break function
Two breakpoints for instruction and access can be used. The instruction breakpoint can abort program
execution at any add ress . The acce ss br eakp oint can ab ort prog ram e xecut ion b y data acce ss t o any
address.
Software break function
Up to four software b reakpoints can be set in the internal R OM area. T he number of s oftware break points that can be set in the RAM area differs depending on the debugger to be used.
Debug monitor function
A memory space for debugging that is different fr om the user me mor y s pac e i s us ed dur ing debugging
(background monitor mode). The user program can be executed starting from any address.
While execution of the user program is aborted, the user resources ( such as memory and I/O ) can be
read and written, and the user program can be downloaded.
64
Preliminary User’s Manual U17763EE1V1UD00
Page 65
Chapter 2 V850ES/FG2 Introduction
Mask function
Each signal can be masked.
The correspondence with the mask functions of the debugger (ID850NWC) for the N-Wire emulator (IEV850E1-CD-NW) of NEC Electronics is shown below.
SymbolIOFunctionConnection
PMT00IOI/O Port External
PMT01IOI/O Port External
PMT02IOI/O Port External
PMT03IOI/O Port External
SM11O - Hi-ZMeter1 PWM Output Signal (sin+)External
SM12O - Hi-ZMeter1 PWM Output Signal (sin-)External
SM13O - Hi-ZMeter1 PWM Output Signal (cos+)External
SM14O - Hi-ZMeter1 PWM Output Signal (cos-)External
SM21O - Hi-ZMeter2 PWM Output Signal (sin+)External
SM22O - Hi-ZMeter2 PWM Output Signal (sin-)External
SM23O - Hi-ZMeter2 PWM Output Signal (cos+)External
SM24O - Hi-ZMeter2 PWM Output Signal (cos-)External
PMT10/SM31O - Hi-Z / O Output Port / Meter3 PWM Output Signal (sin+)External
PMT11/SM32O - Hi-Z / O Output Port / Meter3 PWM Output Signal (sin-)External
PMT12/SM33O - Hi-Z / O Output Port / Meter3 PWM Output Signal (cos+)External
PMT13/SM34O - Hi-Z / O Output Port / Meter3 PWM Output Signal (cos-)External
PMT14/SM41O - Hi-Z / O Output Port / Meter4 PWM Output Signal (sin+)External
PMT15/SM42O - Hi-Z / O Output Port / Meter4 PWM Output Signal (sin-)External
PMT16/SM43O - Hi-Z / O Output Port / Meter4 PWM Output Signal (cos+)External
PMT17/SM44O - Hi-Z / O Output Port / Meter4 PWM Output Signal (cos-)External
PMT20/SM51O - Hi-Z / O Output Port / Meter5 PWM Output Signal (sin+)External
PMT21/SM52O - Hi-Z / O Output Port / Meter5 PWM Output Signal (sin-)External
PMT22/SM53O - Hi-Z / O Output Port / Meter5 PWM Output Signal (cos+)External
PMT23/SM54O - Hi-Z / O Output Port / Meter5 PWM Output Signal (cos-)External
PMT24/SM61O - Hi-Z / O Output Port / Meter6 PWM Output Signal (sin+)External
PMT25/SM62O - Hi-Z / O Output Port / Meter6 PWM Output Signal (sin-)External
PMT26/SM63O - Hi-Z / O Output Port / Meter6 PWM Output Signal (cos+)External
PMT27/SM64O - Hi-Z / O Output Port / Meter6 PWM Output Signal (cos-)External
PMT30IOI/O Port External
PMT31IOI/O Port External
PMT32IOI/O Port External
PMT33IOI/O PortExternal
Note 1
PMT34
Note 1
PMT35
Note 2
PMT36
Note 2
PMT37
PMT40/EXSI1IO/II/O Port / Expand Pin for SIExternal
PMT41/EXSO1IO/OI/O Port / Expand Pin for SOExternal
SymbolIOFunctionConnection
PMT42/EXSCK1
PMT43/EXCLOIO/OI/O Port / Expand Pin for System ClockExternal
SMVDD1Power Supply Input Voltage for Meter1, Meter2External
SMVSS1Ground Potential for Meter1, Meter2External
SMVDD2Power Supply Input Voltage for Meter3, Meter4External
SMVSS2Ground Potential for Meter3, Meter4External
SMVDD3Power Supply Input Voltage for Meter5, Meter6External
SMVSS3Ground Potential for Meter5, Meter6External
At DJ2 device shared with PCM0/WAIT pin of FG2
device (PCM0 has to be configured to output for intern al
communication)
IReset InputExternal
ISerial Clock Input
Internal to
FG2
Internal to
FG2
Internal to
FG2
Notes: 1. Set PMT3n = “0” (Port output = 0) and PMMT3n = “1” (Input mode)
2. Not used at D_Line (n = 6,7)
set PMT3n = “0” (Port output = 0) and PMMT3n = “1” (Input mode)
68
Preliminary User’s Manual U17763EE1V1UD00
Page 69
Chapter 3 Pin Function of MTRC
Table 3-2: List of Pin Functions (1/2)
SymbolAlternate Function I/O CircuitRecommended connection
PMT00
PMT01
A-1
PMT02
PMT03
SM11
SM12Leave open
SM13Leave open
SM14Leave open
SM21Leave open
B-1
SM22Leave open
SM23Leave open
SM24Leave open
PMT10/SM31
PMT11/SM32
PMT12/SM33
PMT13/SM34
PMT14/SM41
PMT15/SM42
PMT16/SM43
PMT17/SM44
PMT20/SM51
PMT21/SM52
PMT22/SM53
PMT23/SM54
PMT24/SM61
PMT25/SM62
PMT26/SM63
PMT27/SM64
Meter3 PWM Output Signal (sin+)
Meter3 PWM Output Signal (sin-)
Meter3 PWM Output Signal (cos+)
Meter3 PWM Output Signal (cos-)
Meter4 PWM Output Signal (sin+)
Meter4 PWM Output Signal (sin-)
Meter4 PWM Output Signal (cos+)
Meter4 PWM Output Signal (cos-)
Meter5 PWM Output Signal (sin+)
Meter5 PWM Output Signal (sin-)
Meter5 PWM Output Signal (cos+)
Meter5 PWM Output Signal (cos-)
Meter6 PWM Output Signal (sin+)
Meter6 PWM Output Signal (sin-)
Meter6 PWM Output Signal (cos+)
Meter6 PWM Output Signal (cos-)
B-2
Input: Independently c onn ec t to M TV
Output: Leave open
Input: Independently c onn ec t to M TV
Output: Leave open
Input: Independently c onn ec t to M TV
Output: Leave open
Input: Independently c onn ec t to M TV
Output: Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
Leave open
or MTVSS via a resist or
DD
or MTVSS via a resist or
DD
or MTVSS via a resist or
DD
or MTVSS via a resist or
DD
Preliminary User’s Manual U17763EE1V1UD00
69
Page 70
Chapter 3 Pin Function of MTRC
Table 3-2: List of Pin Functions (2/2)
SymbolAlternate Function I/O CircuitRecommended connection
PMT30
PMT31
PMT32
PMT33
A-1
Note 1
PMT34
Note 1
PMT35
Note 1
PMT36
Note 1
PMT37
PMT40/EXSI1 Expand Pin for SID-2
PMT41/EXSO1 Expand Pin for SOD-1
PMT42/
EXSCK1
PMT43/EXCLO
Expand Pin for
SCK
Expand Pin for
System Clock
D-3
D-4
SMVDD1SMVSS1SMVDD2SMVSS2SMVDD3SMVSS3-
CLK
MTCS
MTRESET
MTV
SS
MTV
DD
SCK
SI
CLK
MTCS
SCK
Note 2
SI
Note 2
-
-
-
Note 2
SOSOinternal connected
IC1, IC2-
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTVDD or MTVSS via a resistor
Output: Leave open
Input: Independentl y con nec t to MTVDD or MTVSS via a resistor
Output: Leave open
Input: Independentl y con nec t to MTVDD or MTVSS via a resistor
Output: Leave open
Input: Independentl y con nec t to MTVDD or MTVSS via a resistor
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
Input: Independentl y con nec t to MTV
Output: Leave open
internal connected
Note 2
internal connected
internal connected
internal connected
Input: connect to MTVSS directly
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
or MTVSS via a resistor
DD
Notes: 1. If not connected to the pinout of the DJ2 device, this port has to be s et to outpu t mode and
“0”.
2. Some input pins of t he M TRC h as go t pu ll down/pull up resistors to av oid no is e e ffects that
could cause malfunction during the initialization of the FG2 device.
After MTRESET release, this resistors are active. The resistors will be deactivated after the
first rising edge of the MTCS signal. They will be reactivated if MTRES = “0”.
Therefore these resistors consumpt some currents when they’re activated.
70
Preliminary User’s Manual U17763EE1V1UD00
Page 71
Chapter 3 Pin Function of MTRC
3.3 Pin I/O Circuits
Each type of port block diagram is as follows. Then, the type of each port is shown in each chapter.
3.3.1 Type A-1
Figure 3-2: Type A-1
WR
PMMT
PMMTmn
WR
PMT
PMTmn
PMTmn
3.3.2 Type B-1
RD
WR
SM12MC
SM11 - SM14
SM21 - SM24
Selector
Address
Selector
Figure 3-3: Type B-1
SM12MC
SM11 - SM14
SM21 - SM24
Preliminary User’s Manual U17763EE1V1UD00
71
Page 72
3.3.3 Type B-2
WR
WR
WR
Chapter 3 Pin Function of MTRC
Figure 3-4: Type B-2
PMCMT
PMCMTmn
PMMT
PMMTmn
PMT
PMTmn
SM31 - SM34
SM41 - SM44
SM51 - SM54
SM61 - SM64
Selector
Selector
Address
PMTmn
3.3.4 Type D-1
WR
WR
WR
PMCMT
PMMT
PMT
RD
PMCMT41
EXSO1
PMMT41
PMT41
Figure 3-5: Type D-1
Selector
Selector
Address
Selector
PMT41/EXSO1
72
Preliminary User’s Manual U17763EE1V1UD00
Page 73
3.3.5 Type D-2
WR
WR
WR
PMCMT
PMMT
PMT
Chapter 3 Pin Function of MTRC
Figure 3-6: Type D-2
PMCMT40
PMMT40
PMT40
PMT40/EXSI
3.3.6 Type D-3
WR
WR
WR
RD
PMCMT
PMMT
PMT
EXSCK1
PMCMT42
PMMT42
PMT42
Selector
Address
EXSI1
Selector
Figure 3-7: Type D-3
Selector
PMT42/EXSCK1
Selector
Address
RD
Selector
Preliminary User’s Manual U17763EE1V1UD00
73
Page 74
3.3.7 Type D-4
WR
WR
WR
PMCMT
PMMT
PMT
Chapter 3 Pin Function of MTRC
Figure 3-8: Type D-4
PMCMT43
PMMT43
PMT43
EXCLO
Selector
PMT43/EXCLO
3.3.8 Type CLK
3.3.9 Type MTCS
RD
Selector
Address
Figure 3-9: Type CLK
CLK
pull-down enable
Selector
CLK
N-ch
74
Figure 3-10: Type MTCS
MTCS
pull-down enable
MTCS
N-ch
Preliminary User’s Manual U17763EE1V1UD00
Page 75
3.3.10 Type SCK
Chapter 3 Pin Function of MTRC
Figure 3-11: Type SCK
3.3.11 Type SI
3.3.12 Type SO
pull-up disable
SCK
Figure 3-12:Type SI
SI
pull-down enable
P-ch
SCK
SI
N-ch
Figure 3-13: Type SO
SO
SO
Preliminary User’s Manual U17763EE1V1UD00
75
Page 76
Chapter 4Port Functions
4.1 Setting Alternate Pin Functions
Set “1” to the PMCmn bit of PMCm register to set the pin to the alternate pin function.
Refer to the following table for setting the alternate pin function for every port pin.
Not any port provides alternate pin function and therefore this registers has no PMCMTmn register.
Please refer to the peripheral function chapter to get more details.
Connect to SO only if MTCS = “0”
Connect to SI only if MTCS = “0”
Connect to _SCK only if MTCS =”0”
Connect to CLK only if MTCS =”0”
Notes: 1. PMT00-PMT03 and PMT30-PMT35 haven’t got an alternate function
2. PMT34 and PMT35 are not available at DJ2
3. PMT36-PMT37 are not connected to the pinout of the D_Line.
4. The external MTCS pin signal is identical with the internal PCM0 signal.
But the switch to the alternate EXCSI1 fu nc tio n c an be del ay ed. Be ca us e th e i nte rnal ly l ast
transferred byte will be finished before the alternate EXCSI1 function will be activated, even
if the PCM0/MTCS pin signal is “0”.
Tis has to be regarded if an external component has been connected to the EXCSI1.
Note 4
Note 4
Note 4
Note 4
Preliminary User’s Manual U17763EE1V1UD00
77
Page 78
4.2 Port MT0
4.2.1 Port MT0 functions
• 4-bit I/O Port
• Port I/O data specified in 1-bit units
Chapter 4 Port Functions
Table 4-2: Port MT0 Functions
Port ModeAlternate FunctionTYPE
PMT00-A-1××PMT01-A-1××PMT02-A-1××PMT03-A-1××-
Remarks: 1. PORT:Port
PM:Port mode register
PMC:Port mode control register
PFC:Port function control register
2. ×:available
-:not avail abl e
Register
PORTPMPMC
78
Preliminary User’s Manual U17763EE1V1UD00
Page 79
Chapter 4 Port Functions
4.2.2 Register
(1)Port Register 0 (PMT0)
MTRC Port register 0 (MT0) is an 8-bit register that controls pin level read, output level write.
It can be read and written in 8-bit unit.
Figure 4-1: Port Register 0 (PMT0) Format
76543210Address
PMT00000PMT03PMT02PMT01PMT000x20undefined
R/WRRRRR/WR/WR/WR/W
PMT0nOutput data control (n= 0 - 3)
0Output 0
1Output 1
Initial
value
(2) Port MT0 Mode Register 0 (PMMT0)
This is an 8-bit register used to specify the input mode/output mode.
It can be read and written in 8-bit unit.
Figure 4-2: Port MT0 Mode Register 0 (PMMT0) Format
76543210Address
PMMT01111PMMT03PMMT02PMMT01PMMT000x250xFF
R/WRRRRR/WR/WR/WR/W
PMMT0nI/O mode control (n= 0 - 3)
0Output mode
1Input mode
Preliminary User’s Manual U17763EE1V1UD00
Initial
value
79
Page 80
Chapter 4 Port Functions
4.3 Port MT1
4.3.1 Port MT1 functions
• 8-bit output port
• Port I/O specified in 1-bit units (PMMT1 register)
• Port mode/control mode (alternate function) specified in 1-bit units (PMCMT1 register)
PM:Port mode register
PMC:Port mode control register
PFC:Port function control register
2. ×:available
-:not available
Register
PORTPMPMC
D-3×××
Preliminary User’s Manual U17763EE1V1UD00
89
Page 90
Chapter 4 Port Functions
4.7.2 Registers
(1)Port Register 4 (PMT4)
MTRC Port register 4 (MT4) is an 8-bit register that controls pin level read, output level write.
It can be read and written in 8-bit unit.
Figure 4-12: Port Register 4 (PMT4) Format
76543210Address
PMT40000PMT43 PMT42 PMT41 PMT400x24undefined
R/WRRRRR/WR/WR/WR/W
PMT4nOutput data control (n= 0 - 3)
0Output 0
1Output 1
Initial
value
(2)Port Mode Register 4 (PMMT4)
It can be read and written in 8-bit unit.
Figure 4-13: Port Mode Register 4 (PMMT4) Format
76543210Address
PMMT41111PMMT43PMMT42PMMT41PMMT400x290xFF
R/WRRRRR/WR/WR/WR/W
Initial
value
90
PMMT4nOutput data control (n= 0 - 3)
0Output mode
1Input mode
Preliminary User’s Manual U17763EE1V1UD00
Page 91
Chapter 4 Port Functions
(3) Port Mode Control Register 4 (PMCMT4)
It can be read and written in 8-bit unit.
Figure 4-14: Port Mode Control Register 4 (PMCMT4) Format
7654 3 2 1 0Address
PMCMT40000PMCMT43PMCMT42PMCMT41PMCMT400x2C0x00
R/WRRRRR/WR/WR/WR/W
PMCMT43PMCMT43 mode control
0I/O port
1E XCLO output
PMCMT42PMCMT42 mode control
0I/O port
1
PMCMT41PMCMT41 mode control
0I/O port
1
EXSCK1
EXSO1 output
output
Note
Note
Initial
value
PMCMT40PMCMT40 mode control
0I/O port
1
EXSI1 Input
Note
Note: The alternate function is only available if MTCS = “0”.
When MTCS = “1”, each I/O status is as follows.
Pin nameStatus
EXSCK1“H” level output
EXSO1“L” level output
EXSI1Input disabled
Preliminary User’s Manual U17763EE1V1UD00
91
Page 92
Chapter 5Clock Generator
5.1 Ring Oscillator
To support a high frequency clock source for the MTRC an internal high speed Ring Oscillator is implemented in the MTRC. This R ing Oscillator is controll ed with SFRs to realize sto p, restart and calibration.
After the release of the MTR ESET
the MTCS signal will be set from “0” to “1”.
Remark:For mass production tests the MTRC can be clocked alternatively direct from the FG2
device via the CLKO UT pi n. T his pi n i s inte rn ally c onne ct ed w ith the CLK pi n o f the MTRC.
Due to EME reason this mode is not useful for real applications.
5.1.1 Autocalibration function
At the first sta rt o f the ring oscillator i t is uncalibrated and t her efo re si gni fic an t d ev iat ion s from i ts b asi c
frequency (8 MHz) could be possible.
The Ring Oscillato r Unit s upplies an autoca libration function. Wi th 5 spe cified cal ibration pulses at the
CS pin of the MTRC (therefore PCM0/WAIT pin at the FG2) direct after MTRES release, the Ring Oscillator self-calibratio n unit adj us ts the fre que nc y iterat iv ely.
The calculated calib ration factor is stored in the MRCAL regis ter. This register controls the cal ibration
unit of the Ring Oscillator to set its frequency to 8 MHz.
5.1.2 Ring Oscillator states
With the Ring Oscillator 3 different states have to be separated:
• C ali br ati on Mod e
pin the Ring Oscillator is sto pped. It will be automatical ly started if
• Start-up after MTRESET
• Start-up after Standby Mode release
At each state different actions are necessary to handle the Ring Oscillator. The basic separation
depends on the handling of the MRCAL register.
Preliminary User’s Manual U17763EE1V1UD00
92
Page 93
Chapter 5 Clock Generator
5.2 Ring Oscillator Control Registers
5.2.1 RingOSC Control Register (MRCTL)
The MRCTL register is an 8-bit register that controls the RingOSC operation.
This register can be read or written in 8-b it un its. Howev er, bits 1 (MRCALSF) and 0 (MRCALE RR) are
read-only.
Cautions: 1. After system reset has been release d, the MRCALEN bit can be written only one
time.
2. When the MRON bit = 0, the MRCLKSEL bit can’t be written.
Figure 5-1: RingOSC Control Register (MRCTL) Format (1/2)
76543210AddressInitial value
MRCTLMRONMRCL KSEL0MRCALEN00MRCAL SF MRCALERR0x2E0x5 0
After Reset01010000
R/WR/WR/WRR/WRRRR
MRONOperation / Stop of RingOSC and MRNGCTL operation control
0Ring Oscillator stopped
1Ring Oscillator enabled
This bit will be set when MRCLKSEL = 1 and a rising edge at MTCSP pin occurs.
Cautions: 1. After MTRESET and MTCS = “1” the MRON bit is changed from “0” to “1” by hard-
ware.
2. To save power consumption the Ring Oscillator can be stopped by clearing the
MRON bit to “0”. After that, the MTRC has to be woken up via the PCM0/CS signal.
The MRCAL register has to be updated, too.
MRCLKSELSystem clock selection for meter
0CLK as input for clock supply by FG2
1internal Ring Oscillator as clock source
Caution:If MRON bit = “0” (Ring Oscillator stopped for power saving) no MTRC register
access is possible. Therefor the MRON bit can’t be set to “1” (Ring Oscillator as
clock source)
Preliminary User’s Manual U17763EE1V1UD00
93
Page 94
Chapter 5Clock Generator
Figure 5-1: RingOSC Control Register for the Meter (MRCTL) Format (2/2)
MRCALENRing Oscillator frequency calibration operation control
0Calibration disabled
1Calibration enabled
Caution: After the MTRESET
pin has been released, the MRCALEN bit can be written only one
time.
MRCALSFRingOSC frequency calibration operation status flag
0Ring Oscillator calibration procedure is not active
1during the Ring Oscillator calibration procedure
The MRCALSF bit will be set to “1” when the MRON bit = 1(ring oscillator activated) and the MRCALEN
bit = “1” (MTRC is set to calibration mode)
The MRCALSF bit will be reset to “0” by the following condition:
•when MRON bit = “0” (ring oscillator deactivated)
•when calibration procedure was finished successful
•when calibration error occurred with MRCALEN bit = “1”
•when MRCALEN bit = “0” (calibration register MRCAL has to be rewritten manually without auto-
matic calibration procedure)
MRCALERRRingOSC frequency calibration error flag
0No calibration error
1Calibration error
The MRCALERR bit is set to “1 ”, when the rin g oscil lator ca librati on is not no rmally execute d. This will
happen, when the pulse width of the calibration pulse at the MTCS pin hasn’t got the specified high and
low pulse width, or the calibration temperature is not in the specified range.
When the MRON bit is set to “0” (ring oscillator stopped) the MRCALLERR bit will be reset to “0“.
94
Preliminary User’s Manual U17763EE1V1UD00
Page 95
Chapter 5 Clock Generator
5.2.2 RingOSC Calibration Register (MRCAL)
The MRCAL register is a 5-bit register for the RingOSC calibration operation.
This register can be read or written in 8-bit units.
This register can be se t i n a ra nge of 0x 01to 0x1F. The frequency of RingOSC will b e i ncr eas ed by the
MRCAL register value.
If the MRON bit = “0” and the MRCALEN bit = “1” (MRCT L register) the MRCAL r egister will be set to
0x10, which is the middle of its value range.
This register can be written only once:
•after MTRESET
pin release:
After setting MRON bit = 1 (done by hardware if MTCS bit = 1) and MRCALEN bit = 0 (written manually)
•after standby mode release:
After setting MRON bit from 0 to 1 while MRCALEN bit = 0
Figure 5-2: RingOSC Calibration Register (MRCAL) Format
76543210AddressInitial value
MRCAL000MRCAL4MRCAL3MRCAL2MRCAL1MRCAL00xXX0x50
After Reset00010000
R/WRRRR/WR/WR/WR/WR/W
Caution:When the MRON bit is set to 1 after a power save mode (MRON bit was “0”) this regis-
ter has to be rewritten with the formerly stored calibration value (e.g. external
EEPROM) that has f ollowed fr om the fr equency ca libration at the sp ecified temper ature and voltage.
5.3 Calibration Procedure
To calibrate the Ring Oscillator 5 specified calibration pulses of the same length at the PCM0 pin of the
FG2 are necessary. To guarante e the maxi mum deviatio n of the ca librated Ring Oscillato r this ca libration has to be performed at the specified temperature and with the specified voltage.
After the autocalib ration of the ring oscil lator the calibration cor rection value is stored in the MRCAL
register. This value has to be read out and stored in a nonvo latile memory (e.g. external EEPR OM) if
the ring oscillator has to be stopped for power save mode and woken up again after power save mode.
This is due to the fact, that the data retentio n of the MRCAL register can’t be guaranteed duri ng the
time of the stopped ring oscillator.
Please see the following procedure for the autocalibration function.
Preliminary User’s Manual U17763EE1V1UD00
95
Page 96
Chapter 5Clock Generator
Figure 5-3: Flowchart for Frequency Calibration
Initial Settings
MTRESET=1
Set PCM0 pin=1
wait for eliminating noise time
Set PCM0 pin=0
wait for oscillation stabilization time
one specified pulse output
via PCM0
auto control
No
5 specified pulse output
completion?
Yes
FG2 pin settings (SOB1, SCKB1, SIB1, PCM0).
Setting to form the specified pulse via PCM0 (Timer etc.)
RingOSC oscillation start, enable MRINGCTL operation
(after eliminating noise time of MTCSP pin)
Set PCM0 pin=1
No calibration error?
Yes
MRCAL register read
Store in the EEPROM
soft control
serial communication
MRCALERR bit read
No
Set MRON=0
Set MTCS pin=0
96
Preliminary User’s Manual U17763EE1V1UD00
Page 97
Ring Oscillator
MTRESET pin
Chapter 5 Clock Generator
Figure 5-4: Timing Diagram for Frequency Calibration
PCM0/CS pin
MRON bit
MRCALSF bit
MRCALEN bit
"H"
RingOSC
oscillation start
enable MRINGCTL
operation
eliminating noise time
Oscillation stabilization time
Calibration
start
1st specified pulse
RingOSC count start
2nd specified pulse
Preliminary User’s Manual U17763EE1V1UD00
97
Page 98
Chapter 5Clock Generator
5.4 MTRESET Release of the MTRC
If the MTRC is reset, the MRCAL register will be reset, too. Therefore the befor ehand stored MRCAL
register value has to be written back.
Please see the following procedure for the MTRESET
Figure 5-5: Flowchart for MTRESET Release
Release of the MTRC.
Ring Oscillator is stopped
uncalibrated
RingOsc is running
calibrated
RingOsc is running
Initial Settings
MTRESET = 1
Set PCM0 pin = 1
wait for Eliminating noise time + Oscillation stabilization time
Set MRCALEN = 0
The value stored in the
EEPROM is loaded to
the MRCAL register
wait for Oscillation stabilization time
FG2 pin settings (SOB1, SCKB1, SIB1, PCM0)
RingOSC oscillation start after eliminating noise time of PCM0 pin.
MRINGCTL operation is enabled.
soft control
serial communication
98
Preliminary User’s Manual U17763EE1V1UD00
Page 99
Ring Oscillator
MTRESET pin
Chapter 5 Clock Generator
Figure 5-6: Timing for MTRES Release
Autocalibration won't performed
even for rising edge at PCM0/CS pin
PCM0/CS pin
MRON bit
MRCALSF bit
MRCALEN bit
"L"
RingOSC
oscillation start
enable MRINGCTL
operation
Calibration start
eliminating noise time
Oscillation stabilization time
Calibration disable
Preliminary User’s Manual U17763EE1V1UD00
99
Page 100
Chapter 5Clock Generator
5.5 Standby Mode Release of the Ring Oscillator
To save power, the ring oscillator could be switched off via setting the MRON bit of the MRCTL
register = 0.
During the time of the stopp ed Ring Os cill ator, the data retention of the MRCAL regi ster ca n’t be guaranteed. Therefore the before stored value of the MRCA L r egiste r ( e.g. in an external EEPROM) h as to
be write back to the MRCAL register after the waken.
The PCM0 pin of the FG2 will wake up the Ring Oscillator from its standby mode.
To switch the Ring Oscillator on again the following procedure has to be fulfilled.
Figure 5-7: Flowchart for Standby Mode Release
Set MRON=0
calibrated
RingOsc is running
(RingOsc is stopped)
Set PCM0/CS pin=0
Standby mode setting
RingOsc is stopped
uncalibrated
RingOsc
calibrated
RingOsc
Standby mode
Standby mode release
Set PCM0/CS pin=1
wait for Eliminating noise time + Oscillation stabilization time
The value stored in the
EEPROM is loaded to
the MRCAL register
wait for Oscillation stabilization time
RingOSC oscillation start. Enable MRINGCTL operation
after eliminating noise time of MTCSP pin)
soft control
serial communication
100
Preliminary User’s Manual U17763EE1V1UD00
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.