QB-MINI2. User s Manual. On-Chip Debug Emulator with Programming Function

Size: px
Start display at page:

Download "QB-MINI2. User s Manual. On-Chip Debug Emulator with Programming Function"

Transcription

1 User s Manual QB-MINI2 On-Chip Debug Emulator with Programming Function Target Devices V850 Microcontrollers 78K0R Microcontrollers 78K0 Microcontrollers 78K0S Microcontrollers Document No. U18371EJ1V0UM00 (1st edition) Date Published November 2006 NS CP(K) NEC Electronics Corporation 2006 Printed in Japan

2 [MEMO] 2 User s Manual U18371EJ1V0UM

3 MINICUBE is a registered trademark of NEC Electronics Corporation in Japan and Germany and Germany or a trademark in the United States of America. Windows is either a registered trademarks or a trademark of Microsoft Corporation in the United States and/or other countries. PC/AT is a trademark of International Business Machines Corporation. The information in this document is current as of November, 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": Computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. "Special": 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). "Specific": 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 User s Manual U18371EJ1V0UM 3

4 General Precautions for Handling This Product 1. Circumstances not covered by product guarantee If the product was disassembled, altered, or repaired by the customer If it was dropped, broken, or given another strong shock Use at overvoltage, use outside guaranteed temperature range, storing outside guaranteed temperature range If power was turned on while the USB cable or connection to the target system was in an unsatisfactory state If the cable of the USB cable, the target cable, or the like was bent or pulled excessively If the product got wet If this product is connected to the target system when there is a potential difference between the GND of this product and GND of the target system. If the connectors or cables are plugged/unplugged while this product is in the power-on state. If excessive load is applied to the connectors or sockets. If a metal part of the interface connector or another such part comes in contact with an electrostatic charge If specifications other than those specified are used for the USB port 2. Safety precautions The product may become hot depending on the status of use. Be careful of low temperature burns and other dangers due to the product becoming hot. Be careful of electrical shock. There is a danger of electrical shock if the product is used as described above in 1 Circumstances not covered by product guarantee. Do not use a device that was used for on-chip debugging as the official product. 4 User s Manual U18371EJ1V0UM

5 INTRODUCTION Readers This manual is intended for users who wish to perform debugging using the QB-MINI2 (generic name: MINICUBE2). The readers of this manual are assumed to be familiar with the device functions and usage, and to have knowledge of debuggers and flash programming. Purpose This manual is intended to give users an understanding of the basic specifications and correct use of MINICUBE2. Organization This manual is divided into the following sections. General Names and functions of hardware Self-testing Firmware update How to Read This Manual It is assumed that the readers of this manual have general knowledge in the fields of electrical engineering, logic circuits, and microcontrollers. This manual describes the basic setup procedures. To understand the basic specifications and usages of MINICUBE2 Read this manual according to the CONTENTS. To know the manipulations, command functions, and other software-related settings of MINICUBE2 See the user s manual of the debugger to be used. Conventions Note: Footnote for item marked with Note in the text Caution: Information requiring particular attention Remark: Supplementary information Numeric representation: Binary... xxxx or xxxxb Decimal... xxxx Hexadecimal... xxxxh Prefix indicating power of 2 (address space, memory capacity): K (kilo): 2 10 = 1,024 M (mega): 2 20 = 1,024 2 User s Manual U18371EJ1V0UM 5

6 Terminology The meanings of the terms used in this manual are described in the table below. Term Meaning MINICUBE2 Generic name of QB-MINI2 Target device This is the device to be emulated. Target system This is the system to be debugged (user-created system). It includes software and hardware created by the user. OCD unit OCD is an abbreviation of On-Chip Debug The OCD unit means the debug function block embedded in the target device. Firmware Program embedded in the device for controlling MINICUBE2 QB-Programmer GUI software used to perform flash programming Related Documents Please use the following documents in conjunction with this manual. The related documents listed below may include preliminary versions. However, preliminary versions are not marked as such. Documents Related to Development Tools (User s Manuals) Document Name QB-MINI2 On-Chip Debug Emulator with Programming Function Document Number This document ID850QB Ver Integrated Debugger Operation U17964E ID78K0-QB Ver Integrated Debugger Operation U17437E ID78K0S-QB Ver Integrated Debugger Operation U17287E ID78K0R-QB Ver Integrated Debugger Operation U17839E Caution The related documents listed above are subject to change without notice. Be sure to use the latest version of each document for designing, etc. Documents Related to Development Tools (Documents except User s Manuals) Document Name Document Number QB-MINI2 Operating Precautions ZUD-CD E QB-Programmer Programming GUI Operation ZUD-CD E MINICUBE2 Diagnostic Tool ZUD-CD E MINICUBE OCD Checker ZUD-CD E Caution The related documents listed above are subject to change without notice. Be sure to use the latest version of each document for designing, etc. 6 User s Manual U18371EJ1V0UM

7 CONTENTS CHAPTER 1 OVERVIEW Features Notes Before Using MINICUBE Supported Devices Hardware Specifications CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE Names of Supplied Hardware Part Names and Functions of MINICUBE Part Names and Functions of 78K0-OCD Board CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Target System Design Pin assignment Circuit connection examples Connection of reset pin Mounting connector onto target system On-Chip Debugging Debug functions System configuration System startup procedure System shutdown procedure Securing of user resources and setting of security ID Cautions on debugging Flash Programming Specifications of programming function System configuration System startup procedure Usage examples System shutdown procedure Cautions on flash programming...49 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Target System Design Pin assignment Circuit connection examples Connection of reset pin Cautions on target system design Mounting connector onto target system On-Chip Debugging Debug functions System configuration System startup procedure System shutdown procedure...76 User s Manual U18371EJ1V0UM 7

8 4.2.5 Clock setting Securing of user resources and setting of security ID Cautions on debugging Flash Programming Specifications of programming function System configuration System startup procedure Usage examples System shutdown procedure Cautions on flash programming CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Target System Design Pin assignment Circuit connection example Connection of reset pin Connection of INTP pin Connection of X1 and X2 pins Mounting connector onto target system On-Chip Debugging Debug functions System configuration System startup procedure System shutdown procedure Securing of user resources Debugging of alternate-functions of X1 and X2 pins Cautions on debugging Flash Programming Specifications of programming function System configuration System startup procedure Usage examples System shutdown procedure Cautions on flash programming CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Target System Design Pin assignment Circuit connection example Connection of reset pin Mounting connector onto target system On-Chip Debugging Debug functions System configuration System startup procedure System shutdown procedure Securing of user resources and setting of security ID and on-chip debug option byte Cautions on debugging User s Manual U18371EJ1V0UM

9 6.3 Flash Programming Specifications of programming function System configuration System startup procedure Usage examples System shutdown procedure Cautions on flash programming CHAPTER 7 SELF-TESTING System Configuration Self-Testing Procedure CHAPTER 8 FIRMWARE UPDATE System Configuration Firmware Update Procedure User s Manual U18371EJ1V0UM 9

10 CHAPTER 1 OVERVIEW MINICUBE2 is an on-chip debug emulator with flash programming function, which is used for debugging and programming a program to be embedded in on-chip flash memory microcontrollers. 1.1 Features On-chip debugging Can debug with the target microcontroller connected to the target system. Flash memory programming Can write programs to the on-chip flash memory of microcontrollers. USB connection Can be connected to the host machine via USB interface 2.0 or 1.1. Since MINICUBE2 operates on power supplied via USB, an external power supply is unnecessary. Variety of supported devices and expandability MINICUBE2 supports a wide variety of NEC Electronics 8- to 32-bit on-chip flash memory microcontrollers. More devices can be supported by upgrading firmware embedded in MINICUBE2. Self-testing function MINICUBE2 has a self-testing function, which is used to detect faults in MINICUBE2 and perform maintenance. 10 User s Manual U18371EJ1V0UM

11 CHAPTER 1 OVERVIEW 1.2 Notes Before Using MINICUBE2 Chapters 1 and 2 present an overview and the basic specifications of MINICUBE2, and the following chapters provide separate descriptions for the target devices and the purpose of use. To utilize this manual effectively, refer to the following table and see the relevant chapter for your target device and purpose of use. Table 1-1. Chapters Corresponding to Usage Target Device Purpose of Use Relevant Chapter V850 78K0 78K0S 78K0R CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Target system design 3.1 Target System Design On-chip debugging 3.2 On-Chip Debugging Flash memory programming 3.3 Flash Programming CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Target system design 4.1 Target System Design On-chip debugging 4.2 On-Chip Debugging Flash memory programming 4.3 Flash Programming CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Target system design 5.1 Target System Design On-chip debugging 5.2 On-Chip Debugging Flash memory programming 5.3 Flash Programming CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Target system design 6.1 Target System Design On-chip debugging 6.2 On-Chip Debugging Flash memory programming 6.3 Flash Programming - MINICUBE2 self-testing CHAPTER 7 SELF-TESTING - Expansion of supported devices CHAPTER 8 FIRMWARE UPDATE 1.3 Supported Devices Access the following MINICUBE2 information site or refer to the document for details on the devices that support debugging and flash programming with MINICUBE2. The document describes the development tools that are required as the support conditions, serial interface and operating precautions, so be sure to read the document, in addition to this manual. MINICUBE2 information site URL: Remark This website just posts the supported target devices. For details on the development tools that are required as the support conditions, refer to the document below. Document Document name: QB-MINI2 Operating Precautions User s Manual U18371EJ1V0UM 11

12 CHAPTER 1 OVERVIEW 1.4 Hardware Specifications This section describes the MINICUBE2 hardware specifications. The specifications related to the on-chip debug and flash memory programming functions are described in the following chapters. Table 1-2. Hardware Specifications Classification Item Specifications MINICUBE2 Host machine interface Target interface Operating power supply Supplied via USB interface (5 V) Operating environment conditions Temperature: ±0 to +40 C Humidity: 10 to 80% RH (no condensation) Storage environment conditions Temperature: -15 to +60 C Humidity: 10 to 80% RH (no condensation) External dimensions mm Weight Approximately 40 g Target host machine PC98-NX Series, IBM PC/AT TM compatibles Target OS Windows TM 98, Windows Me, Windows 2000, Windows XP USB 2.0 (1.1 compatible) USB cable 2 m Current consumption 500 ma max. Target cable length 16-pin cable: 10 cm 10-pin cable: 10 cm Supported connector 2.54 mm pitch general-purpose connector Supply voltage 3.1 V (typ.) or 5.0 V (typ.) Supply current 100 ma max. Current consumption 8 ma (typ.) Voltage range 1.65 to 5.5 V 12 User s Manual U18371EJ1V0UM

13 CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE This chapter describes the part names and functions of MINICUBE2 and its accessories. The part names described in this chapter are used throughout this document. This chapter provides an overview of the various functions. Reading it through, the reader will gain a basic grasp of MINICUBE2 and the self-check board that will facilitate reading of subsequent chapters. While reading this chapter, also check if the hardware has a defect. 2.1 Names of Supplied Hardware Figure 2-1 shows the names of hardware supplied with MINICUBE2. Figure 2-1. Names of Supplied Hardware MINICUBE2 USB cable 16-pin target cable 10-pin target cable 78K0-OCD board (A 20 MHz oscillator mounted) User s Manual U18371EJ1V0UM 13

14 CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE 2.2 Part Names and Functions of MINICUBE2 Figure 2-2 shows the part names of the MINICUBE2 main unit. For their functions, refer to (1) to (5) below. Figure 2-2. Part Names of MINICUBE2 Target interface connector USB interface connector Mode LED Mode select switch Power select switch (1) Mode select switch This switch is used to select the target device. Table 2-1 describes the setting details. This switch is set to M2 at shipment. Table 2-1. Description of Mode Select Switch Setting Description M1 M2 Sets 78K0S or 78K0R microcontroller as target device Sets V850 or 78K0 microcontroller as target device (factory setting) (2) Power select switch This switch is used to set the power supplied to the target system. Table 2-2 describes the setting details. This switch is set to 3 at shipment. Caution Do not change the switch setting while the USB cable is connected. Table 2-2. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. (Factory setting) The supplied power is fed back to MINICUBE2 and used only for power detection. 5 5 V is supplied from MINICUBE2 to the target system Note. The supplied power is fed back to MINICUBE2 and used only for power detection. T Power supply of the target system is used. MINICUBE2 only detects the power for the target system. Note The maximum rating of the current is 100mA, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. 14 User s Manual U18371EJ1V0UM

15 CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE (3) USB interface connector This is a connector used to connect MINICUBE2 with the host machine, via a USB cable. A USB 2.0 compliant mini-b connector (UX60A-MB-5ST: Made by Hirose Electric Co., Ltd.) is employed. (4) Target interface connector This is a connector used to connect MINICUBE2 with the target system, via a 16-pin target cable. Connect the 78K0-OCD board for debugging a 78K0 microcontroller. To prevent the 78K0-OCD board from being inserted by mistake, pin 11 is removed at shipment. Since this connector is compatible with 16-core 2.54 mm pitch general-purpose connectors (female), a commercially available cable can be substituted. (5) Mode LED The appearance of the mode LED changes according to the status of hardware and software, as shown in Table 2-3. Mode LED Appearance Table 2-3. Mode LED Status Description Color USB Connection Target VDD Detection Software Operation Status - Extinguished Not Not detected Not yet started connected White Flashing Connected Not detected Not yet started Glowing Detected Not yet started Blue Glowing A debugger for V850 microcontrollers has been started and CPU is in the break mode. Flashing A debugger for V850 microcontrollers has been started and the CPU is running, or a program is being downloaded. Orange Glowing A debugger for 78K0 microcontrollers has been started and the CPU is in the break mode. Flashing A debugger for 78K0 microcontrollers has been started and the CPU is running, or a program is being downloaded. Green Glowing A debugger for 78K0S microcontrollers has been started and the CPU is in the break mode. The QB-Programmer has been started and is waiting for execution processing. Alternatively, execution processing has been completed. Flashing A debugger for 78K0S microcontrollers has been started and the CPU is running, or a program is being downloaded. Yellow Glowing A debugger for 78K0R microcontrollers has been started and the CPU is in the break mode. Flashing A debugger for 78K0R microcontrollers has been started and the CPU is running, or a program is being downloaded. A command from the QB-Programmer is being executed for the flash memory. Red Glowing A command from the QB-Programmer is ended abnormally (results in error) Illumination The illumination mode is entered when MINICUBE2 is connected to a USB interface and 15 seconds or longer have elapsed. This mode is also entered when the debugger is terminated normally. User s Manual U18371EJ1V0UM 15

16 CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE 2. 3 Part Names and Functions of 78K0-OCD Board The 78K0-OCD board is used for debugging a 78K0 microcontroller (not used for flash programming). Figure 2-3 illustrates the external view of the 78K0-OCD board. The name of each part is printed on the 78K0-OCD board. For each function, refer to (1) to (4), below. Figure 2-3. Part Names of 78K0-OCD Board (1) CLK1 For clock supply to the target device, a 14-pin DIP socket is implemented as CLK1. A 14-pin type oscillator (5 V) or a parts board that can configure an oscillation circuit can be mounted on the 14-pin DIP socket. A parts board such as the (manufactured by PRECI-DIP) can be used with this socket to configure oscillation circuit. (2) CN1 This is a connector used to connect MINICUBE2 with the target interface connector of MINICUBE2. To prevent the 78K0-OCD board from being inserted by mistake, a dummy pin is mounted in the place of pin 11 in CN1. (3) CN2 This is a connector used to connect MINICUBE2 with the target system, via a 10-pin target cable. A 10-core 2.54 mm pitch general-purpose connector (TSM L-DV) is employed. (4) CN3 This is a connector used to connect MINICUBE2 with the target system, via a 16-pin target cable. A 16-core 2.54 mm pitch general-purpose connector (TSM L-DV) is employed. 16 User s Manual U18371EJ1V0UM

17 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER This chapter describes how to use MINICUBE2 when performing on-chip debugging and flash programming for a V850 microcontroller. On-chip debugging is a method to debug a microcontroller mounted on the target system, using a debug function implemented in the device. Since debugging is performed with the target device operating on the board, this method is suitable for field debugging. Flash programming is a method to write a program to the flash memory embedded in a device. Erasing, writing and verifying the program can be performed on-board with the device. Read the following chapters if you are using MINICUBE2 for the first time with a V850 microcontroller as the target device. 3.1 Target System Design For communication between MINICUBE2 and the target system, communication circuits must be mounted on the target system. This section describes the circuit design and mounting of connectors. 3.2 On-Chip Debugging This section describes the system configuration and startup method to perform on-chip debugging with MINICUBE Flash Programming This section describes the system configuration and startup method to perform flash programming with MINICUBE2. User s Manual U18371EJ1V0UM 17

18 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.1 Target System Design This section describes the target system circuit design required for on-chip debugging and flash programming. Figure 3-1 presents an overview of the MINICUBE2 communication interface. As shown on the left side of the figure, MINICUBE2 performs serial communication with the target device on the target system. For this communication, communication circuits must be mounted on the target system. Refer to this section to design circuits appropriately. UART and CSI-H/S are supported as communication modes. Note that CSI-H/S is not available if there is no H/S pin connection. The H/S pin is the name of the pin for the programmer and this pin might not be described as an alternate-function pin in the user's manual of the device. In such a case, connect the relevant port that is assigned to the H/S pin. (In the V850ES/JJ, for example, the PCM0 pin is assigned to the H/S pin.) The pins used for serial communication are basically the same as those of the flash memory programmer (such as PG-FP4), but some devices do not support some of them. Refer to the document QB-MINI2 Operating Precautions and check the supported pins. Figure 3-1. Outline of Communication Interface Communication circuits must be mounted on the target system. Target device Serial communication (UART, CSI-H/S) Target system MINICUBE2 USB communication Host machine 18 User s Manual U18371EJ1V0UM

19 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Pin assignment This section describes the interface signals used between MINICUBE2 and the target system. Table 3-1 lists the pin assignment. Table 3-2 describes the functions of each pin. The pin assignment varies depending on whether CSI-H/S or UART is used, so design the circuit appropriately according to the circuit connection examples described on the following sections. Pin No. Table 3-1. Pin Assignment Pin Name Note CSI-H/S Used UART Used TOP VIEW 1 GND 2 RESET_OUT 3 SI RXD Pin 1 4 VDD 5 SO TXD 6 R.F.U. Target system 7 SCK R.F.U. 8 H/S R.F.U. 9 CLK 10 R.F.U. 11 R.F.U. 12 FLMD1 13 R.F.U FLMD0 15 RESET_IN 16 R.F.U. Note Signal names in MINICUBE2 Pin assignment of target connector to be mounted on target system Table 3-2. Pin Functions Pin Name IN/OUT Note Description RESET_IN IN Pin used to input reset signal from the target system RESET_OUT OUT Pin used to output reset signal to the target device CLK OUT Pin used to output clock signal to the target device FLMD0 OUT Pin used to set the target device to debug mode or programming mode FLMD1 OUT Pin used to set programming mode RxD/SI IN Pin used to receive command/data from the target device TxD/SO OUT Pin used to transmit command/data to the target device SCK OUT Pin used to output clock signal for 3-wire serial communication H/S IN Pin used to input handshake signal from the target device R.F.U. - This pin is not used, so leave it open. Note As seen from MINICUBE2 User s Manual U18371EJ1V0UM 19

20 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Circuit connection examples The circuit design on the target system varies depending on the communication interface mode. Refer to the following table and see the relevant circuit connection example. Caution The constants described in the circuit connection example are reference values. If you perform flash programming aiming at mass production, thoroughly evaluate whether the specifications of the target device are satisfied. Table 3-3. Corresponding Circuit Connection Diagrams Communication Interface Mode Refer to: UART Figure 3-2 CSI-H/S Figure User s Manual U18371EJ1V0UM

21 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Figure 3-2. Recommended Circuit Connection When UART Is Used for Communication Interface V DD V DD V DD Target connector 3 to 10 kω Target device 1 GND 2 RESET_OUT 3 RXD Note 1 4 VDD 5 TXD Note 1 6 R.F.U. 7 R.F.U. 8 R.F.U. 9 CLK Note 2 10 R.F.U. 11 R.F.U. 12 FLMD1 Note 3 13 R.F.U. 14 FLMD0 Note 3 15 RESET_IN Note 4 16 R.F.U. Note 5 10 kω 1 kω V DD 1 to 10 kω 1 to 10 kω 10 kω 100 Ω GND _RESET TXD VDD RXD X1 X2 FLMD1 FLMD0 Note 6 Port X Clock circuit Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. Read the serial interface pin names on the target device side as those for flash programming supported by the target device. 2. This pin may be used to supply an external clock during flash programming (4, 8 or 16 MHz). For the connection, refer to the user's manual for the target device. 3. The alternate function of this pin can be used because this pin goes to Hi-Z when debugging. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is not required when only flash programming is performed. 6. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. User s Manual U18371EJ1V0UM 21

22 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Figure 3-3. Recommended Circuit Connection When CSI-H/S Is Used for Communication Interface V DD V DD V DD V DD Target connector 1 to 10 kω 3 to 10 kω Target device GND RESET_OUT SI Note 1 VDD SO Note 1 R.F.U. SCK H/S CLK Note 2 R.F.U. R.F.U. FLMD1 Note 3 R.F.U. FLMD0 Note 3 RESET_IN Note 4 R.F.U Note 5 1 to 10 kω 1 to 10 kω V DD 1 to 10 kω 10 kω 100 Ω GND _RESET SO VDD SI SCK H/S X1 X2 FLMD1 FLMD0 Note 6 Port X Clock circuit 10 kω 1 kω Reset connector RESET signal Notes 1. Connect SO (transmit side) of the target device to SI (receive side) of the target connector, and SO (transmit side) of the target connector to SI (receive side) of the target device. Read the serial interface pin names on the target device side as those for flash programming supported by the target device. 2. This pin may be used to supply an external clock during flash programming (4, 8 or 16 MHz). For the connection, refer to the user's manual for the target device. 3. The alternate function of this pin can be used because this pin goes to Hi-Z when debugging. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is not required when only flash programming is performed. 6. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω 22 User s Manual U18371EJ1V0UM

23 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Connection of reset pin This section describes the connection of the reset pin, for which special attention must be paid, in circuit connection examples shown in the previous section. During on-chip debugging, a reset signal from the target system is input to MINICUBE2, masked, and then output to the target device. Therefore, the reset signal connection varies depending on whether MINICUBE2 is connected. For flash programming, the circuit must be designed so that the reset signals of the target system and MINICUBE2 do not conflict. Select one of the following methods and connect the reset signal in the circuit. The details of each method are described on the following pages. (1) Automatically switching the reset signal via series resistor (recommended; described in recommended circuit connection in the previous section) (2) Manually switching the reset signal with jumper (3) Resetting the target device by power-on clear (POC) only User s Manual U18371EJ1V0UM 23

24 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (1) Automatically switching the reset signal via series resistor Figure 3-4 illustrates the reset pin connection described in Circuit connection examples. This connection is designed assuming that the reset circuit on the target system contains an N-ch open-drain buffer (output resistance: 100Ω or less). The VDD or GND level may be unstable when the logic of RESET_IN/OUT of MINICUBE2 is inverted, so observe the conditions described below in Remark. Figure 3-4. Circuit Connection with Reset Circuit That Contains Buffer MINICUBE2 Target device RESET_OUT _RESET Reset connector V DD V DD RESET_IN R1 R2 Buffer Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. Pull-up resistor R2 is not required if the buffer of the reset circuit consists of CMOS output. The circuit enclosed by a dashed line is not required when only flash programming is performed. Figure 3-5 illustrates the circuit connection for the case where the reset circuit on the target system contains no buffers and the reset signal is only generated via resistors or capacitors. Design the circuit, observing the conditions described below in Remark. Figure 3-5. Circuit Connection with Reset Circuit That Contains No Buffers MINICUBE2 Target device Reset connector RESET_OUT RESET_IN R1 _RESET R2 V DD Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. The circuit enclosed by a dashed line is not required when only flash programming is performed. 24 User s Manual U18371EJ1V0UM

25 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (2) Manually switching the reset signal with jumper Figure 3-6 illustrates the circuit connection for the case where the reset signal is switched using the jumper, with or without MINICUBE2 connected. This connection is simple, but the jumper must be set manually. Figure 3-6. Circuit Connection for Switching Reset Signal with Jumper Target connector Jumper Target device 1 RESET_OUT 2 _RESET 3 Reset connector RESET_IN RESET signal * Jumper setting When MINICUBE2 is connected: When MINICUBE2 is not connected: 1-2 shorted 2-3 shorted (3) Resetting the target device by power-on clear (POC) only Figure 3-7 illustrates the circuit connection for the case where the target device is only reset via POC without using the reset pin. RESET_OUT is valid only when the debugger is running or during flash programming. The operation is not guaranteed if the power to the target system is shut down during debugging. Note that the POC function cannot be emulated. Figure 3-7. Circuit Connection for the Case Where Target Device Is Only Reset via POC V DD Target connector RESET_OUT 1 to 10 kω Target device _RESET RESET_IN User s Manual U18371EJ1V0UM 25

26 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. A 2.54 mm pitch 16-pin general-purpose connector can be used. The following products are recommended. HIF3FC-16PA-2.54DS (right-angle type, made by Hirose Electric Co., Ltd.) HIF3FC-16PA-2.54DSA (straight type, made by Hirose Electric Co., Ltd.) PL (right-angle type, made by Sumitomo 3M, Ltd.) PL (straight type, made by Sumitomo 3M, Ltd.) Compact connectors and loose-wire cables are also available as options. For more information on these products, access the MINICUBE2 information site. URL: Figure mm Pitch 16-Pin General-Purpose Connector Pin Layout TOP VIEW Pin 1 Pin assignment when MINICUBE2 is connected in this direction Target system Pin assignment of target connector to be mounted on target system 26 User s Manual U18371EJ1V0UM

27 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.2 On-Chip Debugging This section describes the system configuration, startup/shutdown procedure and cautions for debugging when on-chip debugging is performed with MINICUBE Debug functions Table 3-4 lists the debug functions when a V850 microcontroller is the target device and the ID850QB is used. If a debugger other than the ID850QB (made by partner manufacturer) is used, the available functions may differ, so check the specifications of the debugger used. Table 3-4. Debug Functions Functions Specifications Security 10-byte ID code authentication Download Available Execution Go & Go, Start from Here, Come Here, Restart, step execution Hardware break 2 points Note 1 (commonly used by execution and access) Software break ROM area 4 points RAM area 2,000 points Forced break Available Note 2 RAM monitoring Available DMM (writing to memory during RUN) Available Pin masking Available (reset pin only) Time measurement (from execution start to break) Measurement resolution: 100 µs Max. measurement time: Approximately 100 hours User spaces used for debugging Internal ROM: 2 K bytes+12 bytes Internal RAM: 16 bytes max. Function pins used for debugging UART selected: RXD, TXD CSI-H/S selected: SI, SO, SCK, H/S Notes 1. The following devices are not yet supported. V850ES/KE2, V850ES/KF2, V850ES/KG2, µpd70f3733, V850ES/IE2 2. Available with restrictions. For details, refer to Cautions on debugging. User s Manual U18371EJ1V0UM 27

28 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER System configuration Figure 3-9 illustrates the system configuration for on-chip debugging. Figure 3-9. System Configuration for On-Chip Debugging <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the debugger, USB driver, device files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) 28 User s Manual U18371EJ1V0UM

29 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform on-chip debugging. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. Debugger USB driver Device file (may be unnecessary when using a partner manufacture s debugger) (2) Switch setting Set the mode select switch to M2. Set the power select switch by referring to Table 3-5. Caution Do not change the switch setting while the USB cable is connected. Table 3-5. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 3-10, before the power to the target system is turned on. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system User s Manual U18371EJ1V0UM 29

30 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 3-11, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) Debugger startup Start the debugger. The mode LED glows blue after debugger startup. For the operation after this step, refer to the user's manual for the debugger. If the debugger does not start normally or the operation is unstable, the possible causes may be the following. Communication error between MINICUBE2 and target system Whether communication is performed normally can be checked using the OCD Checker. For details, refer to the user's manual for the OCD Checker. The user resource has not been secured or the security ID has not been set To perform debugging with MINICUBE2, the debug monitor area and communication serial interface for communication must be secured and the security ID must be set. For details, refer to Securing of user resources and setting of security ID. Unsupported software (debugger, device file, or firmware) is used The software used may not support debugging of the target device. Refer to the document QB-MINI2 Operating Precautions and check the supported version. When using software provided by an NEC Electronics partner, refer to the documents prepared by the partner company. Defect of MINICUBE2 MINICUBE2 may have a defect. Refer to CHAPTER 7 SELF-TESTING. 30 User s Manual U18371EJ1V0UM

31 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER System shutdown procedure Terminate debugging and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Debugger termination Terminate the debugger. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system. User s Manual U18371EJ1V0UM 31

32 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Securing of user resources and setting of security ID The user must prepare the following to perform communication between MINICUBE2 and the target device and implement each debug function. Refer to the descriptions on the following pages and set these items in the user program or using the compiler options. Securement of memory space The shaded portions in Figure 3-12 are the areas reserved for placing the debug monitor program, so user programs and data cannot be allocated in these spaces. These spaces must be secured so as not to be used by the user program. Figure Memory Spaces Where Debug Monitor Programs Are Allocated Internal ROM space Internal RAM space Internal ROM end address Internal RAM end address 10 to 16 bytes 2 KB 4 bytes 10 bytes CSI or UART receive interrupt vector 0x70 (security ID area) 4 bytes 0x60 (interrupt vector for debugging) 4 bytes 0x0 (reset vector) : Debugging area Securement of serial interface for communication The register settings, concerning UART or CSI-H/S used for communication between MINICUBE2 and the target device, performed by the debug monitor program must not be changed. Security ID setting The ID code must be embedded in the area filled with yellow (0x70 to 0x79) in Figure 3-12, to prevent the memory from being read by an unauthorized person. 32 User s Manual U18371EJ1V0UM

33 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (a) Reset vector A reset vector includes the jump instruction for the debug monitor program. [How to secure areas] It is not necessary to secure this area intentionally. When downloading a program, however, the debugger rewrites the reset vector in accordance with the following cases. If the rewritten pattern does not match the following cases, the debugger generates an error (F0c34 when using the ID850QB). When two nop instructions are placed in succession from address 0 Before writing After writing 0x0 nop Jumps to debug monitor program at 0x0 0x2 nop 0x4 xxxx 0x4 xxxx When two 0xFFFF are successively placed from address 0 (already erased device) Before writing After writing 0x0 0xFFFF Jumps to debug monitor program at 0x0 0x2 0xFFFF 0x4 xxxx 0x4 xxxx The jr instruction is placed at address 0 (when using NEC Electronics compiler CA850) Before writing After writing 0x0 jr disp22 Jumps to debug monitor program at 0x0 0x4 jr disp22-4 mov32 and jmp are placed in succession from address 0 (when using IAR compiler ICCV850) Before writing After writing 0x0 mov imm32,reg1 Jumps to debug monitor program at 0x0 0x6 jmp [reg1] 0x4 mov imm32,reg1 0xa jmp [reg1] The jump instruction for the debug monitor program is placed at address 0 Before writing After writing Jumps to debug monitor program at 0x0 No change User s Manual U18371EJ1V0UM 33

34 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (b) Securement of area for debug monitor program The shaded portions in Figure 3-12 are the areas where the debug monitor program is allocated. The monitor program performs initialization processing for debug communication interface and RUN or break processing for the CPU. The internal ROM area must be filled with 0xFF. This area must not be rewritten by the user program. [How to secure areas] It is not necessarily required to secure this area if the user program does not use this area. To avoid problems that may occur during the debugger startup, however, it is recommended to secure this area in advance, using the compiler. The following shows examples for securing the area, using the NEC Electronics compiler CA850. Add the assemble source file and link directive code, as shown below. Assemble source (Add the following code as an assemble source file.) -- Secures 2 KB space for monitor ROM section.section "MonitorROM", const.space 0x800, 0xff -- Secures interrupt vector for debugging.section "DBG0".space 4, 0xff -- Secures interrupt vector for serial communication -- Change the section name according to serial communication mode used.section "INTCSI00".space 4, 0xff -- Secures 16 byte space for monitor ROM section.section "MonitorRAM", bss.lcomm monitorramsym, 16, 4 /* defines monitorramsym symbol */ Link directive (Add the following code to the link directive file.) The following shows an example when the internal ROM end address is 0x3ffff and internal RAM end address is 0x3ffefff. MROMSEG :!LOAD?R V0x03f800{ MonitorROM = $PROGBITS?A MonitorROM; }; MRAMSEG :!LOAD?RW V0x03ffeff0{ MonitorRAM = $NOBITS?AW MonitorRAM; }; 34 User s Manual U18371EJ1V0UM

35 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (c) Securement of communication serial interface UART or CSI-H/S is used for communication between MINICUBE2 and the target system. The settings related to the serial interface modes are performed by the debug monitor program, but if the setting is changed by the user program, a communication error may occur. To prevent such a problem from occurring, communication serial interface must be secured in the user program. [How to secure communication serial interface] Create the user program observing the following points. Serial interface registers Do not set the registers related to UART and CSI-H/S in the user program. Interrupt mask register When UART is used, do not mask receive end interrupts Note. When CSI-H/S is used, do not mask transmit end interrupts. The following shows an example. Example Setting other than below is prohibited when the target device is the V850ES/KJ2 and CSI00 is used Note CSI0IC0 x 0 x x x x x x x: Any When the target device is the V850ES/IE2, do not mask receive error interrupts. Port registers When UART is used, do not set port registers to make the TxD and RxD pins invalid. When CSI-H/S is used, do not set port registers to make the SI, SO, SCK and H/S pins invalid. The H/S pin is used as the port output for debugging. The following shows two examples. Example 1 Setting other than below is prohibited when the target device is the V850ES/KJ2 and UART0 is used PFC3 x x x x x x PMC3L x x x x x x 1 1 x: Any User s Manual U18371EJ1V0UM 35

36 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Example 2 Setting other than below is prohibited when the target device is the V850ES/HG2 and CSIB0 is used PMC4 x x x x x PMCCM x x x x x x x PMCM x x x x x x x PCM x x x x x x x Read-only Note x: Any Note The port values corresponding to the H/S pin are changed by the monitor program according to the debugger status. To perform port register settings in 8-bit units, usually the user program can use read-modify-write. If an interrupt for debugging occurs before writing, however, an unexpected operation may be performed. (d) Security ID setting This setting is required to prevent the memory from being read by an unauthorized person. Embed a security ID at addresses 0x70 to 0x79 in the internal flash memory. The debugger starts only when the security ID that is set during debugger startup and the security ID set at addresses 0x70 to 0x79 match. If bit 7 of address 0x79 is 0, however, debugging is disabled. In such a case, there are no methods to start the debugger. Debugging is mainly disabled for mass-produced devices. If the user has forgotten the security ID or to enable debugging, erase the flash memory and set the security ID again. [How to set security ID] Embed a security ID at addresses 0x70 to 0x79 in the user program. If the security ID is embedded as follows, for example, the security ID set by the debugger is ABCDEF123D4 (not case-sensitive). 36 User s Manual U18371EJ1V0UM

37 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Address Value [7:0] 0x70 0x71 0x72 0x73 0x74 0x75 0x76 0x77 0x78 0x79 0x12 0x34 0x56 0x78 0x9A 0xBC 0xDE 0xF1 0x23 0xD4 If NEC Electronics compiler CA850 is used, the security ID can be set using the Compiler Common Options menu. Figure Security ID Setting with CA850 User s Manual U18371EJ1V0UM 37

38 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Cautions on debugging This section describes cautions on performing on-chip debugging for a V850 microcontroller. Be sure to read the following to use MINICUBE2 properly. (1) Handling of device that was used for debugging Do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewrites of the flash memory cannot be guaranteed. Moreover, do not embed the debug monitor program into mass-produced products. (2) When breaks cannot be executed Forced breaks cannot be executed if one of the following conditions is satisfied. Interrupts are disabled (DI) Interrupts issued for the serial interface, which is used for communication between MINICUBE2 and the target device, are masked Standby mode is entered while standby release by a maskable interrupt is prohibited Mode for communication between MINICUBE2 and the target device is UART, and the main clock has been stopped (3) When pseudo real-time RAM monitor (RRM) function and DMM function do not operate The pseudo RRM function and DMM function do not operate if one of the following conditions is satisfied. Interrupts are disabled (DI) Interrupts issued for the serial interface, which is used for communication between MINICUBE2 and the target device, are masked Standby mode is entered while standby release by a maskable interrupt is prohibited Mode for communication between MINICUBE2 and the target device is UART, and the main clock has been stopped Mode for communication between MINICUBE2 and the target device is UART, and a clock different from the one specified in the debugger is used for communication (4) Standby release with pseudo RRM and DMM functions enabled The standby mode is released by the pseudo RRM function and DMM function if one of the following conditions is satisfied. Mode for communication between MINICUBE2 and the target device is CSI-H/S Mode for communication between MINICUBE2 and the target device is UART, and the main clock has been supplied (5) Writing to peripheral I/O registers that requires a specific sequence, using DMM function Peripheral I/O registers that requires a specific sequence cannot be written with the DMM function. 38 User s Manual U18371EJ1V0UM

39 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (6) Device with which the debugger startup is slowed When the debugger is started for the first time, chip erasure and writing of debug monitor program are performed. The following devices require about a dozen seconds for these operations. V850ES/JG2, V850ES/JJ2 V850ES/HE2, V850ES/HF2, V850ES/HG2, V850ES/HJ2 V850ES/IE2 (7) Writing of debug monitor program If the CPU operating clock setting is changed by the debugger, the debugger rewrites the debug monitor program. At this time, it takes about a dozen seconds for this operation. When using NEC Electronics debugger ID850QB, this specification applies when the setting in the Clock area in the Configuration dialog box. (8) Flash self programming If a space where the debug monitor program is allocated is rewritten by flash self programming, the debugger can no longer operate normally. (9) Emulation of POC function The POC function of the target device cannot be emulated. Make sure that the power to the target system is not shut down during debugging. (10) Operation after reset After an external pin reset or internal reset, the monitor program performs debug initialization processing. Consequently, the time from reset occurrence until user program execution differs from that in the actual device operation. (11) Debugging with real machine running without using MINICUBE2 If debugging is performed with a real machine running, without using MINICUBE2, write the user program using the QB-Programmer. Programs downloaded by the debugger include the monitor program, and such a program malfunctions if it is not controlled via MINICUBE2. User s Manual U18371EJ1V0UM 39

40 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.3 Flash Programming This section describes the system configuration and startup/shutdown procedure when flash programming is performed for a V850 microcontroller, using MINICUBE Specifications of programming function Table 3-6. Specifications of Programming Function Functions Specifications Host interface USB 2.0 (compatible with 1.1) Target interface UART or CSI-H/S Target system voltage 2.7 to 5.5 V (depends on the target device) Clock supply 16, 8, or 4 MHz clock can be supplied Clock mounted on the target system can be used Power supply 3 or 5 V (maximum current rating: 100 ma) Acquisition of device-specific Parameter file for NEC Electronics PG-FP4 is used information Security flag setting Available Standalone operation Unavailable (must be connected to host machine) System configuration Figure 3-14 illustrates the system configuration for flash programming. Figure System Configuration for Flash Programming <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the QB-Programmer USB driver, parameter files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) 40 User s Manual U18371EJ1V0UM

41 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform flash programming. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. QB-Programmer USB driver Parameter file (2) Switch setting Set the mode select switch to M2. Set the power select switch by referring to Table. Caution Do not change the switch setting while the USB cable is connected. Table 3-7. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 3-15, before the power to the target system is turned on. When the power select switch is set to T, the step of (4) Connecting the USB cable can be performed before this step. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system User s Manual U18371EJ1V0UM 41

42 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 3-16, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. The power is always supplied after MINICUBE2 is connected to the host machine with the USB cable. Caution Do not change the switch setting while the USB cable is connected. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) QB-Programmer startup Start the QB-Programmer from the Start menu of Windows. The mode LED glows green after QB-Programmer startup. A series of basic operations after this step is described in the following section. For detailed usage of the QB-Programmer, refer to the QB-Programmer Programming GUI Operation User's Manual. 42 User s Manual U18371EJ1V0UM

43 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Usage examples This section describes a series of basic operations using the QB-Programmer, using the µpd70f3732 as an example. The operations from execution of the [Autoprocedure (EPV)] command to programming for the target device are described. For other commands and their applications, refer to the QB-Programmer Programming GUI Operation User's Manual. The conditions used for a series of operations in this section are as follows. <Target system> Target device: Power supply voltage: Communication channel: µpd70f V (supplied from MINICUBE2) CSI-H/S, 2 MHz <MINICUBE2> Switches: Mode select switch: M2 Power select switch: 5 <QB-Programmer> Parameter file: Clock setting: Operation mode: Program file: Command options: Security function: 70F3732.PRM 5 MHz, x4 (oscillator on the target system side) chip sample.hex [Blank check before Erase] selected [Read verify after Program] selected [Security flag after Program] selected [Disable Read] selected User s Manual U18371EJ1V0UM 43

44 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (1) Setting of programming environment Set the programming environment, following the steps <1> to <7> described below. <1> Click the [Device] menu on the menu bar and then click [Setup...]. <2> The Device Setup dialog box appears, in which the [Standard] tab is active. Figure [Standard] Tab of Device Setup Dialog Box <3> Click the PRM File Read button to open the Parameter File Select dialog box. Select the parameter file for the target device and then click the Open button. Figure Parameter File Select Dialog Box 44 User s Manual U18371EJ1V0UM

45 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER <4> Set the items in the [Target Device Connection], [Operation Mode] and [Supply Oscillator] areas, in accordance with your programming environment. The following figure shows an example. Figure [Standard] Tab of Device Setup Dialog Box After Setting <5> The µpd70f3732 can use the [Get Security Settings] command, so click the OK button to return to the main window, click the [Device] menu and then click [Get Security Settings...]. After execution of this command, the security functions and boot area settings for the target device can be checked in the [Security flag settings] area on the [Advanced] tab in the Device Setup dialog box. For details, refer to the QB-Programmer Programming GUI Operation User's Manual. Figure [Advanced] Tab of Device Setup Dialog Box After [Get Security Settings...] Execution User s Manual U18371EJ1V0UM 45

46 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER <6> Next, set the items in the [Command options] and [Security flag settings] areas, in accordance with your programming environment. The following figure shows an example. Figure [Advanced] Tab of Device Setup Dialog Box <7> By clicking the OK button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure Completion of Programming Environment Setting 46 User s Manual U18371EJ1V0UM

47 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (2) Selection of program file Select the program file, following the steps <1> to <3> described below. <1> Click the [File] menu on the menu bar and then click [Load...]. <2> The program file select dialog box appears. Figure Program File Select Dialog Box <3> Select the program file for the target device and then click the Open button. Figure Completion of Program File Selection User s Manual U18371EJ1V0UM 47

48 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER (3) Execution of [Autoprocedure (EPV)] command Click the [Device] menu on the menu bar and then click [Autoprocedure (EPV)]. The [Blank Check], [Erase] (if the flash memory in the target device is not blank), [Program], [Verify], and [Security] commands are executed for the target device sequentially. The mode LED on MINICUBE2 flashes yellow during execution. When the command execution is completed normally, the mode LED glows green and the following window appears. Figure Completion of [Autoprocedure (EPV)] Command Execution 48 User s Manual U18371EJ1V0UM

49 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER System shutdown procedure Terminate flash programming and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Terminating the QB-Programmer Terminate the QB-Programmer if you are not going to perform programming to other devices. Remark When the QB-Programmer is terminated, the setting information is saved in the qbp.ini file. Due to this file, the same setting is maintained when the QB-Programmer is started the next time. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. When the power select switch is set to T, the step of (4) Unplugging the target cable can be performed before this step. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system Cautions on flash programming This section describes the cautions for flash programming. MINICUBE2. Be sure to read the following for the proper use of To improve the writing quality, fully understand, verify, and evaluate the following items before using MINICUBE2. Circuits are designed as described in the user's manuals for the device and MINICUBE2. The device, QB-Programmer and MINICUBE2 are used as described in each user's manual. The power supplied to the target system is stable. User s Manual U18371EJ1V0UM 49

50 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER This chapter describes how to use MINICUBE2 when performing on-chip debugging and flash programming for a 78K0 microcontroller. On-chip debugging is a method to debug a microcontroller mounted on the target system, using a debug function implemented in the device. Since debugging is performed with the target device operating on the board, this method is suitable for field debugging. Flash programming is a method to write a program to the flash memory embedded in a device. Erasing, writing and verifying the program can be performed on-board with the device. Read the following chapters if you are using MINICUBE2 for the first time with a 78K0 microcontroller as the target device. 4.1 Target System Design For communication between MINICUBE2 and the target system, communication circuits must be mounted on the target system. This section describes the circuit design and mounting of connectors. 4.2 On-Chip Debugging This section describes the system configuration and startup method to perform on-chip debugging with MINICUBE Flash Programming This section describes the system configuration and startup method to perform flash programming with MINICUBE2. 50 User s Manual U18371EJ1V0UM

51 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1 Target System Design This section describes the target system circuit design required for on-chip debugging and flash programming. Figure 4-1 and Figure 4-2 present overviews of the MINICUBE2 communication interface. For communication between MINICUBE2 and the target system, communication circuits must be mounted on the target system, as shown on the left side of the figure. Refer to this section to design circuits appropriately. Figure 4-1. Outline of Communication Interface for On-Chip Debugging Communication via X1/X2 or OCD1A/OCD1B Communication circuits must be mounted on the target system. Target device Target system 78K0-OCD board MINICUBE2 USB communication Host machine Figure 4-2. Outline of Communication Interface for Flash Programming UART communication Communication circuits must be mounted on the target system. Target device USB communication Target system MINICUBE2 Host machine User s Manual U18371EJ1V0UM 51

52 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Pin assignment This section describes the interface signals used between MINICUBE2 and the target system. Table 4-1 lists the pin assignment when a 16-pin target cable is used. Table 4-2 describes the functions of each pin. The pin assignment varies depending on whether the operation is debugging or programming, so design the circuit appropriately according to the circuit connection examples described on the following sections. Pin No. Table 4-1. Pin Assignment When Using 16-Pin Target Cable Pin Name Note TOP VIEW For Debugging For Programming (with 78K0-OCD Board Connected) 1 GND 2 RESET_OUT 3 R.F.U. RXD 4 VDD 5 R.F.U. TXD 6 R.F.U. 7 R.F.U. Pin 1 Target system 78K0-OCD board is not required for programming. 8 R.F.U. 9 CLK 10 R.F.U. 11 R.F.U R.F.U. FLMD1 13 DATA R.F.U. 14 FLMD0 15 RESET_IN R.F.U. 16 R.F.U. Note Signal names in MINICUBE Pin assignment of target connector to be mounted on target system Table 4-2. Pin Functions Pin Name IN/OUT Note 1 Description RESET_IN IN Pin used to input reset signal from the target system RESET_OUT OUT Pin used to output reset signal to the target device CLK OUT Pin used to output clock signal to the target device DATA IN/OUT Pin used to input/output for data communication during debugging FLMD0 OUT Pin used to set the target device to debug mode or programming mode FLMD1 OUT Pin used to set programming mode Note 2 RxD IN Pin used to receive command/data from the target device TxD OUT Pin used to transmit command/data to the target device R.F.U. - This pin is not used, so leave it open. Notes 1. As seen from MINICUBE2. 2. Not used in some devices. 52 User s Manual U18371EJ1V0UM

53 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Table 4-3 lists the pin assignment when a 10-pin target cable is used. The 10-pin target cable is dedicated for debugging. Use this cable if the target system is designed for MINICUBE (QB-78K0MINI) or in order to limit the usage of the connector mounted on the target system only for debugging. Table 4-3. Pin Assignment When Using 10-Pin Target Cable Pin No. Pin Name Note TOP VIEW 1 RESET_IN 2 RESET_OUT 3 FLMD0 4 VDD 5 DATA 6 GND 7 CLK 8 GND 9 R.F.U Note Signal names in MINICUBE2 Pin 1 Target system Pin assignment of target connector to be mounted on target system Table 4-4. Pin Functions Pin Name IN/OUT Note Description RESET_IN IN Pin used to input reset signal to the target system RESET_OUT OUT Pin used to output reset signal to the target device CLK OUT Pin used to output clock signal to the target device DATA IN/OUT Pin used to input/output for data communication during debugging FLMD0 OUT Pin used to set the target device to debug mode or programming mode R.F.U. - This pin is not used, so leave it open. Note As seen from MINICUBE2. User s Manual U18371EJ1V0UM 53

54 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Circuit connection examples The circuit design on the target system varies depending on the used connector and interface signals. The following (1) to (3) are the major purpose of use. Confirm the purpose, refer to Table 4-5 and see the relevant circuit connection example for specifications. Caution The constants described in the circuit connection example are reference values. If you perform flash programming aiming at mass production, thoroughly evaluate whether the specifications of the target device are satisfied. (1) Used to perform on-chip debugging and flash programming via one 16-pin connector. (2) Used to perform on-chip debugging via a 10-pin connector. * This type of circuit connection can be used with on-chip debugging emulator QB-78K0MINI. (3) Used to perform flash programming. Table 4-5. Corresponding Circuit Connection Diagrams Usage Connector Programming Debug Operating Clock Source FLMD1 Refer to: Used Interface Interface Used by Target Device pin Note1 (1) 16-pin UART X1, X2 Internal high-speed oscillator Not Figure 4-3 connector (X1 oscillator not used) provided X1 oscillator Not Figure 4-4 provided Provided Figure 4-5 OCD1A (P31), Internal high-speed oscillator Not Figure 4-6 OCD1B (P32) Note2 (X1 oscillator not used) provided X1 oscillator Not Figure 4-7 provided Provided Figure 4-8 (2) 10-pin - X1, X2 - - Figure 4-9 connector OCD1A (P31), - Figure 4-10 OCD1B (P32) Note2 (3) 16-pin connector UART Figure 4-11 Notes 1. Refer to the target device s user s manual to confirm whether an FLMD1 pin is provided. 2. The debug interface pin name varies depending on the target device. For details, confirm the target device s user s manual. 54 User s Manual U18371EJ1V0UM

55 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-3. When Both Debugging and Programming Are Performed (with X1/X2 Communication, Only Internal High-Speed Oscillator Is Used) Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U. R.F.U. R.F.U. DATA FLMD0 RESET_IN Note 5 R.F.U V DD V DD V DD 3 to 10 kω 1 to 10 kω Note 3 JP1 JP kω 1 to 1 to 10 kω kω Note 5 1 kω V DD 10 kω 1 kω Target device GND _RESET TxD V DD RxD X1 OCD1A Note 4 X2 FLMD0 Port X Note 6 Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied. During flash programming, only a clock of 4, 8, or 16 MHz can be supplied. 3. For debugging, short 1-2 of JP1 and 1-2 of JP2. For flash programming, short pin 2 of JP1 and JP2 only. For the target device operation (without MINICUBE2 connected), leave JP1 and JP2 open. 4. OCD1A may be a different name, such as P31, depending on the device used. For details, refer to the user's manual for the target device. 5. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100Ω or less). For details, refer to Connection of reset pin. 6. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10kΩ. User s Manual U18371EJ1V0UM 55

56 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-4. When Both Debugging and Programming Are Performed (with X1/X2 Communication, X1 Oscillator Is Used) (FLMD1 Pin Is Not Provided) Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U. R.F.U. R.F.U. DATA FLMD0 RESET_IN Note 5 R.F.U V DD V DD V DD 3 to 10 kω 1 to 10 kω Note 3 10 kω Clock circuit V DD Note 5 1 kω 1 to 10 kω 10 kω 1 kω Target device GND _RESET TxD V DD RxD X1 OCD1A Note 4 X2 FLMD0 Port X Note 6 Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied. During flash programming, use the clock mounted on the target system. 3. For debugging, short the jumper and mount no clock circuit. For flash programming and the target device operation (without MINICUBE2 connected), leave the jumper open and mount a clock circuit. 4. OCD1A may be a different name, such as P31, depending on the device used. For details, refer to the user's manual for the target device. 5. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 6. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10kΩ. 56 User s Manual U18371EJ1V0UM

57 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-5. When Both Debugging and Programming Are Performed (with X1/X2 Communication, X1 Oscillator Is Used) (FLMD1 Pin Is Provided) Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U. R.F.U. FLMD1 DATA FLMD0 RESET_IN Note 4 R.F.U V DD V DD V DD 3 to 10 kω 1 to 10 kω Note 3 Clock 10 kω circuit 1 kω V DD 1 to 10 kω 10 kω 1 kω Target device GND _RESET TxD V DD RxD X1 P31 X2 FLMD1 FLMD0 Port X Note 5 1 to 10 kω Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied. During flash programming, use the clock mounted on the target system. 3. For debugging, short the jumper and mount no clock circuit. For flash programming and the target device operation (without MINICUBE2 connected), leave the jumper open and mount a clock circuit. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10kΩ. User s Manual U18371EJ1V0UM 57

58 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-6. When Both Debugging and Programming Are Performed (with OCD1A/OCD1B Communication, Only Internal High-Speed Oscillator Is Used) Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U V DD V DD 3 to 10 kω 1 to 10 kω 10 kω V DD V DD Target device GND _RESET TxD V DD RxD OCD1A Note 3 X1 R.F.U. R.F.U. DATA FLMD0 RESET_IN Note 4 R.F.U V DD Note 4 1 kω 3to 10 kω 1 to 10 kω 10 kω 1 to 10 kω 1 kω X2 OCD1B Note 3 FLMD0 Note 5 Port X Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied (neither of them is used for the CPU operating clock). During flash programming, only a clock of 4, 8, or 16 MHz can be supplied. 3. OCD1A (OCD1B) may be a different name, such as P31, depending on the device used. Check the pin name with the user's manual for the target device. Since this pin is dedicated to debugging during debugging, port settings made by the user program are ignored. If this pin is assigned to an input port, the pin must be connected as shown in this figure, because it is open when MINICUBE2 is not connected. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. 58 User s Manual U18371EJ1V0UM

59 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-7. When Both Debugging and Programming Are Performed (with OCD1A/OCD1B Communication, X1 Oscillator Is Used) (FLMD1 Pin Is Not Provided) V DD V DD V DD Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U. R.F.U. R.F.U. DATA FLMD0 RESET_IN Note 4 R.F.U kω V DD Note 4 1 kω 3 to 10 kω 1 to 10 kω V DD 3 to 10 kω 10 kω 1 to 10 kω 1 kω Target device GND _RESET TxD V DD RxD OCD1A Note 3 X1 X2 OCD1B Note 3 FLMD0 Note 5 Port X Clock circuit Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied (neither of them is used for the CPU operating clock). During flash programming, only a clock of 4, 8, or 16 MHz can be supplied. 3. OCD1A (OCD1B) may be a different name, such as P31, depending on the device used. Check the pin name with the user's manual for the target device. Since this pin is dedicated to debugging during debugging, port settings made by the user program are ignored. If this pin is assigned to an input port, the pin must be connected as shown in this figure, because it is open when MINICUBE2 is not connected. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. User s Manual U18371EJ1V0UM 59

60 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-8. When Both Debugging and Programming Are Performed (with OCD1A/OCD1B Communication, X1 Oscillator Is Used) (FLMD1 Pin Is Provided) V DD V DD V DD Target connector GND RESET_OUT RxD Note 1 V DD TxD Note 1 R.F.U. R.F.U. R.F.U. CLK Note 2 R.F.U. R.F.U. FLMD1 DATA FLMD0 RESET_IN Note 4 R.F.U kω 1 kω V DD 3 to 10 kω 1 to 10 kω V DD 3 to 10 kω 1 to 10 kω 10 kω 1 to 10 kω 1 kω Target device GND _RESET TxD V DD RxD P31 Note 3 X1 X2 FLMD1 P32 Note 3 FLMD0 Note 5 Port X Clock circuit Reset connector RESET signal Notes 1. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 2. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied (neither of them is used for the CPU operating clock). During flash programming, use the clock mounted on the target system. 3. Since this pin is dedicated to debugging during debugging, port settings made by the user program are ignored. If this pin is assigned to an input port, the pin must be connected as shown in this figure, because it is open when MINICUBE2 is not connected. 4. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 5. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. 60 User s Manual U18371EJ1V0UM

61 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-9. When Only Debugging Is Performed (with X1/X2 Communication) V DD V DD V DD Target connector 1 kω Reset connector RESET signal RESET_IN Note 1 RESET_OUT FLMD0 V DD DATA GND CLK Note 3 GND R.F.U. R.F.U kω 10 kω Note 2 1 kω Target device _RESET FLMD0 V DD X2 X1 Note 4 Port X OCD1A Note 5 1 to 10 kω GND Notes 1. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 2. For debugging, mount no clock circuit. For flash programming, mount a clock circuit. 3. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied. 4. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. 5. OCD1A may be a different name, such as P31, depending on the device used. For details, refer to the user's manual for the target device. User s Manual U18371EJ1V0UM 61

62 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure When Only Debugging Is Performed (with OCD1A/OCD1B Communication) Target connector V DD V DD V DD V DD 3 to 1 kω 10 kω Reset connector RESET signal RESET_IN Note 1 RESET_OUT FLMD0 V DD DATA GND CLK Note 3 GND R.F.U. R.F.U kω 10 kω 1 kω Target device _RESET FLMD0 V DD OCD1B Note 2 OCD1A Note 2 Note 4 Port X GND 1 to 10 kω Notes 1. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 2. OCD1A (OCD1B) may be a different name, such as P31, depending on the device used. Check the pin name with the user's manual for the target device. Since this pin is dedicated to debugging during debugging, port settings made by the user program are ignored. If this pin is assigned to an input port, the pin must be connected as shown in this figure, because it is open when MINICUBE2 is not connected. 3. During debugging, the clock mounted on the 78K0-OCD board can be supplied. If no clock is mounted, a clock of 4, 8, or 16 MHz can be supplied (neither of them is used for the CPU operating clock). 4. The circuit enclosed by a dashed line is designed for flash self programming, which controls the FLMD0 pin via ports. Use the port for inputting or outputting the high level. When flash self programming is not performed, a pull-down resistance for the FLMD0 pin can be within 1 to 10 kω. 62 User s Manual U18371EJ1V0UM

63 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure When Only Programming Is Performed V DD V DD V DD Target connector GND RESET_OUT Note 1 RxD Note 2 V DD TxD Note 2 R.F.U. R.F.U. R.F.U. CLK Note 3 R.F.U to 10 kω 1 to 10 kω Target device GND _RESET TxD V DD RxD R.F.U. FLMD1 Note 4 DATA FLMD0 RESET_IN R.F.U V DD 1 to 10 kω 1 to 10 kω FLMD1 FLMD0 10 kω 1 kω Reset connector RESET signal Notes 1. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100 Ω or less). For details, refer to Connection of reset pin. 2. Connect TxD (transmit side) of the target device to RxD (receive side) of the target connector, and TxD (transmit side) of the target connector to RxD (receive side) of the target device. 3. When the input clock to the target device is generated on the target system, CLK does not need to be connected. Please leave it open when no connection is made. When no input clock is generated, or the dedicated program adapter (FA series) is used, CLK can be used as a pin to feed the external clock (4/8/16 MHz) to the target device. For the connection, refer to the user's manual for the target device. 4. If FLMD1 pin is provided on the target device, the connection must be made. If FLMD1 pin is not provided on the target device, leave it open. User s Manual U18371EJ1V0UM 63

64 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Connection of reset pin This section describes the connection of the reset pin, for which special attention must be paid, in circuit connection examples shown in the previous section. During on-chip debugging, a reset signal from the target system is input to MINICUBE2, masked, and then output to the target device. Therefore, the reset signal connection varies depending on whether MINICUBE2 is connected. For flash programming, the circuit must be designed so that the reset signals of the target system and MINICUBE2 do not conflict. Select one of the following methods and connect the reset signal in the circuit. The details of each method are described on the following pages. (1) Automatically switching the reset signal via resistor (recommended; described in recommended circuit connection in the previous section) (2) Automatically switching the reset signal via selector logic (3) Manually switching the reset signal with jumper (4) Resetting the target device by power-on clear (POC) only 64 User s Manual U18371EJ1V0UM

65 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (1) Automatically switching the reset signal via resistor Figure 4-10 illustrates the reset pin connection described in Circuit connection examples. This connection is designed assuming that the reset circuit on the target system contains an N-ch open-drain buffer (output resistance: 100Ω or less). The VDD or GND level may be unstable when the logic of RESET_IN/OUT of MINICUBE2 is inverted, so observe the conditions described below in Remark. Figure Circuit Connection with Reset Circuit That Contains Buffer MINICUBE2 Target device RESET_OUT _RESET Reset connector V DD V DD RESET_IN R1 R2 Buffer Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. Pull-up resistor R2 is not required if the buffer of the reset circuit consists of CMOS output. The circuit enclosed by a dashed line is not required when only flash programming is performed. Figure 4-11 illustrates the circuit connection for the case where the reset circuit on the target system contains no buffers and the reset signal is only generated via resistors or capacitors. Design the circuit, observing the conditions described below in Remark. Figure Circuit Connection with Reset Circuit That Contains No Buffers MINICUBE2 Target device Reset connector RESET_OUT RESET_IN R1 _RESET R2 V DD Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. The circuit enclosed by a dashed line is not required when only flash programming is performed. User s Manual U18371EJ1V0UM 65

66 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (2) Automatically switching the reset signal via selector logic Figure 4-14 illustrates the circuit connection for the case where the reset signal is switched automatically using the selector logic, with or without MINICUBE2 connected. When using flash self programming, refer to Figure Caution The reset circuit is disconnected if flash self programming is performed (FLMD0 = HI) without MINICUBE2 connected, so no signals can be input to the _RESET pin. Figure Circuit Connection for Automatically Switching Reset Signal with Selector Logic (When Not Using Flash Self Programming) Target connector V DD RESET_OUT 1 to 10 kω A Selector Target device RESET_IN B _RESET FLMD0 Note 1 to 10 kω HI: Side A LOW: Side B Reset connector RESET signal Note FLMD0 is high level when MINICUBE2 is connected, and FLMD0 is pulled down when MINICUBE2 is not connected. Figure Circuit Connection for Automatically Switching Reset Signal with Selector Logic (When Using Flash Self Programming) Target connector V DD RESET_OUT 10 kω A Target device RESET_IN B _RESET FLMD0 10 kω 1 kω HI: Side A LOW: Side B FLMD0 Port X Note Reset connector RESET signal Note This circuit is designed for flash self programming, which controls the FLMD0 pin via ports. 66 User s Manual U18371EJ1V0UM

67 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (3) Manually switching the reset signal with jumper Figure 4-16 illustrates the circuit connection for the case where the reset signal is switched using the jumper, with or without MINICUBE2 connected. This connection is simple, but the jumper must be set manually. Figure Circuit Connection for Switching Reset Signal with Jumper Target connector Jumper Target device 1 RESET_OUT 2 _RESET 3 Reset connector RESET_IN RESET signal * Jumper setting When MINICUBE2 is connected: When MINICUBE2 is not connected: 1-2 shorted 2-3 shorted When a 10-pin connector is used, pins 1 and 2 of the target connector can also be used as the jumper, as shown in Figure Figure Jumper Connection When 10-Pin Connector Is Used Target connector Target device RESET_IN _RESET Reset connector RESET_OUT RESET signal User s Manual U18371EJ1V0UM 67

68 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (4) Resetting the target device by power-on clear (POC) only Figure 4-18 illustrates the circuit connection for the case where the target device is only reset via POC without using the reset pin. RESET_OUT is valid only when the debugger is running or during flash programming. The operation is not guaranteed if the power to the target system is shut down during debugging. Note that the POC function cannot be emulated. Figure Circuit Connection for the Case Where Target Device Is Only Reset via POC V DD Target connector RESET_OUT 1 to 10 kω Target device _RESET RESET_IN 68 User s Manual U18371EJ1V0UM

69 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Cautions on target system design Note the following cautions when designing the target system. Do not place X1/OCD1A and X2/OCD1B next to each other on the target system. If the layout requires this, they should be made as short as possible. Make the distance between the target connector and the target device as short as possible. Since the X1/OCD1A and X2/OCD1B lines are used for clock supply, be sure to shield them, such as with a GND pattern. Before shipping the product, use jumpers or other means to physically separate the X1/OCD1A and X2/OCD1B pins from the target connector in order to ensure normal clock oscillation. When debugging, remove capacitors, feedback resistors, and other elements for the resonator in order to prevent signal degradation due to the load placed on the X1/OCD1A and X2/OCD1B pins. Figure Reference Diagram of Target System Target device X1 X2 Make the pattern where X1 and X2 are next to each other as short as possible, or make the space wider Connect to the connector by using tin plating when debugging Shield both sides of the line to reduce noise To debug connector GND pattern User s Manual U18371EJ1V0UM 69

70 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. A 2.54 mm pitch 10- or 16-pin general-purpose connector can be used. The following products are recommended. HIF3FC-10PA-2.54DS (10-pin right-angle type, made by Hirose Electric Co., Ltd.) HIF3FC-10PA-2.54DSA (10-pin straight type, made by Hirose Electric Co., Ltd.) HIF3FC-16PA-2.54DS (16-pin right-angle type, made by Hirose Electric Co., Ltd.) HIF3FC-16PA-2.54DSA (16-pin straight type, made by Hirose Electric Co., Ltd.) PL (16-pin right-angle type, made by Sumitomo 3M, Ltd.) PL (16-pin straight type, made by Sumitomo 3M, Ltd.) Compact connectors and loose-wire cables are also available as options. For more information on these products, access the MINICUBE2 information site. URL: Figure mm Pitch 10-/16-Pin General-Purpose Connector Pin Layout TOP VIEW Pin 1 Pin assignment when MINICUBE2 is connected in this direction Target system 16-pin 10-pin Pin assignment of target connector to be mounted on target system 70 User s Manual U18371EJ1V0UM

71 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2 On-Chip Debugging This section describes the system configuration, startup/shutdown procedure and cautions for debugging when on-chip debugging is performed with MINICUBE Debug functions Table 4-6 lists the debug functions when a 78K0 microcontroller is the target device and the ID78K0-QB is used. If a debugger other than the ID78K0-QB (made by partner manufacturer) is used, the available functions may differ, so check the specifications of the debugger used Table 4-6. Debug Functions Functions Security Download Execution Hardware break Software break Forced break Pseudo real-time RAM monitoring DMM (writing to memory during RUN) Pin masking Time measurement (from execution start to break) User spaces used for debugging Function pins used for debugging Specifications 10-byte ID code authentication Available Go & Go, Start from Here, Come Here, Restart, step execution Break before execution: 1 point (unavailable when using software break) Access break: 1 point 2,000 points Available Available Available Available (reset pin only) Resolution: 100 µs Max. measurement time: Approximately 100 hours Internal ROM: 270 to 526 bytes Internal RAM: 7 to 16 bytes X1, X2 or OCD1A, OCD1B User s Manual U18371EJ1V0UM 71

72 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER System configuration Figure 4-19 illustrates the system configuration for on-chip debugging. <6> Figure System Configuration for On-Chip Debugging or <5> <4> <3> <1> <7> <8> <2> Target system <1> Host machine Products with USB ports <2> Software Includes the debugger, USB driver, device files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 78K0-OCD board (accessory) <6> 10-pin target cable (accessory) <7> 16-pin target cable (accessory) <8> Target connector (sold separately) 72 User s Manual U18371EJ1V0UM

73 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform on-chip debugging. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. Debugger USB driver Device file (may be unnecessary when using a partner manufacture's debugger) (2) Switch setting Set the mode select switch to M2. Set the power select switch by referring to Table 4-7. Caution Do not change the switch setting while the USB cable is connected. Table 4-7. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) 78K0-OCD board setting The settings of the 78K0-OCD board vary depending on how clock is supplied to the target device. A 20 MHz oscillator is mounted on the 78K0-OCD board at shipment. If either of the following conditions applies, the factory setting must be changed. Refer to Clock setting and set the clock. The target device does not operate with a 20 MHz clock, or the target voltage that does not operate with 20 MHz clock is used A clock frequency other than 20 MHz is needed as the high-speed system clock. User s Manual U18371EJ1V0UM 73

74 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (4) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure Select a 10- or 16-pin target cable according to the target system circuit (refer to Remark below). Perform connection before the power to the target system is turned on Figure Connecting MINICUBE2 to Target System 10-/16-pin target cable 78K0-OCD board MINICUBE2 Target system Remark Connect the 78K0-OCD board and the 10-/16-pin target cable as shown below. Do not connect both the 10-pin target cable and 16-pin target cable. With 10-pin cable: Connect CN2 on the 78K0-OCD board to the 10-pin target cable (Figure 4-23). With 16-pin cable: Connect CN3 on the 78K0-OCD board to the 16-pin target cable (Figure 4-24). Figure With 10-Pin Connector Figure With 16-Pin Connector Caution Connect the 78K0-OCD board to the target cable so that pin 1 position ( ) on each side match. 74 User s Manual U18371EJ1V0UM

75 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (5) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 4-25, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (6) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after connection after power application. (7) Debugger startup Start the debugger. The mode LED glows orange after debugger startup. For the operation after this step, refer to the user's manual for the debugger. If the debugger does not start normally or the operation is unstable, the possible causes may be the following. Communication error between MINICUBE2 and target system Whether communication is performed normally can be checked using the OCD Checker. For details, refer to the user's manual for the OCD Checker. The user resource has not been secured or the security ID has not been set To perform debugging with MINICUBE2, the user resource must be secured and the security ID must be set. For details, refer to Securing of user resources and setting of security ID. Unsupported software (debugger, device file, or firmware) is used The software used may not support debugging of the target device. Refer to the document QB-MINI2 Operating Precautions and check the supported version. When using software provided by an NEC Electronics partner, refer to the documents prepared by the partner company. Defect of MINICUBE2 MINICUBE2 may have a defect. Refer to CHAPTER 7 SELF-TESTING. User s Manual U18371EJ1V0UM 75

76 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER System shutdown procedure Terminate debugging and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Debugger termination Terminate the debugger. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system. 76 User s Manual U18371EJ1V0UM

77 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Clock setting MINICUBE2 can supply a clock to be used as the high-speed system clock. The setting of the 78K0-OCD board must be performed according to the following clock supply methods (1) to (3). (1) Using a clock mounted on the 78K0-OCD board (2) Using a clock (4, 8, or 16 MHz) generated in MINICUBE2 (3) Using a clock mounted on the target system (4) Using an internal high-speed oscillator generated in the target device only The settings for (1) to (4) are described below. Supplying a clock used as the subsystem clock is not supported. (1) Using a clock mounted on the 78K0-OCD board Mount an oscillator or oscillation circuit in CLK1 of the 78K0-OCD board (Clock Board is automatically selected as the Main Clock in the Configuration dialog box of the debugger). The usable frequency is the same as that of the target device. Refer to (a) when using the oscillator, or (b) when mounting an oscillator. The clock mounted on the 78K0-OCD board can be used only when the X1 and X2 pins are used as the communication interface. When OCD1A and OCD1B are used as the communication interface, the clock is supplied from the oscillation circuit connected to the X1 and X2 pins of the target device. However, for program download at debugger startup, the clock set by the debugger is used. Therefore, for example, when set to 16 MHz of the System, the time required for download can be shortened as when set to 4 MHz. (a) When using oscillator Mount the 14-pin oscillator (5 V, CMOS type) in CLK1 of the 78K0-OCD board, as shown in Figure TXC-1, manufactured by Tokyo Quartz Co., Ltd. is recommended as an oscillator. Figure Mounting Oscillator 5 V CLK1 14-pin type N.C. Clock User s Manual U18371EJ1V0UM 77

78 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (b) When mounting an oscillator by using resonator Refer to Figure 4-27 and mount an oscillator in CLK1 of the 78K0-OCD board. Figure 4-27 shows the appearance after mounting the oscillator (made by PRECI-DIP) can be used as the parts board to be mounted in the socket. Figure K0-OCD Board Mounting Diagram and CLK1 Equivalent Circuit Parts Mounting Diagram CLK1 Equivalent Pin Number Connection 2-13 Capacitor CB 3-12 Capacitor CA 4-11 Ceramic resonator or crystal resonator 5-10 Resistance Rx 8-9 Shorted Figure Appearance After Mounting Oscillator 78 User s Manual U18371EJ1V0UM

79 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (2) Using a clock (4, 8, or 16 MHz) generated in MINICUBE2 Remove the oscillator or oscillation circuit on the 78K0-OCD board (System is automatically selected as the Main Clock in the Configuration dialog box of the debugger). For the settings, refer to the user's manual for the debugger. The clock generated in MINICUBE2 can be used only when the X1 and X2 pins are used as the communication interface. When OCD1A and OCD1B are used as the communication interface, the clock is supplied from the oscillation circuit connected to the X1 and X2 pins of the target device. However, for program download at debugger startup, the clock set by the debugger is used. Therefore, for example, when set to 16 MHz of the System, the time required for download can be shortened as when set to 4 MHz. (3) Using a clock mounted on the target system Remove the oscillator or oscillation circuit on the 78K0-OCD board (System is automatically selected as the Main Clock in the Configuration dialog box of the debugger). The clock on the target system can be used only when the OCD1A and OCD1B pins are used as the communication interface. When the X1 and X2 pins are used as the communication interface, no oscillation circuits can be connected to the X1 and X2 pins of the device. However, for program download at debugger startup, the clock set by the debugger is used. Therefore, for example, when set to 16 MHz of the System, the time required for download can be shortened as when set to 4 MHz. (4) Using an internal high-speed oscillator generated in the target device only The target device operates by an internal high-speed oscillator, regardless of the Main Clock setting in the Configuration dialog box of the debugger. However, for program download at debugger startup, the clock set by the debugger is used. Therefore, for example, when set to 16 MHz of the System, the time required for download can be shortened as when set to 4 MHz. User s Manual U18371EJ1V0UM 79

80 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Securing of user resources and setting of security ID MINICUBE2 uses the user memory spaces (shaded portions in Figure 4-29) to implement communication with the target device, or each debug functions. The areas marked with a dot ( ) are always used for debugging, and other areas are used for each debug function used. Refer to the descriptions of (a) to (f) on the following pages and secure these spaces in the user program or using the compiler options. Figure Reserved Area Used by MINICUBE2 Internal ROM space Internal RAM space 256 bytes 290H Max. 16 bytes 16 bytes (d) Stack area for debugging F7FFH F7F0H (f) Pseudo RRM area 190H (f) Pseudo RRM area 257 bytes 10 bytes 1 byte 8FH (a) Debug monitor area 85H (c) Security ID area 84H (b) Option byte area 2 bytes 7EH (e) Software break area 2 bytes 02H (a) Debug monitor area 00H : Area that must be reserved 80 User s Manual U18371EJ1V0UM

81 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (a) Debug monitor area (this area must be secured) Addresses 0x02, 0x03 and area starting from address 0x8F must be secured to embed the debug monitor program. If this area is rewritten by flash self programming, on-chip debugging can no longer be performed. [How to secure areas] When using NEC Electronics compiler CC78K0, addresses 0x02, 0x03 and area starting from address can be secured for debug monitoring, using the linker option (-go). Figure 4-28 shows the Linker Options dialog box of the project manager. Select the On-Chip Debug check box as shown in the figure below. If the pseudo RRM function is not used, set the size to 256 bytes (in actuality, 257 bytes from 0x8F to 0x18F are secured). If the pseudo RRM function is used, refer to (f). Figure Linker Option Setting (Debug Monitor Area) User s Manual U18371EJ1V0UM 81

82 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (b) Option byte area (essential) This is the area for the security setting to prevent the flash memory from being read by an unauthorized person. The target device operates in accordance with the set value, as shown below. Table 4-8. Option Byte Setting and Operation Set Value Description Remark 0x00 Debugging is unavailable even if an on-chip debug emulator (such as MINICUBE2) is connected. This setting is available only for flash programming. 0x02 The on-chip flash memory is not erased no matter how many - times the security ID code authentication fails. 0x03 All on-chip flash memory areas are erased if the security ID - code authentication fails. Other than above Setting prohibited - [How to set] Describe the code for setting the option byte in the user program. Refer to the following and add a code to the assembler source. Example When setting 0x02 SSS CSEG AT 084H; SSS is an arbitrary symbol name (eight characters or less) DB 2H Caution If address 0x84 is overwritten by 0x00 by self programming, communication is disabled, and debugging and connection can no longer be performed even if the debugger is restarted. In such as case, erase the memory via flash programming. (c) Security ID area (essential) This is the area for the security setting to prevent the flash memory from being read by an unauthorized person. The security ID functions as a password for starting the debugger. The debugger starts only when the security ID that is input during debugger startup and the security ID embedded in this area match. [How to set] When using NEC Electronics assembler RA78K0, an ID code is generated in this area, using the linker option (-gi). Figure 4-31 shows the Linker Options dialog box of the project manager. Select the Security ID check box as shown in the figure below and set an arbitrary ID code (10 bytes). 82 User s Manual U18371EJ1V0UM

83 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure Linker Option Setting (Security ID) (d) Stack area for debugging (this area must be secured) This area requires 7 to 16 bytes as the stack area for debugging. Since this area is allocated immediately before the stack area, the address of this area varies depending on the stack increase and decrease. Figure 4-32 illustrates the case where the stack area is increased when the internal high-speed RAM starts from 0xFB00. 0xFEDF Figure Variation of Address of Stack Area for Debugging <1> <2> <3> 0xFEDF 0xFEDF Stack area 7 bytes Stack area for debugging 0xFB00 Available space in internal highspeed RAM 0xFB00 7 bytes 0xFB07 0xFB00 7 bytes User s Manual U18371EJ1V0UM 83

84 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER The size of this area also varies depending on whether software breaks or pseudo real-time RAM monitor is used. Table 4-9. Size of Stack Area for Debugging Item Size of Stack Area for Debugging Standard When software breaks are used When pseudo RRM is used When software breaks and pseudo RRM are used 7 bytes 9 bytes 14 bytes 16 bytes [How to secure areas] Refer to the address range shown below and set the stack pointer. Example When internal high-speed RAM starts from 0xFB00 - Standard Within the range 0xFB07 to 0xFEDF Note - When software breaks are used (also refer to (e)) Within the range 0xFB09 to 0xFEDF Note - When pseudo real-time RAM monitor is used (also refer to (f)) Within the range 0xFB0E to 0xFEDF Note - When software breaks and pseudo real-time RAM monitor is used (also refer to (e) and (f)) Within the range 0xFB10 to 0xFEDF Note Note Because the area 0xFEDF is used by MINICUBE2 during a break, set the initial value of the stack pointer to 0xFEDF, not 0xFEE0 (when the initial value is set to 0xFEDF, the actual value used for the stack is 0xFEDE, so there will be no problems). Furthermore, 0xFEDF is prohibited for use as stack area, but it can be used as variable area. (e) Software break area This area is used for software breaks. [How to secure areas] Refer to the following and secure the area. SSS CSEG AT 07EH; SSS is an arbitrary symbol name (eight characters or less) DB 0FFH, 0FFH (f) Pseudo real-time RAM monitor (RRM) area When pseudo real-time RAM monitor is used, the area of debug monitor area (refer to (a) ) bytes and internal extended area from 0xF7F0 to 0xF7FF must be reserved. [How to secure debug monitor area bytes ] When using NEC Electronics compiler CC78K0, the area used for pseudo real-time RAM monitoring can be secured using the linker option (-go). Figure 4-33 shows the Linker Options dialog box of the project manager. Add 256 bytes to the area specified in (a) (to make the area 512 bytes in total). 84 User s Manual U18371EJ1V0UM

85 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure Linker Option Setting (When Pseudo RAM Monitor and Software Break Are Used) [How to secure internal extended RAM area] Refer to the following and secure the area. If this area does not exist in the target device, pseudo real-time RAM monitor cannot be used. SSS CSEG AT 07F0; SSS is an arbitrary symbol name (eight characters or less) DS 16 User s Manual U18371EJ1V0UM 85

86 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Cautions on debugging This section describes cautions on performing on-chip debugging for a 78K0 microcontroller. Be sure to read the following to use MINICUBE2 properly. (1) Handling of device that was used for debugging Do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewrites of the flash memory cannot be guaranteed. (2) Overwriting flash memory during on-chip debugging If the following operations are performed during on-chip debugging, the flash memory in the device is overwritten. <1> Downloading a program <2> Manipulation in Memory Fill dialog box <3> Manipulation in Memory Copy dialog box <4> Manipulation to change memory in Memory window <5> Online assembly in Assemble window <6> Settings when using software breaks <7> Program execution or software reset operation, while Permit has been selected for the Target Power Off setting in the Configuration dialog box <8> Operation that uses pseudo real-time RAM monitor function It takes time from completion of flash memory programming until the control is passed to GUI. (3) Software break (1) During program running, do not rewrite the data at the address where a software break is set. This includes self programming and rewriting to RAM. If performed, the instruction placed at the address may be invalid. (4) Boot swapping during self programming The boot swapping function cannot be emulated. This is because boot swapping moves the memory spaces used for debugging, and thus the debug communication can no longer be performed. 86 User s Manual U18371EJ1V0UM

87 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (5) Emulation in self programming mode For self programming, the mode is switched from normal mode to self programming mode. MOV PFCMD,#0A5H MOV FLPMC,#1H (1) MOV FLPMC,#0FEH MOV FLPMC,#1H From this position CALL!08100H (2) MOV PFCMD,#0A5H MOV FLPMC,#0H Mode A1 MOV FLPMC,#0FFH MOV FLPMC,#0H (3) To this position The section between (2) and (3) is in self programming mode A1. Step execution or debug operations, such as stopping program execution, cannot be performed in this section. In addition, do not set a software break in the section between (1) and (3); otherwise the execution continues without a break but emulation is not performed normally. (6) Break function for stack pointer initialization failure This function executes a break when an interrupt occurs or a PUSH instruction is executed while the initial setting has not been made for the stack pointer. If the manipulation or instruction shown below is executed immediately after a reset operation, the break function for stack pointer initialization failure becomes invalid. Setting a software break Write to the stack pointer from the Register window Write to the flash memory from the Memory window, etc If a software break occurs while the initial setting has not been made for the stack pointer, the message Uninitialized Stack Pointer is displayed on the status bar. The subsequent operations are not performed normally, so make sure to set the SP value in the user program. (7) Caution on downloading a HEX file When downloading a HEX file, do not set specify a filling value other than 0xFF for the object converter option (-U). User s Manual U18371EJ1V0UM 87

88 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (8) Software break (2) If the debugger does not terminate normally due to a factor such as a freeze while a software break is set, the instruction for which the software break is set and that has been substituted by a debug instruction remains as is. To avoid this, select Object in the Download dialog box and download the load module. In particular, take care regarding this point when starting the debugger using a project file, as well as when using PM+. Select the Object check box and then download the project file (9) Caution on performing step execution Some SFRs (special function registers) remain stopped during step execution. In such a case, execute the instruction with the real-time execution function. (10) Cautions when using pseudo real-time RAM monitor function <1> The user program is stopped while the pseudo real-time RAM monitor function processing is being performed. <2> If the pseudo real-time RAM monitor function is executed during a standby state, the standby state is released. <3> The program temporarily operates with PCC = 0 during a break. This break time is extended when the system clock frequency is low or when the CPU operating speed is lowered. <4> When the pseudo real-time RAM monitor function processing is performed, the IXS value is forcibly set as shown below, so that the internal low-speed RAM area size becomes the maximum. Device with OCD control code Note 1 V1.xx: 0Ah Device with OCD control code V2.00 or later: 00h <5> If the interrupt disabled state (DI setting) is set or the operating clock is switched to internal oscillation clock Note 2 or subclock by the user program during the pseudo real-time RAM monitor function processing, the pseudo real-time RAM monitor function processing is suspended. A break occurs in the user program, for approximately 40 µs, due to the pseudo real-time RAM monitor function processing. User program stop period: Approximately 40 µs Notes 1. Version can be checked by selecting [About ] from the [Help] menu in the debugger. 2. Devices with OCD control code V1.xx 88 User s Manual U18371EJ1V0UM

89 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (11) Period in which user program is stopped while pseudo real-time RAM monitor function is being processed The sampling time can be set in the Extended Option dialog box. The following shows the execution time, whereas the operating frequency = 5 MHz and PCC = 0. <When interrupts are enabled (EI) (with an RRM generated while a user program main routine is running)> Redraw Interval (sampling time) One cycle = Several tens ms to several hundreds ms A B A B A B A C A B The A period occurs for the number of the RRM point bytes + 1. RRM Function Sampling Range Break Time per Cycle Max. Interrupt Pending Time 2 bytes = 330 µs 110 µs 4 bytes = 440 µs 110 µs 16 bytes = 1,870 µs 110 µs A (approx. 110 µs) B (approx. 1 ms) C : Pseudo real-time RAM monitor function processing in progress (during a break: RRM data collection and RRM data transmission) : User program is running. : User program is running (sampling time A (A + B) sampling range). (12) Caution on mounting a clock on 78K0-OCD board When a clock is mounted on the 78K0-OCD board, power supply may not become the GND level even if the power to the target system is shut down. (13) Emulation of POC function The POC function of the target device cannot be emulated. Make sure that the power to the target system is not shut down during debugging User s Manual U18371EJ1V0UM 89

90 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.3 Flash Programming This section describes the system configuration and startup/shutdown procedure when flash programming is performed for a 78K0 microcontroller, using MINICUBE Specifications of programming function Table Specifications of Programming Function Functions Specifications Host interface USB 2.0 (compatible with 1.1) Target interface UART Target system voltage 2.7 to 5.5 V (depends on the target device) Clock supply 16, 8, or 4 MHz clock can be supplied Clock mounted on the target system can be used Power supply 3 or 5 V (maximum current rating: 100 ma) Acquisition of device-specific Parameter file for NEC Electronics PG-FP4 is used information Security flag setting Available Standalone operation Unavailable (must be connected to host machine) System configuration Figure 4-34 illustrates the system configuration for flash programming. Figure System Configuration for Flash Programming <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the QB-Programmer USB driver, parameter files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) 90 User s Manual U18371EJ1V0UM

91 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform flash programming. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. QB-Programmer USB driver Parameter file (2) Switch setting Set the mode select switch to M2. Set the power select switch by referring to the following table. Caution Do not change the switch setting while the USB cable is connected. Table Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 4-35, before the power to the target system is turned on. When the power select switch is set to T, the step of (4) Connecting the USB cable can be performed before this step. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system User s Manual U18371EJ1V0UM 91

92 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 4-36, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. The power is always supplied after MINICUBE2 is connected to the host machine with the USB cable. Caution Do not change the switch setting while the USB cable is connected. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) QB-Programmer startup Start the QB-Programmer from the Start menu of Windows. The mode LED glows green after QB-Programmer startup. A series of basic operations after this step is described in the following section. For detailed usage of the QB-Programmer, refer to the QB-Programmer Programming GUI Operation User's Manual. 92 User s Manual U18371EJ1V0UM

93 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Usage examples This section describes a series of basic operations using the QB-Programmer, using the µpd78f0547d as an example. The operations from execution of the [Autoprocedure (EPV)] command to programming for the target device are described. For other commands and their applications, refer to the QB-Programmer Programming GUI Operation User's Manual. The conditions used for a series of operations in this section are as follows. <Target system> Target device: µpd78f0547d Power supply voltage: 5 V (supplied from MINICUBE2) Communication channel: UART, 115,200 bps <MINICUBE2> Switches: Mode select switch: M2 Power select switch: 5 <QB-Programmer> Parameter file: Clock setting: Operation mode: Program file: Command option: 78F0547D.PRM 20 MHz, x1 (oscillator on the target system side) chip sample.hex [Blank check before Erase] selected [Read Verify after Program] selected User s Manual U18371EJ1V0UM 93

94 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (1) Setting of programming environment Set the programming environment, following the steps <1> to <6> described below. <1> Click the [Device] menu on the menu bar and then click [Setup...]. <2> The Device Setup dialog box appears, in which the [Standard] tab is active. Figure [Standard] Tab of Device Setup Dialog Box <3> Click the PRM File Read button to open the Parameter File Select dialog box. Select the parameter file for the target device and then click the Open button. Figure Parameter File Select Dialog Box 94 User s Manual U18371EJ1V0UM

95 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER <4> Set the items in the [Target Device Connection], [Operation Mode] and [Supply Oscillator] areas, in accordance with your programming environment. The following figure shows an example. Figure [Standard] Tab of Device Setup Dialog Box After Setting <5> Switch to the [Advanced] tab. Set the items in the [Command options] and [Security flag settings] areas, in accordance with your programming environment. The following figure shows an example. Figure [Advanced] Tab of Device Setup Dialog Box User s Manual U18371EJ1V0UM 95

96 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER <6> By clicking the OK button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure Completion of Programming Environment Setting 96 User s Manual U18371EJ1V0UM

97 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (2) Selection of program file Select the program file, following the steps <1> to <3> described below. <1> Click the [File] menu on the menu bar and then click [Load...]. <2> The program file select dialog box appears. Figure Program File Select Dialog Box <3> Select the program file for the target device and then click the Open button. Figure Completion of Program File Selection User s Manual U18371EJ1V0UM 97

98 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER (3) Execution of [Autoprocedure (EPV)] command Click the [Device] menu on the menu bar and then click [Autoprocedure (EPV)]. The [Blank Check], [Erase] (if the flash memory in the target device is not blank), [Program], [Verify], and [Security] commands are executed for the target device sequentially. The mode LED on MINICUBE2 flashes yellow during execution. When the command execution is completed normally, the mode LED glows green and the following window appears. Figure Completion of [Autoprocedure (EPV)] Command Execution 98 User s Manual U18371EJ1V0UM

99 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER System shutdown procedure Terminate flash programming and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Terminating the QB-Programmer Terminate the QB-Programmer if you are not going to perform programming to other devices. Remark When the QB-Programmer is terminated, the setting information is saved in the qbp.ini file. Due to this file, the same setting is maintained when the QB-Programmer is started the next time. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. When the power select switch is set to T, the step of (4) Unplugging the target cable can be performed before this step. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system Cautions on flash programming This section describes the cautions for flash programming. MINICUBE2. Be sure to read the following for the proper use of To improve the writing quality, fully understand, verify, and evaluate the following items before using MINICUBE2. Circuits are designed as described in the user's manuals for the device and MINICUBE2. The device, QB-Programmer and MINICUBE2 are used as described in each user's manual. The power supplied to the target system is stable. User s Manual U18371EJ1V0UM 99

100 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER This chapter describes how to use MINICUBE2 when performing on-chip debugging and flash programming for a 78K0S microcontroller. To perform on-chip debugging for a 78K0S microcontroller, a specific program (debug function) must be downloaded to the device, and then debug the device mounted on the target system. Since debugging is performed with the target device operating on the board, this method is suitable for field debugging. Flash programming is a method to write a program to the flash memory embedded in a device. Erasing and writing the program can be performed on-board with the device. Read the following chapters if you are using MINICUBE2 for the first time with a 78K0S microcontroller as the target device. 5.1 Target System Design For communication between MINICUBE2 and the target system, communication circuits must be mounted on the target system. This section describes the circuit design and mounting of connectors. 5.2 On-Chip Debugging This section describes the system configuration and startup method to perform on-chip debugging with MINICUBE Flash Programming This section describes the system configuration and startup method to perform flash programming with MINICUBE User s Manual U18371EJ1V0UM

101 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1 Target System Design This section describes the target system circuit design required for on-chip debugging and flash programming. Figure 5-1 presents an overview of the MINICUBE2 communication interface. As shown on the left side of the figure, MINICUBE2 performs serial communication with the target device on the target system. For this communication, communication circuits must be mounted on the target system. Refer to this section to design circuits appropriately. Figure 5-1. Outline of Communication Interface Communication circuits must be mounted on the target system. Target device Serial communication (INTP) Target system MINICUBE2 USB communication Host machine User s Manual U18371EJ1V0UM 101

102 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Pin assignment This section describes the interface signals used between MINICUBE2 and the target system. Table 5-1 lists the pin assignment. Table 5-2 describes the functions of each pin. The pin assignment varies depending on whether the operation is debugging or programming, so design the circuit appropriately according to the circuit connection examples described on the following sections. Pin No. Table 5-1. Pin Assignment Pin Name Note For Debugging For Programming TOP VIEW 1 GND 2 RESET_OUT 3 DATA 4 VDD 5 DATA 6 R.F.U. 7 R.F.U. 8 H/S 9 CLK 10 R.F.U. 11 R.F.U. 12 INTP R.F.U. 13 R.F.U. 14 CLK 15 RESET_IN R.F.U. 16 R.F.U. Note Signal names in MINICUBE2 Pin 1 Target system Pin assignment of target connector to be mounted on target system Table 5-2. Pin Functions Pin Name IN/OUT Note Description RESET_IN IN Pin used to input reset signal from the target system RESET_OUT OUT Pin used to output reset signal to the target device CLK OUT Pin used to output clock signal to the target device and to set the target device to programming mode DATA IN/OUT Pin used to receive commands or data from the target device and to transmit commands or data to the target device H/S IN Pin used to input handshake signal from the target device INTP OUT Pin used to set the target device to debug mode R.F.U. - This pin is not used, so leave it open. Note As seen from MINICUBE2 102 User s Manual U18371EJ1V0UM

103 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Circuit connection example Refer to Figure 5-2 and design an appropriate circuit. Caution The constants described in the circuit connection example are reference values. If you perform flash programming aiming at mass production, thoroughly evaluate whether the specifications of the target device are satisfied. Figure 5-2. Recommended Circuit Connection V DD V DD Target connector GND RESET_OUT DATA VDD DATA R.F.U. R.F.U. H/S Note 4 CLK R.F.U. R.F.U. INTP R.F.U. CLK RESET_IN R.F.U Note 3 Note 3 V DD V DD 3 to 10 kω 1 kω 10 kω 1 kω 1 to 10 kω Target device _RESET Note 1 X2 Note 2 X1 Note 2 INTP Note 5 VDD GND V DD Reset circuit RESET signal Notes 1. The RESET pin is used to download the monitor program at debugger startup or to implement forced reset. Therefore, a pin that alternately functions as the RESET pin cannot be used. For reset pin connection, refer to Connection of reset pin. 2. This is the pin connection when the X1 and X2 pins are not used in the target system. When using the X1 and X2 pins, refer to Connection of X1 and X2 pins. 3. No problem will occur if the dashed line portions are connected. 4. This pin is connected to enhance the accuracy of time measurement between run and break during debugging. Debugging is possible even if this pin is left open, but measurement error occurs in several ms units. 5. The INTP pin is used for communication between MINICUBE2 and the target device during debugging. When debugging is performed with MINICUBE2, therefore, the INTP pin and its alternate-function pin cannot be used. For INTP pin connection, refer to Connection of INTP pin. For details on the INTP pin to be used, refer to the document indicated in 1. 3 Supported Devices. User s Manual U18371EJ1V0UM 103

104 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Connection of reset pin This section describes the connection of the reset pin, for which special attention must be paid, in the circuit connection example shown in the previous section. During on-chip debugging, a reset signal from the target system is input to MINICUBE2, masked, and then output to the target device. Therefore, the reset signal connection varies depending on whether MINICUBE2 is connected. For flash programming, the circuit must be designed so that the reset signals of the target system and MINICUBE2 do not conflict. Select one of the following methods and connect the reset signal in the circuit. The details of each method are described on the following pages. (1) Automatically switching the reset signal via series resistor (recommended; described in recommended circuit connection in the previous section) (2) Manually switching the reset signal with jumper (3) Resetting the target device by power-on clear (POC) only 104 User s Manual U18371EJ1V0UM

105 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (1) Automatically switching the reset signal via series resistor Figure 5-3 illustrates the reset pin connection described in Circuit connection example. This connection is designed assuming that the reset circuit on the target system contains an N-ch open-drain buffer (output resistance: 100Ω or less). The VDD or GND level may be unstable when the logic of RESET_IN/OUT of MINICUBE2 is inverted, so observe the conditions described below in Remark. Figure 5-3. Circuit Connection with Reset Circuit That Contains Buffer MINICUBE2 Target device Reset connector RESET_OUT _RESET V DD V DD R1 R2 Buffer RESET_IN Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. Pull-up resistor R2 is not required if the buffer of the reset circuit consists of CMOS output. The circuit enclosed by a dashed line is not required when only flash programming is performed. Figure 5-4 illustrates the circuit connection for the case where the reset circuit on the target system contains no buffers and the reset signal is only generated via resistors or capacitors. Design the circuit, observing the conditions described below in Remark. Figure 5-4. Circuit Connection with Reset Circuit That Contains No Buffers MINICUBE2 Target device Reset connector RESET_OUT _RESET V DD R1 R2 RESET_IN Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. The circuit enclosed by a dashed line is not required when only flash programming is performed. User s Manual U18371EJ1V0UM 105

106 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (2) Manually switching the reset signal with jumper Figure 5-5 illustrates the circuit connection for the case where the reset signal is switched using the jumper, with or without MINICUBE2 connected. This connection is simple, but the jumper must be set manually. Figure 5-5. Circuit Connection for Switching Reset Signal with Jumper Target connector RESET_OUT RESET_IN Jumper Target device _RESET Reset connector RESET signal * Jumper setting When MINICUBE2 is connected: When MINICUBE2 is not connected: 1-2 shorted 2-3 shorted (3) Resetting the target device by power-on clear (POC) only Figure 5-6 illustrates the circuit connection for the case where the target device is only reset via POC without using the reset pin. RESET_OUT is valid only when the debugger is running or during flash programming. The operation is not guaranteed if the power to the target system is shut down during debugging. Note that the POC function cannot be emulated. Figure 5-6. Circuit Connection for the Case Where Target Device Is Only Reset via POC V DD Target connector RESET_OUT 1 to 10 kω Target device _RESET RESET_IN 106 User s Manual U18371EJ1V0UM

107 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Connection of INTP pin The INTP pin is used only for communication between MINICUBE2 and the target device during debugging. Design circuits appropriately according to the relevant case among the cases shown below. (1) INTP pin is not used in target system (as is illustrated in Figure 5-2. Recommended Circuit Connection) See Figure 5-7. (2) MINICUBE2 is used only for programming, not for debugging See Figure 5-8. (3) MINICUBE2 is used for debugging and debugging of the INTP pin is performed only with a real machine See Figure 5-9. Figure 5-7. Circuit Connection for the Case Where INTP Pin Is Not Used in Target System V DD Target connector 1 kω Target device INTP 12 INTP Figure 5-8. Circuit Connection for the Case Where MINICUBE2 Is Used Only for Programming Target connector Target device INTP 12 INTP User s Manual U18371EJ1V0UM 107

108 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Figure 5-9. Circuit Connection for the Case Where MINICUBE2 Is Used for Debugging and Debugging of INTP Pin Is Performed Only with Real Machine V DD Target connector 1 kω Jumper Target device INTP INTP 3 External device I/O to INTP * Jumper setting When debugging with MINICUBE2 connected: 1-2 shorted Other than above: 2-3 shorted Caution If debugging is performed with a real machine running, without using MINICUBE2, write the user program using the QB-Programmer. Programs downloaded by the debugger include the monitor program, and such a program malfunctions if it is not controlled via MINICUBE User s Manual U18371EJ1V0UM

109 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Connection of X1 and X2 pins The X1 and X2 pins are used when the debugger is started for the first time (when downloading the monitor program) and when programming is performed with the QB-Programmer. Design circuits appropriately according to the relevant case among the cases shown below. (1) X1 and X2 pins are not used in target system See Figure (2) X1 and X2 pins are used in target system See Figure 5-11 and Debugging of alternate-functions of X1 and X2 pins. Figure Circuit Connection for the Case Where X1 and X2 Pins Are Not Used in Target System V DD Target connector 3 to 10 kω Target device X2 3 X2 X1 9 X1 1 to 10 kω Figure Circuit Connection for the Case Where X1 and X2 Pins Are Used in Target System Target connector Target device X2 3 X2 X1 9 X1 Jumper Oscillator or external device * Jumper setting When debugger is started for the first time (downloading the monitor program) or when programming is performed with QB-Programmer: Other than above: 1-2 shorted 2-3 shorted Remark Refer to the pin connection in Figure 5-10 when the X1 or X2 pin is not used. User s Manual U18371EJ1V0UM 109

110 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. A 2.54 mm pitch 16-pin general-purpose connector can be used. The following products are recommended. HIF3FC-16PA-2.54DS (right-angle type, made by Hirose Electric Co., Ltd.) HIF3FC-16PA-2.54DSA (straight type, made by Hirose Electric Co., Ltd.) PL (right-angle type, made by Sumitomo 3M, Ltd.) PL (straight type, made by Sumitomo 3M, Ltd.) Compact connectors and loose-wire cables are also available as options. For more information on these products, access the MINICUBE2 information site. URL: Figure mm Pitch 16-Pin General-Purpose Connector Pin Layout TOP VIEW Pin 1 Pin assignment when MINICUBE2 is connected in this direction Target system Pin assignment of target connector to be mounted on target system 110 User s Manual U18371EJ1V0UM

111 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2 On-Chip Debugging This section describes the system configuration, startup/shutdown procedure and cautions for debugging when on-chip debugging is performed with MINICUBE Debug functions Table 5-3 lists the debug functions when a 78K0S microcontroller is the target device and the ID78K0S-QB is used. If a debugger other than the ID78K0S-QB (made by partner manufacturer) is used, the available functions may differ, so check the specifications of the debugger used. Table 5-3. Debug Functions Functions Specifications Security ID Unavailable Download Available Execution Go & Go, Start from Here, Come Here, Restart, step execution Hardware break Unavailable Software break 2,000 points Forced break Available except while interrupts are disabled RAM monitoring Unavailable DMM (writing to memory during RUN) Unavailable Pin masking Available (external reset pin only) Time measurement (from execution start to break) Measurement resolution: 100 µs Max. measurement time: Approximately 100 hours User spaces used for debugging Internal ROM: 308 bytes Internal RAM: 5 bytes (used as stack) Function pins used for debugging INTP Note, X1 Note, X2 Note, RESET Note The INTP pins to be used are described in the document QB-MINI2 Operating Precautions. The X1 and X2 pins are used only when the debugger is started for the first time (when downloading the monitor program). User s Manual U18371EJ1V0UM 111

112 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER System configuration Figure 5-13 illustrates the system configuration for on-chip debugging. Figure System Configuration for On-Chip Debugging <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the debugger, USB driver, device files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) 112 User s Manual U18371EJ1V0UM

113 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform on-chip debugging. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. Debugger USB driver Device file (may be unnecessary when using a partner manufacture fs debugger) (2) Switch setting Set the mode select switch to M1. Set the power select switch by referring to Table 5-4. Caution Do not change the switch setting while the USB cable is connected. Table 5-4. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 only detects the power for the target system. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 5-14, before the power to the target system is turned on. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system User s Manual U18371EJ1V0UM 113

114 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 5-15, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) Debugger startup Start the debugger. The mode LED glows green after debugger startup. For the operation after this step, refer to the user's manual for the debugger. If the debugger does not start normally or the operation is unstable, the possible causes may be the following. Communication error between MINICUBE2 and target system Whether communication is performed normally can be checked using the OCD Checker. For details, refer to the user's manual for the OCD Checker. The user resource has not been secured To perform debugging with MINICUBE2, the debug monitor area must be secured. For details, refer to Securing of user resources. Unsupported software (debugger, device file, or firmware) is used The software used may not support debugging of the target device. Refer to the document QB-MINI2 Operating Precautions and check the supported version. When using software provided by an NEC Electronics partner, refer to the documents prepared by the partner company. Defect of MINICUBE2 MINICUBE2 may have a defect. Refer to CHAPTER 7 SELF-TESTING. 114 User s Manual U18371EJ1V0UM

115 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER System shutdown procedure Terminate debugging and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Debugger termination Terminate the debugger. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system. User s Manual U18371EJ1V0UM 115

116 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Securing of user resources The user must prepare the following to perform communication between MINICUBE2 and the target device and implement each debug function. Refer to the descriptions on the following pages and set these items in the user program or using the compiler options. Securement of memory space The shaded portions in Figure 5-16 are the areas reserved for placing the debug monitor program, so user programs cannot be allocated in these spaces. Figure Memory Spaces Where Debug Monitor Programs Are Allocated Internal ROM space Internal ROM end address Internal RAM space Internal RAM end address 304 bytes 5 bytes Stack area for debugging 2 bytes 0x7E (for software break) 2 bytes 0x0A or 0x18 (INTP interrupt vector) : Debug monitor program area Securement of serial interface for communication The register settings, concerning the INTP pin used for communication between MINICUBE2 and the target device, performed by the debug monitor program must not be changed. 116 User s Manual U18371EJ1V0UM

117 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (1) Securement of area for debug monitor program In the internal ROM space of the target device, the shaded portions in Figure 5-16 are the areas where the debug monitor program is allocated. The monitor program performs initialization processing for debug communication interface and RUN or break processing for the CPU. The internal ROM area must be filled with 0xFF. This area must not be rewritten by the user program. [How to secure areas] It is not necessarily required to secure this area if the user program does not use this area. To avoid problems that may occur during the debugger startup, however, it is recommended to secure this area in advance, using the compiler. The following shows examples for securing the area, using the NEC Electronics assembler RA78K0S. Add the assemble source code, as shown below. Assemble source example that securse INTP interrupt vector SSS CSEG AT 0018h; SSS is an arbitrary symbol name (eight characters or less) DB 0ffh, 0ffh Remark Describe the INTP interrupt vector address to the portion of 0018h. The following shows examples of the 78K0S/Kx1+. When using 78K0S/KU1+ or 78K0S/KY1+: INTP1 (000ah) When using 78K0S/KA1+ or 78K0S/KB1+: INTP3 (0018h) Assemble source example that secures an area for software break SSS CSEG AT 007eh; SSS is an arbitrary symbol name (eight characters or less) DB 0ffh, 0ffh Assemble source example that secures monitor program area lower than internal ROM end address SSS CSEG AT 0ed0h; SSS is an arbitrary symbol name (eight characters or less) DB 0ffh, 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh DB 0ffh, 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh : 19 lines : DB 0ffh, 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh User s Manual U18371EJ1V0UM 117

118 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Remark Describe the address to the portion of 0ed0h in accordance with the flash memory capacity of the target device (see the following table). Flash Memory Capacity of Target Device Value Described in Assembler Source 1 KB 0x2D0 2 KB 0x6D0 4 KB 0xED0 8 KB 0x1ED0 (2) Securement of stack area for debugging In the internal RAM space of the target device, the shaded portion in Figure 5-16 are the area where the debug monitor program uses as the stack area (5 bytes). Since this area is allocated immediately before the stack area that is used by the user program, the address of this area varies depending on the stack increase and decrease. Therefore, the stack pointer must be set by making allowances for the stack size (5 bytes) used for debugging. The following figure illustrates the case where the stack area is increased when the internal high-speed RAM starts from 0xFE00. <1> <2> <3> 0xFEFF Stack area 0xFEFF 0xFEFF 5 bytes Stack area for debugging 0xFE00 Available space in internal highspeed RAM 0xFE00 5 bytes 0xFE05 0xFE00 5 bytes [How to secure areas] Refer to the address range shown below and set the stack pointer. Example When internal high-speed RAM starts from 0xFE00 Within the range 0xFE05 to 0xFEFF 118 User s Manual U18371EJ1V0UM

119 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (3) Securement of communication serial interface The INTP pin is used for communication between MINICUBE2 and the target system. The settings related to the INTP pin are performed by the debug monitor program, but if the setting is changed by the user program, a communication error may occur. To prevent such a problem from occurring, communication serial interface must be secured in the user program. [How to secure communication serial interface] Create the user program observing the following points. Interrupt mask flag register Do not disable interrupts using the interrupt mask flag register corresponding to the INTP pin used. Example Setting other than below is prohibited when the target device is the 78K0S/KB1+ and INTP3 is used MK1 1 x x x x 0 x 1 x: Any Port mode registers of alternate-function ports Do not set to the output mode the alternate-function port corresponding to the INTP pin used. Example Setting other than below is prohibited when the target device is the 78K0S/KB1+ and INTP3 is used PM4 x x x x x x 1 x x: Any External interrupt mode registers Do not set to other than the rising edge the external interrupt mode register corresponding to the INTP pin used. Example Setting other than below is prohibited when the target device is the 78K0S/KB1+ and INTP3 is used INTM1 x x x x x x 0 1 x: Any User s Manual U18371EJ1V0UM 119

120 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Debugging of alternate-functions of X1 and X2 pins The X1 and X2 pins are used when the debugger is started for the first time (when downloading the monitor program) and when programming is performed with the QB-Programmer. It is not necessary to use the X1 and X2 pins if the monitor program has already been downloaded to the target device, so the X1 and X2 pins and their alternate functions can be debugged by using the following procedures. To implement debugging of the X1 and X2 pins, the circuit must be designed appropriately. For details, refer to Connection of X1 and X2 pins. (1) Disconnect the external parts connected to the X1 and X2 pins in the target device. (If the circuit is designed as shown in Figure 5-11, short jumper pins 1 and 2.) (2) Turn on power to the target system and MINICUBE2 in accordance with System startup procedure. (3) Start the debugger. At this time, do not download the load module Note. (The monitor program will be downloaded automatically immediately after startup.) (4) Terminate the debugger. (5) Turn off power to the target system and MINICUBE2 in accordance with System shutdown procedure. (6) Connect the external parts to the X1 and X2 pins in the target device. (If the circuit is designed as shown in Figure 5-11, short jumper pins 2 and 3.) (7) Turn on power to the target system and MINICUBE2 in accordance with System startup procedure. (8) Start the debugger. Note If a project has already been created in the project manager (PM+), the load module will automatically be downloaded. In this case, terminate PM+ and then start the debugger. Remark The next time the debugger is started, perform the procedure from step (7). However, if the program is written via the QB-Programmer and the monitor program is erased, the procedure must be performed from step (1) again. 120 User s Manual U18371EJ1V0UM

121 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Cautions on debugging This section describes cautions on performing on-chip debugging for a 78K0S microcontroller. Be sure to read the following to use MINICUBE2 properly. (1) Handling of device that was used for debugging Do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewrites of the flash memory cannot be guaranteed. (2) Cases where debugger operation speed is degraded The debugger operation speed may be degraded when too many contents of the memory or registers are displayed in a debugger window, particularly when using a host machine with a USB 1.1 interface. The debugger response is also slowed while the flash memory is being overwritten. This phenomenon may be improved to some extent by raising the CPU operation clock frequency, by setting the PCC or PPCC register. (3) Reset processing If the RESET pin of the target device alternately functions as a port, enable the RESET pin by the user program settings, such as option byte setting. (4) When breaks cannot be executed Forced breaks cannot be executed if one of the following conditions is satisfied. Interrupts are disabled (DI) Interrupts issued for the INTP pin, which is used for communication between MINICUBE2 and the target device, are masked The alternate-function port corresponding to the INTP pin is not set to the input mode The external interrupt edge corresponding to the INTP pin is not set to the rising edge Standby mode is entered while standby release by a maskable interrupt is prohibited (5) Flash self programming If a space where the debug monitor program is allocated is rewritten by flash self programming, the debugger can no longer operate normally. (6) Operation after reset After an external pin reset or internal reset, the monitor program performs debug initialization processing. Consequently, the time from reset occurrence until user program execution differs from that in the actual device operation. User s Manual U18371EJ1V0UM 121

122 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (7) Emulation of POC function The POC function of the target device cannot be emulated. Make sure that the power to the target system is not shut down during debugging. (8) Debugging with real machine running without using MINICUBE2 If debugging is performed with a real machine running, without using MINICUBE2, write the user program using the QB-Programmer. Programs downloaded by the debugger include the monitor program, and such a program malfunctions if it is not controlled via MINICUBE2. (9) Caution on protect byte Set the protect byte so as to permit programming to the entire block and erasing of the entire block. 122 User s Manual U18371EJ1V0UM

123 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.3 Flash Programming This section describes the system configuration and startup/shutdown procedure when flash programming is performed for a 78K0S microcontroller, using MINICUBE Specifications of programming function Table 5-5. Specifications of Programming Function Functions Specifications Host interface USB 2.0 (compatible with 1.1) Target interface Target system voltage Clock supply Power supply Acquisition of device-specific information Security flag setting Standalone operation UART 2.7 to 5.5 V (depends on the target device) 8 MHz clock can be supplied 3 or 5 V (maximum current rating: 100 ma) Parameter file for NEC Electronics PG-FP4 is used Available Unavailable (must be connected to host machine) System configuration Figure 5-17 illustrates the system configuration for flash programming. Figure System Configuration for Flash Programming <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the QB-Programmer USB driver, parameter files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) User s Manual U18371EJ1V0UM 123

124 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform flash programming. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. QB-Programmer USB driver Parameter file (2) Switch setting Set the mode select switch to M1. Set the power select switch by referring to the following table. Caution Do not change the switch setting while the USB cable is connected. Table 5-6. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 5-18, before the power to the target system is turned on. When the power select switch is set to T, the step of (4) Connecting the USB cable can be performed before this step. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system 124 User s Manual U18371EJ1V0UM

125 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 5-19, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. The power is always supplied after MINICUBE2 is connected to the host machine with the USB cable. Caution Do not change the switch setting while the USB cable is connected. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) QB-Programmer startup Start the QB-Programmer from the Start menu of Windows. The mode LED glows green after QB-Programmer startup. A series of basic operations after this step is described in the following section. For detailed usage of the QB-Programmer, refer to the QB-Programmer Programming GUI Operation User's Manual. User s Manual U18371EJ1V0UM 125

126 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Usage examples This section describes a series of basic operations using the QB-Programmer, using the µpd78f9234 as an example. The operations from execution of the [Autoprocedure (EPV)] command to programming for the target device are described. For other commands and their applications, refer to the QB-Programmer Programming GUI Operation User's Manual. The conditions used for a series of operations in this section are as follows. <Target system> Target device: Power supply voltage: Communication channel: µpd78f V (supplied from MINICUBE2) UART, 115,200 bps <MINICUBE2> Switches: Mode select switch: M1 Power select switch: 5 <QB-Programmer> Parameter file: Clock setting: Operation mode: Program file: Command options: 78F9234.PRM 8 MHz (supplied from MINICUBE2) chip sample.hex [Blank check before Erase] selected [Checksum flag after Program] selected 126 User s Manual U18371EJ1V0UM

127 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (1) Setting of programming environment Set the programming environment, following the steps <1> to <6> described below. <1> Click the [Device] menu on the menu bar and then click [Setup...]. <2> The Device Setup dialog box appears, in which the [Standard] tab is active. Figure [Standard] Tab of Device Setup Dialog Box <3> Click the PRM File Read button to open the Parameter File Select dialog box. Select the parameter file for the target device and then click the Open button. Figure Parameter File Select Dialog Box User s Manual U18371EJ1V0UM 127

128 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER <4> Set the items in the [Target Device Connection], [Operation Mode] and [Supply Oscillator] areas, in accordance with your programming environment. The following figure shows an example. Figure [Standard] Tab of Device Setup Dialog Box After Setting <5> Next, set the items in the [Command options] and [Security flag settings] areas, in accordance with your programming environment. The following figure shows an example. Figure [Advanced] Tab of Device Setup Dialog Box 128 User s Manual U18371EJ1V0UM

129 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER <6> By clicking the OK button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure Completion of Programming Environment Setting User s Manual U18371EJ1V0UM 129

130 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (2) Selection of program file Select the program file, following the steps <1> to <3> described below. <1> Click the [File] menu on the menu bar and then click [Load...]. <2> The program file select dialog box appears. Figure Program File Select Dialog Box <3> Select the program file for the target device and then click the Open button. Figure Completion of Program File Selection 130 User s Manual U18371EJ1V0UM

131 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER (3) Execution of [Autoprocedure (EPV)] command Click the [Device] menu on the menu bar and then click [Autoprocedure (EPV)]. The [Blank Check], [Erase] (if the flash memory in the target device is not blank), [Program], [Verify], and [Security] commands are executed for the target device sequentially. The mode LED on MINICUBE2 flashes yellow during execution. When the command execution is completed normally, the mode LED glows green and the following window appears. Figure Completion of [Autoprocedure (EPV)] Command Execution User s Manual U18371EJ1V0UM 131

132 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER System shutdown procedure Terminate flash programming and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Terminating the QB-Programmer Terminate the QB-Programmer if you are not going to perform programming to other devices. Remark When the QB-Programmer is terminated, the setting information is saved in the qbp.ini file. Due to this file, the same setting is maintained when the QB-Programmer is started the next time. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. When the power select switch is set to T, the step of (4) Unplugging the target cable can be performed before this step. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system Cautions on flash programming This section describes the cautions for flash programming. MINICUBE2. Be sure to read the following for the proper use of To improve the writing quality, fully understand, verify, and evaluate the following items before using MINICUBE2. Circuits are designed as described in the user's manuals for the device and MINICUBE2. The device, QB-Programmer and MINICUBE2 are used as described in each user's manual. The power supplied to the target system is stable. 132 User s Manual U18371EJ1V0UM

133 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER This chapter describes how to use MINICUBE2 when performing on-chip debugging and flash programming for a 78K0R microcontroller. On-chip debugging is a method to debug a microcontroller mounted on the target system, using a debug function implemented in the device. Since debugging is performed with the target device operating on the board, this method is suitable for field debugging. Flash programming is a method to write a program to the flash memory embedded in a device. Erasing, writing and verifying the program can be performed on-board with the device. Read the following chapters if you are using MINICUBE2 for the first time with a 78K0R microcontroller as the target device. 6.1 Target System Design For communication between MINICUBE2 and the target system, communication circuits must be mounted on the target system. This section describes the circuit design and mounting of connectors. 6.2 On-Chip Debugging This section describes the system configuration and startup method to perform on-chip debugging with MINICUBE Flash Programming This section describes the system configuration and startup method to perform flash programming with MINICUBE2. User s Manual U18371EJ1V0UM 133

134 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.1 Target System Design This section describes the target system circuit design required for on-chip debugging and flash programming. Figure 6-1 presents an overview of the MINICUBE2 communication interface. As shown on the left side of the figure, MINICUBE2 performs serial communication with the target device on the target system. For this communication, communication circuits must be mounted on the target system. Refer to this section to design circuits appropriately. Figure 6-1. Outline of Communication Interface Communication circuits must be mounted on the target system. USB communication Target device Single-wire UART communication (1-wire/2-wire mode) Note MINICUBE2 Target system Host machine Note 1-wire mode: Single-wire UART communication using TOOL0 pin 2-wire mode: Single-wire UART communication using TOOL0 and TOOL1 pins Table 6-1. Differences Between 1-Wire Mode and 2-Wire Mode Communication Mode Flash Programming Function Debugging Function 1-wire mode Available Pseudo real-time RAM monitor (RRM) function: Unavailable DMM function (writing to memory during RUN): Unavailable 2-wire mode Available Pseudo real-time RAM monitor (RRM) function: Available DMM function (writing to memory during RUN): Available 134 User s Manual U18371EJ1V0UM

135 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Pin assignment This section describes the interface signals used between MINICUBE2 and the target system. Table 6-2 lists the pin assignment. Table 6-3 describes the functions of each pin. The pin assignment varies between 1-wire and 2-wire modes, so design the circuit appropriately according to the circuit connection examples described on the following sections. Pin No. Table 6-2. Pin Assignment Pin Name Note For 1-Wire Mode For 2-Wire Mode TOP VIEW 1 GND 2 RESET_OUT 3 RXD 4 VDD 5 TXD 6 R.F.U. 7 R.F.U. 8 R.F.U. 9 R.F.U. 10 R.F.U. 11 R.F.U. 12 R.F.U. 13 R.F.U. 14 FLMD0 15 RESET_IN 16 R.F.U. CLK_IN Note Signal names in MINICUBE2 Pin 1 Target system Pin assignment of target connector to be mounted on target system Table 6-3. Pin Functions Pin Name IN/OUT Note 1 Description RESET_IN IN Pin used to input reset signal from the target system RESET_OUT OUT Pin used to output reset signal to the target device FLMD0 OUT Pin used to set the target device to debug mode or programming mode RXD Note 2 IN/OUT Pin used to transmit/receive command/data between the target device TXD Note 2 IN/OUT Pin used to transmit/receive command/data between the target device CLK_IN IN Pin used to input handshake signal from the target device R.F.U. - This pin is not used, so leave it open. Notes 1. As seen from MINICUBE2 2. The RXD and TXD pins are internally shorted by setting the mode select switch to M1. User s Manual U18371EJ1V0UM 135

136 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Circuit connection example Refer to Figure 6-2 and design an appropriate circuit. Caution The constants described in the circuit connection example are reference values. If you perform flash programming aiming at mass production, thoroughly evaluate whether the specifications of the target device are satisfied. Figure 6-2. Recommended Circuit Connection V DD V DD V DD Target connector Target device 1 GND 2 RESET_OUT 3 RXD Note 1 4 VDD 5 TXD Note 1 6 R.F.U. 7 R.F.U. 8 R.F.U. 9 R.F.U. 10 R.F.U. 11 R.F.U. R.F.U. 12 R.F.U. 13 FLMD0 14 RESET_IN Note 3 15 CLK_IN 16 3 to 10 kω Note 4 V DD V DD 0 to 10 kω GND _RESET TOOL0 VDD X1 X2 TOOL1 Note 2 FLMD0 Clock circuit 10 kω 1 kω Reset circuit RESET signal Notes 1. With MINICUBE2, the circuit enclosed by a dashed line is not necessary because the RXD and TXD pins are internally shorted. If any other flash programmer is used, these pins must be shorted on the target system because these pins may not be able to be shorted in the programmer. 2. This connection is required for 2-wire communication, but not for 1-wire communication. This pin is left open when MINICUBE2 is not connected, so connect a pull-up or pull-down resistor to this pin before using. 3. This connection is designed assuming that the RESET signal is output from the N-ch open-drain buffer (output resistance: 100Ω or less). For details, refer to Connection of reset pin. 4. The circuit enclosed by a dashed line is not required when only flash programming is performed. 136 User s Manual U18371EJ1V0UM

137 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Connection of reset pin This section describes the connection of the reset pin, for which special attention must be paid, in the circuit connection example shown in the previous section. During on-chip debugging, a reset signal from the target system is input to MINICUBE2, masked, and then output to the target device. Therefore, the reset signal connection varies depending on whether MINICUBE2 is connected. For flash programming, the circuit must be designed so that the reset signals of the target system and MINICUBE2 do not conflict. Select one of the following methods and connect the reset signal in the circuit. The details of each method are described on the following pages. (1) Automatically switching the reset signal via series resistor (recommended; described in recommended circuit connection in the previous section) (2) Manually switching the reset signal with jumper (3) Resetting the target device by power-on clear (POC) only User s Manual U18371EJ1V0UM 137

138 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (1) Automatically switching the reset signal via series resistor Figure 6-3 illustrates the reset pin connection described in Circuit connection example. This connection is designed assuming that the reset circuit on the target system contains an N-ch open-drain buffer (output resistance: 100Ω or less). The VDD or GND level may be unstable when the logic of RESET_IN/OUT of MINICUBE2 is inverted, so observe the conditions described below in Remark. Figure 6-3. Circuit Connection with Reset Circuit That Contains Buffer MINICUBE2 Target device Reset connector RESET_OUT _RESET V DD V DD R1 R2 Buffer RESET_IN Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. Pull-up resistor R2 is not required if the buffer of the reset circuit consists of CMOS output. The circuit enclosed by a dashed line is not required when only flash programming is performed. Figure 6-4 illustrates the circuit connection for the case where the reset circuit on the target system contains no buffers and the reset signal is only generated via resistors or capacitors. Design the circuit, observing the conditions described below in Remark. Figure 6-4. Circuit Connection with Reset Circuit That Contains No Buffers MINICUBE2 Target device Reset connector RESET_OUT _RESET V DD R1 R2 RESET_IN Remark Make the resistance of at least R1 ten times that of R2, R1 being 10 kω or more. The circuit enclosed by a dashed line is not required when only flash programming is performed. 138 User s Manual U18371EJ1V0UM

139 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (2) Manually switching the reset signal with jumper Figure 6-5 illustrates the circuit connection for the case where the reset signal is switched using the jumper, with or without MINICUBE2 connected. This connection is simple, but the jumper must be set manually. Figure 6-5. Circuit Connection for Switching Reset Signal with Jumper Target connector RESET_OUT RESET_IN Jumper Target device _RESET Reset connector RESET signal * Jumper setting When MINICUBE2 is connected: When MINICUBE2 is not connected: 1-2 shorted 2-3 shorted (3) Resetting the target device by power-on clear (POC) only Figure 6-6 illustrates the circuit connection for the case where the target device is only reset via POC without using the reset pin. RESET_OUT is valid only when the debugger is running or during flash programming. Figure 6-6. Circuit Connection for the Case Where Target Device Is Only Reset via POC V DD Target connector RESET_OUT 1 to 10 kω Target device _RESET RESET_IN User s Manual U18371EJ1V0UM 139

140 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. A 2.54 mm pitch 16-pin general-purpose connector can be used. The following products are recommended. HIF3FC-16PA-2.54DS (right-angle type, made by Hirose Electric Co., Ltd.) HIF3FC-16PA-2.54DSA (straight type, made by Hirose Electric Co., Ltd.) PL (right-angle type, made by Sumitomo 3M, Ltd.) PL (straight type, made by Sumitomo 3M, Ltd.) Compact connectors and loose-wire cables are also available as options. For more information on these products, access the MINICUBE2 information site. URL: Figure mm Pitch 16-Pin General-Purpose Connector Pin Layout TOP VIEW Pin 1 Pin assignment when MINICUBE2 is connected in this direction Target system Pin assignment of target connector to be mounted on target system 140 User s Manual U18371EJ1V0UM

141 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.2 On-Chip Debugging This section describes the system configuration, startup/shutdown procedure and cautions for debugging when on-chip debugging is performed with MINICUBE Debug functions Table 6-4 lists the debug functions when a 78K0R microcontroller is the target device and the ID78K0R-QB is used. Table 6-4. Debug Functions Functions Security Download Execution Hardware break Software break Forced break Pseudo real-time RAM monitoring RRM) DMM (writing to memory during RUN) Reset masking Time measurement (from execution start to break) Specifications 10 byte ID code authentication Available Go & Go, Start from Here, Come Here, Restart, step execution 1 point (commonly used by execution and access) 2,000 points Available Available in 2-wire mode Available in 2-wire mode Available (internal/external reset) Measurement resolution: 100 µs Max. measurement time: Approximately 100 hours User spaces used for debugging Internal ROM: 1024 bytes + 22 bytes Internal RAM: 6 bytes Note Function pins used for debugging 1-wire mode: TOOL0 2-wire mode: TOOL0, TOOL1 Note For details, refer to Securing of user resources and setting of security ID and on-chip debug option byte. User s Manual U18371EJ1V0UM 141

142 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER System configuration Figure 6-8 illustrates the system configuration for on-chip debugging. Figure 6-8. System Configuration for On-Chip Debugging <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the debugger, USB driver, device files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) 142 User s Manual U18371EJ1V0UM

143 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform on-chip debugging. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. Debugger USB driver Device file (may be unnecessary when using a partner manufacture's debugger) (2) Switch setting Set the mode select switch to M1. Set the power select switch by referring to Table 6-5. Caution Do not change the switch setting while the USB cable is connected. Table 6-5. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 only detects the power for the target system. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 6-9, before the power to the target system is turned on. Figure 6-9. Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system User s Manual U18371EJ1V0UM 143

144 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 6-10, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) Debugger startup Start the debugger. The mode LED glows yellow after debugger startup. For the operation after this step, refer to the user's manual for the debugger. If the debugger does not start normally or the operation is unstable, the possible causes may be the following. Communication error between MINICUBE2 and target system Whether communication is performed normally can be checked using the OCD Checker. For details, refer to the users manual for the OCD Checker. The user resource has not been secured or the security ID and on-chip debug option byte have not been set To perform debugging with MINICUBE2, the debug monitor area must be secured and the security ID and on-chip debug option byte must be set. For details, refer to Securing of user resources and setting of security ID and on-chip debug option byte. Unsupported software (debugger, device file, or firmware) is used The software used may not support debugging of the target device. Refer to the document QB-MINI2 Operating Precautions and check the supported version. When using software provided by an NEC Electronics partner, refer to the documents prepared by the partner company. Defect of MINICUBE2 MINICUBE2 may have a defect. Refer to CHAPTER 7 SELF-TESTING. 144 User s Manual U18371EJ1V0UM

145 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER System shutdown procedure Terminate debugging and shutdown the system in the following order. If the following order is not observed, the target system or MINICUBE2 may be damaged. (1) Debugger termination Terminate the debugger. (2) Target system power shutdown Shutdown the power supplied to the target system. This step is not necessary if the power select switch is set to 3 or 5. (3) Unplugging the USB cable Unplug the USB cable from MINICUBE2 or the host machine. (4) Unplugging the target cable Unplug the target cable from MINICUBE2 or the target system. User s Manual U18371EJ1V0UM 145

146 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Securing of user resources and setting of security ID and on-chip debug option byte The user must prepare the following to perform communication between MINICUBE2 and the target device and implement each debug function. If NEC Electronics assembler RA78K0R or compiler CC78K0R is used, the items can be set by using linker options. Refer to the descriptions on the following pages and set these items. Securement of memory space The shaded portions in Figure 6-11 are the areas reserved for placing the debug monitor program, so user programs or data cannot be allocated in these spaces. These spaces must be secured so as not to be used by the user program. Moreover, this area must not be rewritten by the user program. Figure Memory Spaces Where Debug Monitor Programs Are Allocated Internal ROM space Internal RAM space Internal ROM end address Internal RAM end address 1024 bytes (a) Debug monitor area 6 bytes (d) Stack area for debugging 10 bytes 10 bytes 1 byte D8H D7H (a) Debug monitor area CEH CDH (c) Security ID area C4H C3H (b) On-chip debug option byte area 2 bytes Note 03H 02H (a) Debug monitor area : Area used for on-chip debugging Note In debugging, reset vector is rewritten to address allocated to a monitor program. Setting of security ID and on-chip debug option byte The security ID or on-chip debug option byte must be embedded in the area filled with yellow (0xC3 and 0xC4 to 0xCD) in Figure 6-11, to prevent the memory from being read by an unauthorized person. 146 User s Manual U18371EJ1V0UM

147 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (a) Securement of debug monitor area This is the area to which the debug monitor program is to be allocated. The monitor program performs initialization processing for debug communication interface and RUN or break processing for the CPU. This user programs or data must not be placed in an area of 22 bytes near the on-chip debug option byte, and an area of 1,024 bytes before the internal ROM end address. In addition, reset vector is rewritten to address allocated to a monitor program. [How to secure areas] The following shows an example for securing the area when using NEC Electronics assembler RA78K0R or compiler CC78K0R. Select the On-Chip Debug Option Bytes [-go] check box as shown in the figure below. An area of 22 bytes is thus secured near the on-chip debug option byte. An area of 1,024 bytes before the internal ROM end address is also secured by setting the start address and size. Example Internal ROM end address is 0x3FFFF Figure Securement of Debug Monitor Area User s Manual U18371EJ1V0UM 147

148 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (b) On-chip debug option byte area This is the area for the security setting to prevent the flash memory from being read by an unauthorized person. The debugger manipulates the target device in accordance with the set value, as shown below. Table 6-6. On-Chip Debug Option Byte Setting and Operation Set Value Description Remark 0x04 Debugging is disabled even if an on-chip debug emulator (such as MINICUBE2) is connected. This setting is available only for flash programming and self programming. 0x85 The on-chip flash memory is not erased no matter - how many times the security ID code authentication fails. 0x84 All on-chip flash memory areas are erased if the - security ID code authentication fails. Other than above Setting prohibited - Caution Values can be set only to bits 7 and 0 (OCDENSET and OCDERSD). Be sure to write B to bits 6 to 1. Remark Values set to bits 3 to 1 are changed during on-chip debugging, so values of these bits are undefined after setting. However, be sure to set these bits to initial values (0, 1, 0). [How to set] The following shows a setting example when using NEC Electronics assembler RA78K0R or compiler CC78K0R. Set a value for the Control Value text box under the On-Chip Debug Option Bytes [-go] check box as shown in the figure below. Example Setting 0x85 for control value 148 User s Manual U18371EJ1V0UM

149 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Figure On-Chip Debug Option Byte Setting Example Caution If bit 7 (OCDENSET) of the on-chip debug option byte area (address 0xC3) is set to 0 by flash programming or self programming, debugging is disabled and the debugger can no longer start unconditionally. To enable debugging, erase the flash memory by flash programming. (c) Security ID area This is the area for the security setting to prevent the flash memory from being read by an unauthorized person. The security ID functions as a password for starting the debugger. The debugger starts only when the security ID that is input during debugger startup and the security ID embedded in this area match. If the ID codes do not match, the debugger manipulates the target device in accordance with the value set to the on-chip debug option byte area (refer to Table 6-6). [How to set] An ID code is generated in the security ID area by setting the security ID when using NEC Electronics assembler RA78K0R or compiler CC78K0R. Select the Security ID [-gi] check box and set an arbitrary ID code (10 bytes) as shown in the figure below. User s Manual U18371EJ1V0UM 149

150 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Figure Security ID Setting Example Caution If you have forgotten the security ID, erase the flash memory by flash programming or self programming and then set the security ID again. 150 User s Manual U18371EJ1V0UM

151 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (d) Securement of stack area for debugging This area requires 6 bytes as the stack area for debugging. Since this area is allocated immediately before the stack area, the address of this area varies depending on the stack increase and decrease. That is, 6 extra bytes are consumed for the stack area used. Figure 6-15 illustrates the case where the stack area is increased when the internal high-speed RAM starts from 0xFCF00. Figure Variation of Address of Stack Area for Debugging <1> <2> <3> 0xFFEDF Stack area 0xFFEDF 0xFFEDF 0xFCF00 6bytes Stack area for debugging Available space In internal highspeed RAM 0xFCF00 6 bytes 0xFCF06 0xFCF00 6 bytes [How to secure areas] Set the stack pointer by estimating the stack area consumed by the user program + 6 bytes. Make sure that the stack pointer does not extend beyond the internal high-speed RAM start address. Remark Refer to the self programming manual for how to secure the stack area for self programming. User s Manual U18371EJ1V0UM 151

152 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Cautions on debugging This section describes cautions on performing on-chip debugging for a 78K0R microcontroller. Be sure to read the following to use MINICUBE2 properly. (1) Handling of device that was used for debugging Do not mount a device that was used for debugging on a mass-produced product, because the flash memory was rewritten during debugging and the number of rewrites of the flash memory cannot be guaranteed. Moreover, do not embed the debug monitor program into mass-produced products. (2) Flash self programming If a space where the debug monitor program is allocated is rewritten by flash self programming, the debugger can no longer operate normally. This caution also applies to boot swapping for such an area. (3) Operation after reset After an external pin reset or internal reset, the monitor program performs debug initialization processing. Consequently, the time from reset occurrence until user program execution differs from that in the actual device operation. If Not Permit is selected in the Flash Programming area in the Configuration dialog box of the debugger, the time until the user program is executed compared with the time when Permit is selected is delayed several 100 ms. (4) Debugging with real machine running without using MINICUBE2 If debugging is performed with a real machine running, without using MINICUBE2, write the user program using the QB-Programmer. Programs downloaded by the debugger include the monitor program, and such a program malfunctions if it includes processing to make the TOOL0 pin low level. (5) Step execution If step execution is performed for the following instructions, an extra instruction is executed. a. RETI/RETB instruction Immediately after returning from the interrupt servicing, an instruction is executed and then the execution breaks. b. Conditional skip instruction (condition is not satisfied) The instruction following the conditional skip instruction is executed and then the execution breaks. (6) Operation when debugger starts When the debugger is started, if the Target Device Connection setting in the Configuration dialog box of the debugger is different from the setting for the previous debugging, the internal flash memory is erased. (7) Debugging after program is written by flash programming If a program is written to the internal flash memory using the QB-Programmer or PG-FP4, on-chip debugging is disabled even if it is enabled in the on-chip debugging option byte setting. To perform debugging of the target device after that, erase the internal flash memory using the QB-Programmer or PG-FP4 and then download the program using the debugger. (8) LVI default start function setting (address C1H) The LVI setting at address C1H in the internal flash memory during debugging is set as follows. - When MINICUBE2 is connected: The LVI default start function is available. - When MINICUBE2 is not connected: The LVI default start function is unavailable. 152 User s Manual U18371EJ1V0UM

153 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (9) On-chip debugging option byte setting (address C3H) The on-chip debugging option byte setting is rewritten arbitrarily by the debugger. (10) FLMD0 pin output status while debugger is running In accordance with the setting in the Flash Programming area in the Configuration dialog box of the debugger, the FLMD0 pin output status while the debugger is running changes as follows. Rewriting by flash self-programming is not possible when the output status is low level. - When Permit is selected: High level (low level for about 100 µs after reset release) - When Not Permit is selected: Low level (11) Operation at voltage with which flash memory cannot be written Do not perform the following operations at a voltage with which flash memory cannot be written. Otherwise, the subsequent operation may be unstable. <1> Writing to internal flash memory <2> Setting or canceling of software breakpoint <3> Starting execution at the set software breakpoint position <4> Step execution at the set software breakpoint position <5> Step-over execution, Return Out execution <6> Come Here <7> If Permit is selected in the Flash Programming area in the Configuration dialog box, the following operations cannot be performed. a) Setting, changing, or canceling of hardware breaks b) Masking/unmasking of internal reset c) Switching of peripheral breaks User s Manual U18371EJ1V0UM 153

154 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (12) Debugging in 1-wire mode Note the following points when debugging is performed in 1-wire mode (selected by choosing TOOL0 in the Target Device Connection area in the Configuration dialog box of the debugger). <1> The debugger operation speed is two to four times slower than that in 2-wire mode. <2> When the internal high-speed oscillator is used for the CPU operating clock, breaks may not occur normally if the frequency variation between debugger startup and break occurrence (except for when changing the CKC register) is too large. This situation may occur when the variation of operating voltage or temperature is too large. (13) Pseudo real-time monitor function Note the following points when using the pseudo real-time monitor function. <1> The HALT mode is released during monitoring. <2> The pseudo real-time monitor function does not operate while the CPU operating clock is stopped. <3> A break may occur if the STOP mode is entered while the pseudo real-time monitor function being used. 154 User s Manual U18371EJ1V0UM

155 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.3 Flash Programming This section describes the system configuration and startup/shutdown procedure when flash programming is performed for a 78K0R microcontroller, using MINICUBE Specifications of programming function Table 6-7. Specifications of Programming Function Functions Specifications Host interface USB 2.0 (compatible with 1.1) Target interface Target system voltage Clock supply Power supply Acquisition of device-specific information Security flag setting Standalone operation UART (1-wire mode) 2.7 to 5.5 V (depends on the target device) Internal high-speed oscillation clock is used 3 or 5 V (maximum current rating: 100 ma) Parameter file for NEC Electronics PG-FP4 is used Available Unavailable (must be connected to host machine) System configuration Figure 6-16 illustrates the system configuration for flash programming. Figure System Configuration for Flash Programming <5> <4> <3> <1> <6> Target system <2> <1> Host machine Products with USB ports <2> Software Includes the QB-Programmer USB driver, parameter files, and so on. Download these NEC Electronics software from the following website (ODS). URL: <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6> Target connector (sold separately) User s Manual U18371EJ1V0UM 155

156 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER System startup procedure This section describes the system startup procedure. Observe the following order. (1) Preparation and installation of software The following software is required to perform flash programming. For details on preparation and installation of software, refer to the setup manual supplied with MINICUBE2. QB-Programmer USB driver Parameter file (2) Switch setting Set the mode select switch to M1. Set the power select switch by referring to the following table. Caution Do not change the switch setting while the USB cable is connected. Table 6-8. Setting of Power Select Switch Setting Description 3 3 V is supplied from MINICUBE2 to the target system Note. 5 5 V is supplied from MINICUBE2 to the target system Note. T Power supply of the target system is used. MINICUBE2 detects the power for the target system. The detected power is also used as the power supply for the communication interface. Note The maximum rating of the current is 100 ma, so do not use MINICUBE2 with the target system with the higher current rating. The power is always supplied after MINICUBE2 is connected to the host machine. (3) Connecting the target system Connect MINICUBE2 to the target system as shown in Figure 6-17, before the power to the target system is turned on. When the power select switch is set to T, the step of (4) Connecting the USB cable can be performed before this step. Figure Connecting MINICUBE2 to Target System 16-pin target cable MINICUBE2 Target system 156 User s Manual U18371EJ1V0UM

157 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (4) Connecting the USB cable Connect MINICUBE2 to the host machine as shown in Figure 6-18, before the power to the target system is turned on. When the power select switch is set to T, the mode LED flashes white after connection. When the power select switch is set to 3 or 5, the mode LED glows white after connection. The power is always supplied after MINICUBE2 is connected to the host machine with the USB cable. Caution Do not change the switch setting while the USB cable is connected. Figure Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable Host machine (5) Applying power to target system Turn on power to the target system. This step is not necessary if the power select switch is set to 3 or 5. The mode LED glows white after power application. (6) QB-Programmer startup Start the QB-Programmer from the Start menu of Windows. The mode LED glows green after QB-Programmer startup. A series of basic operations after this step is described in the following section. For detailed usage of the QB-Programmer, refer to the QB-Programmer Programming GUI Operation User's Manual. User s Manual U18371EJ1V0UM 157

158 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Usage examples This section describes a series of basic operations using the QB-Programmer, using the µpd78f1166 as an example. The operations from execution of the [Autoprocedure (EPV)] command to programming for the target device are described. For other commands and their applications, refer to the QB-Programmer Programming GUI Operation User's Manual. The conditions used for a series of operations in this section are as follows. <Target system> Target device: Power supply voltage: Communication channel: µpd78f V (supplied from MINICUBE2) UART, 1 Mbps <MINICUBE2> Switches: Mode select switch: M1 Power select switch: 5 <QB-Programmer> Parameter file: Clock setting: Operation mode: Program file: Command options: 78F1166.PRM None (internal high-speed oscillation clock is used) chip sample.hex [Blank check before Erase] selected [Read verify after Program] selected 158 User s Manual U18371EJ1V0UM

159 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (1) Setting of programming environment Set the programming environment, following the steps <1> to <6> described below. <1> Click the [Device] menu on the menu bar and then click [Setup...]. <2> The Device Setup dialog box appears, in which the [Standard] tab is active. Figure [Standard] Tab of Device Setup Dialog Box <3> Click the PRM File Read button to open the Parameter File Select dialog box. Select the parameter file for the target device and then click the Open button. Figure Parameter File Select Dialog Box User s Manual U18371EJ1V0UM 159

160 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER <4> Set the items in the [Target Device Connection], [Operation Mode] and [Supply Oscillator] areas, in accordance with your programming environment. The following figure shows an example. Figure [Standard] Tab of Device Setup Dialog Box After Setting <5> Next, set the items in the [Command options] and [Security flag settings] areas, in accordance with your programming environment. The following figure shows an example. Figure [Advanced] Tab of Device Setup Dialog Box 160 User s Manual U18371EJ1V0UM

161 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER <6> By clicking the OK button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure Completion of Programming Environment Setting User s Manual U18371EJ1V0UM 161

162 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER (2) Selection of program file Select the program file, following the steps <1> to <3> described below. <1> Click the [File] menu on the menu bar and then click [Load...]. <2> The program file select dialog box appears. Figure Program File Select Dialog Box <3> Select the program file for the target device and then click the Open button. Figure Completion of Program File Selection 162 User s Manual U18371EJ1V0UM

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

On-Chip Debug Emulator with Programming

On-Chip Debug Emulator with Programming User s Manual QB-MINI2 On-Chip Debug Emulator with Programming Function User s Manual Target Devices V850 Microcontrollers 78K0R Microcontrollers 78K0 Microcontrollers 78K0S Microcontrollers All information

More information

QB-Programmer. Preliminary User s Manual. Programming GUI Operation CUSTOMER NOTIFICATION. ZUD-CD (1/44) March 6, 2006

QB-Programmer. Preliminary User s Manual. Programming GUI Operation CUSTOMER NOTIFICATION. ZUD-CD (1/44) March 6, 2006 CUSTOMER NOTIFICATION ZUD-CD-06-0006 (1/44) March 6, 2006 Koji Nishibayashi, Group Manager Development Tool Group Multipurpose Microcomputer Systems Division 4th Systems Operations Unit NEC Electronics

More information

E1/E20 Emulator Additional Document for User s Manual (Notes on Connection)

E1/E20 Emulator Additional Document for User s Manual (Notes on Connection) User s Manual Additional Document for User s Manual (Notes on Connection) Supported Devices: V850ES, V850E1 All information contained in these materials, including products and product specifications,

More information

Design Kit (for ANSOFT Designer TM / Nexxim TM ) User s Manual

Design Kit (for ANSOFT Designer TM / Nexxim TM ) User s Manual Technical Note Design Kit (for ANSOFT Designer TM / Nexxim TM ) User s Manual Document No. PX10401EJ03V0TN (3rd edition) Date Published December 2005 CP(K) NEC Compound Semiconductor Devices, Ltd. 2003,

More information

ZENER DIODES RD2.0S to RD150S

ZENER DIODES RD2.0S to RD150S DATA SHEET ZENER DIODES RD2.0S to RD150S ZENER DIODES 200 mw 2-PIN SUPER MINI MOLD DESCRIPTION Type RD2.0S to RD150S series are 2 pin super mini mold package zener diodes possessing an allowable power

More information

Universal Flash Memory Programmer and Serial On-chip Debugger

Universal Flash Memory Programmer and Serial On-chip Debugger Customer Notification QB-MINI2-EE Universal Flash Memory Programmer and Serial On-chip Debugger Operating Precautions Target Devices 78K0/Kx2 Series, 78K0/Fx2 Series 78K0/Lx2 Series, 78K0S/Kx1+ Series

More information

E1/E20 Emulator Additional Document for User s Manual (Notes on Connection of V850E2M and V850E2S)

E1/E20 Emulator Additional Document for User s Manual (Notes on Connection of V850E2M and V850E2S) Additional Document for User s Manual (Notes on Connection of V850E2M and V850E2S) All information contained in these materials, including products and product specifications, represents information on

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

BIPOLAR ANALOG INTEGRATED CIRCUIT

BIPOLAR ANALOG INTEGRATED CIRCUIT DATA SHEET BIPOLAR ANALOG INTEGRATED CIRCUIT µpc29m33a,µpc29m5a THREE-TERMINAL LOW DROPOUT VOLTAGE REGULATOR DESCRIPTION The µpc29m33a, µpc29m5a of low dropout voltage three terminal positive regulators

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

DATA SHEET ZENER DIODES 1.0 W PLANAR TYPE 2-PIN SMALL POWER MINI MOLD. Parameter Symbol Ratings Unit Remarks

DATA SHEET ZENER DIODES 1.0 W PLANAR TYPE 2-PIN SMALL POWER MINI MOLD. Parameter Symbol Ratings Unit Remarks DATA SHEET ZENER DIODES RD2.0FS to RD20FS ZENER DIODES.0 W PLANAR TYPE 2-PIN SMALL POWER MINI MOLD DESCRIPTION Type RD2.0FS to RD20FS series are 2-pin small power mini mold package Zener diodes possessing

More information

INVERTER 84PW021. DATA SHEET DOD-PD-0743 (2nd edition) This DATA SHEET is updated document fromdod-pd-0364(1).

INVERTER 84PW021. DATA SHEET DOD-PD-0743 (2nd edition) This DATA SHEET is updated document fromdod-pd-0364(1). INVERTER DATA SHEET DOD-PD-0743 (2nd edition) This DATA SHEET is updated document fromdod-pd-0364(1). All information is subject to change without notice. Please confirm the sales representative before

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

E1/E20/E2 Emulator, E2 Emulator Lite Additional Document for User s Manual (Notes on Connection of RL78)

E1/E20/E2 Emulator, E2 Emulator Lite Additional Document for User s Manual (Notes on Connection of RL78) E1/E20/E2 Emulator, E2 Emulator Lite Additional Document for User s Manual (Notes on Connection of RL78) Supported Devices: RL78 Family RL78/G10 All information contained in these materials, including

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

BIPOLAR ANALOG INTEGRATED CIRCUIT

BIPOLAR ANALOG INTEGRATED CIRCUIT DATA SHEET BIPOLAR ANALOG INTEGRATED CIRCUIT µ PC16 2.5 V HIGH PRECISION REFEREE VOLTAGE CIRCUIT DESCRIPTION The µ PC16 are high accuracy and low drift voltage references of 2.5 V output voltage. This

More information

E1/E20 Emulator Additional Document for User s Manual (RX User System Design)

E1/E20 Emulator Additional Document for User s Manual (RX User System Design) Additional Document for User s Manual (RX User System Design) Supported Devices: RX Family All information contained in these materials, including products and product specifications, represents information

More information

LASER DIODE NX5322 Series

LASER DIODE NX5322 Series LASER DIODE NX5 Series 1 10 nm FOR 156 Mb/s, 6 Mb/s, 1.5 Gb/s, InGaAsP MQW-FP LASER DIODE DESCRIPTION The NX5 Series is a 1 10 nm Multiple Quantum Well (MQW) structured Fabry-Perot (FP) laser diode with

More information

DATA SHEET. GaAs MMIC SP8T SWITCH FOR MOBILE COMMUNICATIONS

DATA SHEET. GaAs MMIC SP8T SWITCH FOR MOBILE COMMUNICATIONS GaAs INTEGRATED CIRCUIT upg2193t6e GaAs MMIC SP8T SWITCH FOR MOBILE COMMUNICATIONS DESCRIPTION The upg2193t6e is a GaAs MMIC SP8T Switch with SPI control function, which was developed for GSM triple band

More information

78K/0, 78K/0S Series. Preliminary Application Note. 8-Bit Single-Chip Microcontrollers. Flash Memory Write

78K/0, 78K/0S Series. Preliminary Application Note. 8-Bit Single-Chip Microcontrollers. Flash Memory Write Preliminary Application Note 78K/0, 78K/0S Series 8-Bit Single-Chip Microcontrollers Flash Memory Write For entire 78K/0 Series For entire 78K/0S Series Document No. U14458EJ1V0AN00 (1st edition) Date

More information

Programmer for flash micro computers. User s Manual

Programmer for flash micro computers. User s Manual Programmer for flash micro computers User s Manual TESSERA Technology INC. 6th edition 9/2008 Table of Contents Chapter 1 Summary 2 1.1 System Configuration 3 Chapter 2 Installation 4 2.1 System Requirement

More information

MOS INTEGRATED CIRCUIT

MOS INTEGRATED CIRCUIT NEW INFORMATION MOS INTEGRATED CIRCUIT µpd78f9189/9188ct 8-BIT SINGLE-CHIP MICROCONTROLLER The µpd78f9189 is NEW Subseries (small, general-purpose) in the 78K/0S Series. The µpd78f9189 replaces the internal

More information

CM E FUJITSU SEMICONDUCTOR CONTROLLER MANUAL F 2 MC-16L/16LX EMULATION POD MB HARDWARE MANUAL

CM E FUJITSU SEMICONDUCTOR CONTROLLER MANUAL F 2 MC-16L/16LX EMULATION POD MB HARDWARE MANUAL FUJITSU SEMICONDUCTOR CONTROLLER MANUAL CM42-00411-2E F 2 MC-16L/16LX EMULATION POD MB2145-507 HARDWARE MANUAL F 2 MC-16L/16LX EMULATION POD MB2145-507 HARDWARE MANUAL FUJITSU LIMITED PREFACE Using the

More information

Flash Microcomputer Programmer

Flash Microcomputer Programmer Flash Microcomputer Programmer User's Manual Tessera Technology Inc. Date published: August 2017 (6th Edition) TABLE OF CONTENTS CHAPTER 1 OVERVIEW... 5 1.1 System Configuration... 6 CHAPTER 2 INSTALLATION...

More information

E1 Emulator Additional Document for User s Manual (Notes on Connection for RL78)

E1 Emulator Additional Document for User s Manual (Notes on Connection for RL78) User s Manual E1 Emulator Additional Document for User s Manual (Notes on Connection for RL78) Supported Devices: RL78 Family RL78/G13 RL78/G14 RL78/I1A All information contained in these materials, including

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April st, 00, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over

More information

INVERTER 104PW201. DATA SHEET DOD-PP-0047 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PD-1322(1).

INVERTER 104PW201. DATA SHEET DOD-PP-0047 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PD-1322(1). INVERTER 104PW201 DATA SHEET DOD-PP-0047 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PD-1322(1). All information is subject to change without notice. Please confirm

More information

User's Manual. HDMI-CEC Demonstration Board CEC-78K0/KF2A. Tessera Technology Inc. Date published: June 2010 V1.02

User's Manual. HDMI-CEC Demonstration Board CEC-78K0/KF2A. Tessera Technology Inc. Date published: June 2010 V1.02 User's Manual HDMI-CEC Demonstration Board CEC-78K0/KF2A Tessera Technology Inc. Date published: June 2010 V1.02 Windows and Windows XP are registered trademarks or trademarks of Microsoft Corporation

More information

User's Manual. HDMI-CEC Demonstration Board CEC-78K0/KE2C. Tessera Technology Inc. Date published: June 2010 V1.02

User's Manual. HDMI-CEC Demonstration Board CEC-78K0/KE2C. Tessera Technology Inc. Date published: June 2010 V1.02 User's Manual HDMI-CEC Demonstration Board CEC-78K0/KE2C Tessera Technology Inc. Date published: June 2010 V1.02 Windows and Windows XP are registered trademarks or trademarks of Microsoft Corporation

More information

DATA SHEET ZENER DIODES 1 W DO-41 GLASS SEALED PACKAGE

DATA SHEET ZENER DIODES 1 W DO-41 GLASS SEALED PACKAGE DATA SHEET ZENER DIODES 1 W DO-41 GLASS SEALED PACKAGE ZENER DIODES RD2.0F to RD82F DESCRIPTION NEC type RD F Series are DHD (Double Heatsink Diode) Construction planar type zener diodes possessing an

More information

ESD NOISE CLIPPING DIODE NNCD2.0DA to NNCD39DA

ESD NOISE CLIPPING DIODE NNCD2.0DA to NNCD39DA DATA SHEET ESD NOISE CLIPPING DIODE NNCD2.0DA to NNCD39DA ELECTROSTATIC DISCHARGE NOISE CLIPPING DIODE 2-PIN SUPER MINI MOLD DESCRIPTION These products are the diode developed for ESD (Electrostatic Discharge)

More information

User s Manual PG-FP4. Flash Memory Programmer. Document No. U15260EJ3V1UM00 (3rd edition) Date Published March 2003 N CP(K) Printed in Japan

User s Manual PG-FP4. Flash Memory Programmer. Document No. U15260EJ3V1UM00 (3rd edition) Date Published March 2003 N CP(K) Printed in Japan User s Manual PG-FP4 Flash Memory Programmer Document No. U15260EJ3V1UM00 (3rd edition) Date Published March 2003 N CP(K) Printed in Japan 2001 [MEMO] 2 User s Manual U15260EJ3V1UM PG-FP4 complies with

More information

Integrated Development Environment

Integrated Development Environment User s Manual CS+ V4.01.00 Integrated Development Environment Target Device RH850 Family User s Manual: RH850 Debug Tool All information contained in these materials, including products and product specifications,

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

CF-850/F1KM-176-S Hardware Manual

CF-850/F1KM-176-S Hardware Manual CF-850/F1KM-176-S Hardware Manual Date published: May 2018 (1st Edition) Tessera Technology Inc. TS-TUM06992-1 - CAUTION: The information in this document is subject to change without notice. No part of

More information

V850ES/SG3, V850ES/SJ3

V850ES/SG3, V850ES/SJ3 APPLICATION NOTE V850ES/SG3, V850ES/SJ3 V850ES/SG3, V850ES/SJ3 Microcontrollers R01AN0930EJ0200 Rev.2.00 Introduction This application note is intended for users who understand the functions of the V850ES/SG3

More information

PROGRAMMABLE LCD CONTROLLER/DRIVER

PROGRAMMABLE LCD CONTROLLER/DRIVER µpd5 PROGRAMMABLE LCD CONTROLLER/DRIVER 99 995 Document No. IEA-5A (nd edition) (O. D. No. IEM-5E) Data Published March 99 P Printed in Japan The application circuits and their parameters are for reference

More information

nanoease connection manual ML610Qxxx Revision 2.0

nanoease connection manual ML610Qxxx Revision 2.0 nanoease connection manual ML610Qxxx Revision 2.0 Issue Date: Jan. 17, 2012 NOTICE No copying or reproduction of this document, in part or in whole, is permitted without the consent of LAPIS Semiconductor

More information

Corporate names revised in the documents

Corporate names revised in the documents Corporate names revised in the documents The Fujitsu Limited reorganized its LSI business into a wholly owned subsidiary, the Fujitsu Microelectronics Limited on March 21, 2008. The corporate names Fujitsu

More information

CF-850/F1K-144-S Hardware Manual

CF-850/F1K-144-S Hardware Manual CF-850/F1K-144-S Hardware Manual Date published: Jan 2017 (1st Edition) Tessera Technology Inc. TS-TUM05471-1 - CAUTION: The information in this document is subject to change without notice. No part of

More information

KIT-VR4120-TP. User's Manual (Rev.1.01) RealTimeEvaluator

KIT-VR4120-TP. User's Manual (Rev.1.01) RealTimeEvaluator User's Manual (Rev.1.01) RealTimeEvaluator Software Version Up * The latest RTE for Win32 (Rte4win32) can be down-loaded from following URL. http://www.midas.co.jp/products/download/english/program/rte4win_32.htm

More information

RL78 Family. User s Manual. Flash Self-Programming Library Type Bit Single-Chip Microcontrollers. Rev.1.04 Dec 2016.

RL78 Family. User s Manual. Flash Self-Programming Library Type Bit Single-Chip Microcontrollers. Rev.1.04 Dec 2016. User s Manual 表紙 RL78 Family 16 16-Bit Single-Chip Microcontrollers Flash Self-Programming Library Type01 Japanese Release ZIP file name : JP_R_FSL_RL78_T01_Vx.xx_x_E All information contained in these

More information

MOS INTEGRATED CIRCUIT µ PD16510

MOS INTEGRATED CIRCUIT µ PD16510 DATA SEET MOS INTEGRATED CIRCUIT µ PD16510 VERTICAL DRIVER FOR CCD SENSOR The µpd16510 is a vertical driver dedicated for CCD area image sensors that incorporates a level conversion circuit and a three-level

More information

E1/E20 Emulator, E2 Emulator Additional Document for User s Manual (Notes on Connection of RH850/F1K)

E1/E20 Emulator, E2 Emulator Additional Document for User s Manual (Notes on Connection of RH850/F1K) Cover E1/E20 Emulator, E2 Emulator Additional Document for User s Manual (Notes on Connection of RH850/F1K) Supported Devices: RH850 Family RH850/F1x Series All information contained in these materials,

More information

Integrated Development Environment

Integrated Development Environment User s Manual CS+ V4.01.00 Integrated Development Environment Target Device RX Family User s Manual: RX Debug Tool All information contained in these materials, including products and product specifications,

More information

MOS INTEGRATED CIRCUIT

MOS INTEGRATED CIRCUIT DATA SHEET 4M-BIT CMOS STATIC RAM 256K-WORD BY 16-BIT EXTENDED TEMPERATURE OPERATION MOS INTEGRATED CIRCUIT µpd444012a-x Description The µpd444012a-x is a high speed, low power, 4,194,304 bits (262,144

More information

EX-9686U/A-L(A9) Hardware User Manual

EX-9686U/A-L(A9) Hardware User Manual EX-9686U/A-L(A9) Hardware User Manual Release Notes Version Release Date Notes 1.00 November, 2013 Initial Release 2.00 January, 2014 The 2 nd release Disclaimer This documentation is provided for use

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2 REJ10J1644-0100 E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2 Renesas Microcomputer Development Environment System M16C Family / R8C/Tiny Series Notes on Connecting the R8C/10, R8C/11,

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

New 8FX Family 8-bit MICROCONTROLLER BGM ADAPTOR MB E OPERATION MANUAL

New 8FX Family 8-bit MICROCONTROLLER BGM ADAPTOR MB E OPERATION MANUAL FUJITSU SEMICONDUCTOR SUPPORT SYSTEM SS702-00001-1v0-E New 8FX Family 8-bit MICROCONTROLLER BGM ADAPTOR MB2146-07-E OPERATION MANUAL PREFACE Thank you for purchasing the New 8FX Family All Series BGM adapter

More information

Notice. (Rev November 2017)

Notice. (Rev November 2017) Cover E1/E20 Emulator, E2 Emulator Additional Document for User s Manual (Notes on Connection of RH850/F1H and RH850/F1M) Supported Devices: RH850 Family RH850/F1x Series All information contained in these

More information

EB-V850ES/HG2-EE. User s Manual. Demonstration Kit for the H_Line Family. Document No. EBV850ESHG2EE_V100 Date Published November 2005

EB-V850ES/HG2-EE. User s Manual. Demonstration Kit for the H_Line Family. Document No. EBV850ESHG2EE_V100 Date Published November 2005 User s Manual EB-V850ES/HG2-EE Demonstration Kit for the H_Line Family Document No. EBV850ESHG2EE_V100 Date Published November 2005 NEC Electronics (Europe) GmbH The information in this document is current

More information

M16C R8C FoUSB/UART Debugger. User s Manual REJ10J

M16C R8C FoUSB/UART Debugger. User s Manual REJ10J REJ10J1217-0100 M16C R8C FoUSB/UART Debugger User s Manual RENESAS MICROCOMPUTER Development Environment System M16C Family R8C/Tiny Series Precautions on Connecting R8C/20, R8C/21, R8C/22, R8C/23 Rev.1.00

More information

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9 REJ10J1646-0100 E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9 Renesas Microcomputer Development Environment System M16C Family / R8C/Tiny Series Notes on Connecting the R8C/18, R8C/19,

More information

FL-850/FL4H FL-850/FL4H-S Hardware Manual

FL-850/FL4H FL-850/FL4H-S Hardware Manual FL-850/FL4H FL-850/FL4H-S Hardware Manual Date published: September 2011 (2nd Edition) Tessera Technology Inc. - 1 - CAUTION: The information in this document is subject to change without notice. No part

More information

MOS INTEGRATED CIRCUIT

MOS INTEGRATED CIRCUIT DATA SHEET 256K-BIT CMOS STATIC RAM 32K-WORD BY 8-BIT MOS INTEGRATED CIRCUIT μpd43256b Description The μpd43256b is a high speed, low power, and 262,144 bits (32,768 words by 8 bits) CMOS static RAM. Battery

More information

Achieve Easy Plug & Play 1/ 6

Achieve Easy Plug & Play 1/ 6 Achieve Easy Plug & Play 1/ 6 2/ 6 Master Control Unit Temp. Control Unit 20V Heater UART /USB Temp. Controller Sensor ED Control Unit ED Driver Red ED White ED Fan Control Unit FAN Driver FAN Communication

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

Flash Self-programming Library

Flash Self-programming Library 16 Flash Self-programming Library Type T01, European Release 16 Bit Single-chip Microcontroller RL78 Series Installer: RENESAS_FSL_RL78_T01E_Vx.xxx All information contained in these materials, including

More information

Renesas Flash Programmer

Renesas Flash Programmer User s Manual Renesas Flash Programmer Flash memory programming software User s Manual All information contained in these materials, including products and product specifications, represents information

More information

FUJITSU SEMICONDUCTOR SUPPORT SYSTEM SS E DSU-FR EMULATOR F 2 MC-16FX EXPANSION TRACE BOARD MB E OPERATION MANUAL

FUJITSU SEMICONDUCTOR SUPPORT SYSTEM SS E DSU-FR EMULATOR F 2 MC-16FX EXPANSION TRACE BOARD MB E OPERATION MANUAL FUJITSU SEMICONDUCTOR SUPPORT SYSTEM SS01-71076-1E DSU-FR EMULATOR F 2 MC-16FX EXPANSION TRACE BOARD MB2198-590-E OPERATION MANUAL PREFACE Thank you for purchasing the DSU-FR* 1 emulator F 2 MC* 2-16FX

More information

ABLIC Inc., Rev.1.4_00

ABLIC Inc., Rev.1.4_00 www.ablicinc.com S-35720 Series FOR AUTOMOTIVE 125 C OPERATION WITH INTERRUPT TIME SETTING PIN CONVENIENCE TIMER ABLIC Inc., 2015-2018 Rev.1.4_00 The convenience timer is a CMOS timer IC which operates

More information

LASER DIODE NX7304BG-CC

LASER DIODE NX7304BG-CC DATA SHEET LASER DIODE NX7304BG-CC 1 310 nm InGaAsP MQW-FP LASER DIODE COAXIAL MODULE FOR FIBEROPTIC COMMUNICATIONS DESCRIPTION The NX7304BG-CC is a 1 310 nm Multiple Quantum Well (MQW) structured Fabry-Perot

More information

M16C APPLICATION NOTE. Target Setup for the In-Circuit Debugger. 1.0 Abstract. 2.0 Introduction

M16C APPLICATION NOTE. Target Setup for the In-Circuit Debugger. 1.0 Abstract. 2.0 Introduction APPLICATION NOTE MC.0 Abstract The ICD (In-Circuit Debugger), or USB-Monitor, is a low cost, compact interface that has two functions for Renesas MC Flash microcontrollers: ) an in-circuit debugger tool

More information

INVERTER 150PW331. DATA SHEET DOD-PP-0479 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PP-0415(1).

INVERTER 150PW331. DATA SHEET DOD-PP-0479 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PP-0415(1). INVERTER 150PW331 DATA SHEET DOD-PP-0479 (1st edition) This DATA SHEET is updated document from PRELIMINARY DATA SHEET DOD-PP-0415(1). All information is subject to change without notice. Please confirm

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

Preliminary MK-CY-043. Data Sheet. Amulet Capacitive 4.3 GEMmodule. Introduction:

Preliminary MK-CY-043. Data Sheet. Amulet Capacitive 4.3 GEMmodule. Introduction: Introduction: Amulet Capacitive 4.3 GEMmodule Data Sheet Preliminary The is a 4.3 fully integrated, production ready color module with smartphone-like features. Using Cypress TrueTouch technology, this

More information

USB-to-I2C. Professional Hardware User s Manual.

USB-to-I2C. Professional Hardware User s Manual. USB-to-I2C Professional Hardware User s Manual https://www.i2ctools.com/ Information provided in this document is solely for use with the USB-to-I2C Professional product from SB Solutions, Inc. SB Solutions,

More information

STAND-ALONE PROGRAMMER

STAND-ALONE PROGRAMMER Fujitsu Semiconductor Design (Chengdu) Co., Ltd. MCU-AN-500108-E-18 New 8FX FAMILY 8-BIT MICROCONTROLLER ALL SERIES STAND-ALONE PROGRAMMER Revision History Revision History Version Date Updated by Modifications

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

Win-I2CUSB Hardware User s Manual

Win-I2CUSB Hardware User s Manual Win-I2CUSB Hardware User s Manual http://www.demoboard.com Information provided in this document is solely for use with the Win-I2CUSB product from The Boardshop. The Boardshop and SB Solutions, Inc. reserve

More information

FEBL620Q504H_RB-01. ML620Q504H Reference Board User s Manual

FEBL620Q504H_RB-01. ML620Q504H Reference Board User s Manual FEBL620Q504H_RB-01 ML620Q504H Reference Board User s Manual Issue Date: AUG 31, 2015 Notes 1) The information contained herein is subject to change without notice. 2) Although LAPIS Semiconductor is continuously

More information

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents To our customers, Old Company Name in Catalogs and Other Documents On April 1 st, 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took

More information

32-Bit Single-Chip Microcontroller

32-Bit Single-Chip Microcontroller User s Manual 32 RH850 Family Japanese Release ZIP file name: JP_R_FCL_RH850_T01_Vx.xx_x_E 32-Bit Single-Chip Microcontroller Supported Devices: RH850/F1L All information contained in these materials,

More information

MN101E50 Series. 8-bit Single-chip Microcontroller

MN101E50 Series. 8-bit Single-chip Microcontroller 8-bit Single-chip Microcontroller Overview The MN101E series of 8-bit single-chip microcomputers (the memory expansion version of MN101C series) incorporate multiple types of peripheral functions. This

More information

SII Semiconductor Corporation, Rev.2.2_01

SII Semiconductor Corporation, Rev.2.2_01 www.sii-ic.com TEMPERATURE SWITCH IC (THERMOSTAT IC) SII Semiconductor Corporation, 2009-2015 Rev.2.2_01 The is a temperature switch IC (thermostat IC) which detects the temperature with a temperature

More information

Controller Board for Projected Capacitive Touch Screen DUS3100 Product Specification

Controller Board for Projected Capacitive Touch Screen DUS3100 Product Specification Controller Board for Projected Capacitive Touch Screen DUS3100 Product Specification Table of Contents 1.Applicable Product... 2 2. Product Specification... 2 2-1. Touch Screen Board Specification... 2

More information

Renesas Flash Programmer V3.05

Renesas Flash Programmer V3.05 Flash memory programming software User s Manual All information contained in these materials, including products and product specifications, represents information on the product at the time of publication

More information

Revision: 0.30 June Intel Server Board S1200RP UEFI Development Kit Firmware Installation Guide

Revision: 0.30 June Intel Server Board S1200RP UEFI Development Kit Firmware Installation Guide Revision: 0.30 June 2016 Intel Server Board S1200RP UEFI Development Kit Firmware Installation Guide Intel Server Board S1200RP UEFI Development Kit Firmware Installation Guide INFORMATION IN THIS DOCUMENT

More information

Nios Embedded Processor Development Board

Nios Embedded Processor Development Board Nios Embedded Processor Development Board July 2003, ver. 2.2 Data Sheet Introduction Development Board Features Functional Overview This data sheet describes the features and functionality of the Nios

More information

Controller Board for Projected Capacitive Touch Screen DUS1000 Product Specification

Controller Board for Projected Capacitive Touch Screen DUS1000 Product Specification Controller Board for Projected Capacitive Touch Screen DUS1000 Product Specification Table of Contents 1. Applicable Product... 2 2. Product Specification... 2 2-1. Touch Screen Board Specification...

More information

Preliminary. PACKAGE - 28-pin MLP (5mm X 5mm) Example Circuit Diagram CP V. 48MHz Oscillator. USB Function Controller 512B EEPROM

Preliminary. PACKAGE - 28-pin MLP (5mm X 5mm) Example Circuit Diagram CP V. 48MHz Oscillator. USB Function Controller 512B EEPROM Preliminary Single-Chip USB to UART Bridge SINGLE-CHIP USB to UART DATA TRANSFER - Integrated USB Transceiver; No External Resistors Required - Integrated Clock; No External Crystal Required - Integrated

More information

APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE

APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE AN-E-2246 APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE CHARACTER DISPLAY MODULE M22SD8GS GENERAL DESCRIPTION Futaba Vacuum Fluorescent Display M22SD8GS, with Futaba VFD 22-SD-8GK display, produces

More information

For More Information Please contact your local sales office for additional information about Cypress products and solutions.

For More Information Please contact your local sales office for additional information about Cypress products and solutions. The following document contains information on Cypress products. The document has the series name, product name, and ordering part numbering with the prefix MB. However, Cypress will offer these products

More information

APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE

APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE AN-E-2244 APPLICATION NOTE VACUUM FLUORESCENT DISPLAY MODULE CHARACTER DISPLAY MODULE M2SD3GS GENERAL DESCRIPTION Futaba Vacuum Fluorescent Display M2SD3GS, with Futaba VFD 2-SD-3G display, produces 2

More information

UnRegistered MB39C602 LED LIGHTING SYSTEM BULB 9W ZIGBEE CONTROL USER MANUAL. Fujitsu Semiconductor Design (Chengdu) Co. Ltd.

UnRegistered MB39C602 LED LIGHTING SYSTEM BULB 9W ZIGBEE CONTROL USER MANUAL. Fujitsu Semiconductor Design (Chengdu) Co. Ltd. Fujitsu Semiconductor Design (Chengdu) Co. Ltd. User Manual ANA-UM-500001-E-10 MB39C602 LED LIGHTING SYSTEM BULB 9W ZIGBEE CONTROL USER MANUAL MB39C601 LED LIGHTING SYSTEM BULB 9W ZIGBEE CONTROL Revision

More information

Controller Board for Projected Capacitive Touch Screen DUS2000 Product Specification

Controller Board for Projected Capacitive Touch Screen DUS2000 Product Specification Controller Board for Projected Capacitive Touch Screen DUS2000 Product Specification Table of Contents 1. Applicable Product... 2 2. Product Specification... 2 2-1. Touch Screen Board Specification...

More information

BGM Adaptor MB E Operation Manual. 8FX Family 8-bit Microcontroller. Doc. # Rev. *A

BGM Adaptor MB E Operation Manual. 8FX Family 8-bit Microcontroller. Doc. # Rev. *A 8FX Family 8-bit Microcontroller BGM Adaptor MB2146-07-E Operation Manual Doc. # 002-05543 Rev. *A Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone (USA): 800.858.1810 Phone (Intnl):

More information

RTE-V850E/GP1-IE USER'S MANUAL (REV.1.01) RealTimeEvaluator

RTE-V850E/GP1-IE USER'S MANUAL (REV.1.01) RealTimeEvaluator RTE-V850E/GP1-IE USER'S MANUAL (REV.1.01) RealTimeEvaluator REVISION HISTORY Rev. 1.00 June 20, 2002 Rev. 1.01 November 15, 2002 First edition Revising following chapters * "Measured value of execution

More information

ETHERNET_FLASH_LOADER

ETHERNET_FLASH_LOADER MCU-AN-510048-E-10 32-BIT MICROCONTROLLER MB9B610 Series ETHERNET_FLASH_LOADER USER MANUAL TM ARM and Cortex-M3 are the trademarks of ARM Limited in the EU and other countries. Revision History Revision

More information

General Operating, Maintenance and Installation Manual

General Operating, Maintenance and Installation Manual General Operating, Maintenance and Installation Manual Hardware Platform for Protocol Converter Small Embedded Controller - SEC2-91056 Erlangen Telephone +49 9131 92076-0 Fax: +49 9131 92076-10 Internet:

More information

Serial Flash Microcomputer. Programmer S550-SFW1U. Operation Manual. Sunny Giken Inc.

Serial Flash Microcomputer. Programmer S550-SFW1U. Operation Manual. Sunny Giken Inc. Serial Flash Microcomputer Programmer S550-SFW1U Operation Manual Sunny Giken Inc. Serial Flash Microcomputer Programmer S550-SFW1U The contents of this manual may be revised without notice. We, Sunny

More information

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual

PCI bit Digital Input/ Output Card for PCI Bus. User s Manual PCI-1751 48-bit Digital Input/ Output Card for PCI Bus User s Manual Copyright This documentation and the software included with this product are copyrighted 1998 by Advantech Co., Ltd. All rights are

More information

DALI Master Controller GUI

DALI Master Controller GUI User's Manual All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject to change by Renesas

More information

M16C R8C FoUSB/UART Debugger. User Manual REJ10J

M16C R8C FoUSB/UART Debugger. User Manual REJ10J REJ10J1725-0100 M16C R8C FoUSB/UART Debugger User Manual Renesas Microcomputer Development Environment System R8C Family R8C/2x Series Notes on Connecting R8C/2A, R8C/2B, R8C/2C, R8C/2D Rev.1.00 Issued

More information

HITACHI. EH-150 series PLC EH-RTD8 Resistance Temperature Detective input module Instruction manual. Safety precautions

HITACHI. EH-150 series PLC EH-RTD8 Resistance Temperature Detective input module Instruction manual. Safety precautions HITACHI EH-150 series PLC Resistance Temperature Detective input module Instruction manual Thank you for purchasing a Hitachi Programmable Logic Controller. To operate it safely, please read this instruction

More information