NEC QB-MINI2 User Manual

On-chip debug emulator with programming function
Table of Contents

Advertisement

Quick Links

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

Advertisement

Table of Contents
loading

Summary of Contents for NEC QB-MINI2

  • Page 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...
  • Page 2 [MEMO] User’s Manual U18371EJ1V0UM...
  • Page 3 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.
  • Page 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 •...
  • Page 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.
  • Page 6 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 Document Number QB-MINI2 On-Chip Debug Emulator with Programming Function This document ID850QB Ver. 3.20 Integrated Debugger Operation U17964E ID78K0-QB Ver.
  • Page 7: Table Of Contents

    CONTENTS CHAPTER 1 OVERVIEW........................... 10 1.1 Features ............................10 1.2 Notes Before Using MINICUBE2 ....................11 1.3 Supported Devices........................11 1.4 Hardware Specifications ......................12 CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE ..............13 2.1 Names of Supplied Hardware ..................... 13 2.2 Part Names and Functions of MINICUBE2 ................
  • Page 8 4.2.5 Clock setting..........................77 4.2.6 Securing of user resources and setting of security ID .............. 80 4.2.7 Cautions on debugging ........................ 86 4.3 Flash Programming........................90 4.3.1 Specifications of programming function ..................90 4.3.2 System configuration ........................90 4.3.3 System startup procedure......................91 4.3.4 Usage examples ..........................
  • Page 9 6.3 Flash Programming ........................155 6.3.1 Specifications of programming function ...................155 6.3.2 System configuration ........................155 6.3.3 System startup procedure ......................156 6.3.4 Usage examples...........................158 6.3.5 System shutdown procedure......................164 6.3.6 Cautions on flash programming....................164 CHAPTER 7 SELF-TESTING ........................165 7.1 System Configuration........................ 165 7.2 Self-Testing Procedure......................
  • Page 10: Chapter 1 Overview

    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.
  • Page 11: Notes Before Using Minicube2

    • MINICUBE2 information site URL: http://www.necel.com/micro/english/product/sc/allflash/minicube2.html 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...
  • Page 12: Hardware Specifications

    CHAPTER 1 OVERVIEW 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 Operating power supply Supplied via USB interface (5 V) Temperature: ±0 to +40°C Operating environment...
  • Page 13: Chapter 2 Names And Functions Of Hardware

    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.
  • Page 14: Part Names And Functions Of Minicube2

    CHAPTER 2 NAMES AND FUNCTIONS OF HARDWARE 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 USB interface USB interface Target interface Target interface...
  • Page 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.
  • Page 16: Part Names And Functions Of 78K0-Ocd Board

    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.
  • Page 17: Chapter 3 How To Use Minicube2 With V850 Microcontroller

    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.
  • Page 18: Target System Design

    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 Refer to the document ″QB-MINI2 (such as PG-FP4), but some devices do not support some of them.
  • Page 19: Pin Assignment

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.1.1 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.
  • Page 20: Circuit Connection Examples

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.1.2 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.
  • Page 21 CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER Figure 3-2. Recommended Circuit Connection When UART Is Used for Communication Interface 3 to 10 kΩ 3 to 10 kΩ Target connector Target connector Target device Target device RESET_OUT RESET_OUT _RESET _RESET Note 1 Note 1...
  • Page 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 1 to 10 kΩ 1 to 10 kΩ 3 to 10 kΩ 3 to 10 kΩ Target connector Target connector Target device Target device RESET_OUT...
  • Page 23: Connection Of Reset Pin

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.1.3 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.
  • Page 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 3.1.2 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Ω...
  • Page 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.
  • Page 26: Mounting Connector Onto Target System

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.1.4 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. •...
  • Page 27: On-Chip Debugging

    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 MINICUBE2. 3.2.1 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.
  • Page 28: System Configuration

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 29: System Startup Procedure

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.2.3 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.
  • Page 30 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.
  • Page 31: System Shutdown Procedure

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.2.4 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.
  • Page 32: Securing Of User Resources And Setting Of Security Id

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.2.5 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.
  • Page 33 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 •...
  • Page 34 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.
  • Page 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.
  • Page 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 PMCCM PMCM Note Read-only x: Any Note The port values corresponding to the H/S pin are changed by the monitor program according to the debugger status.
  • Page 37 0x9A 0x75 0xBC 0x76 0xDE 0x77 0xF1 0x78 0x23 0x79 0xD4 If NEC Electronics compiler CA850 is used, the security ID can be set using the Compiler Common Options menu. Figure 3-13. Security ID Setting with CA850 User’s Manual U18371EJ1V0UM...
  • Page 38: Cautions On Debugging

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.2.6 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.
  • Page 39 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.
  • Page 40: Flash Programming

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 41: System Startup Procedure

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.3.3 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.
  • Page 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″...
  • Page 43: Usage Examples

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.3.4 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.
  • Page 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 3-17.
  • Page 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 3-19. [Standard] Tab of Device Setup Dialog Box After Setting µ...
  • Page 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 3-21. [Advanced] Tab of Device Setup Dialog Box <7>...
  • Page 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 3-23.
  • Page 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.
  • Page 49: System Shutdown Procedure

    CHAPTER 3 HOW TO USE MINICUBE2 WITH V850 MICROCONTROLLER 3.3.5 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.
  • Page 50: Chapter 4 How To Use Minicube2 With 78K0 Microcontroller

    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.
  • Page 51: Target System Design

    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.
  • Page 52: Pin Assignment

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1.1 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.
  • Page 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.
  • Page 54: Circuit Connection Examples

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1.2 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.
  • Page 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 Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ RESET_OUT RESET_OUT _RESET...
  • Page 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 Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ...
  • Page 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 Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ...
  • Page 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 Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ RESET_OUT RESET_OUT _RESET...
  • Page 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) Target connector Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ...
  • Page 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) Target connector Target connector Target device Target device 3 to 10 kΩ 3 to 10 kΩ...
  • Page 61 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-9. When Only Debugging Is Performed (with X1/X2 Communication) 1 kΩ 1 kΩ Reset connector Reset connector RESET signal RESET signal Target connector Target connector 10 kΩ 10 kΩ Target device Target device Note 1 Note 1...
  • Page 62 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-10. When Only Debugging Is Performed (with OCD1A/OCD1B Communication) 3 to 3 to 1 kΩ 1 kΩ Reset connector Reset connector 10 kΩ 10 kΩ RESET signal RESET signal Target connector Target connector 10 kΩ...
  • Page 63 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-11. When Only Programming Is Performed 3 to 10 kΩ 3 to 10 kΩ Target connector Target connector Target device Target device RESET_OUT RESET_OUT _RESET _RESET Note 1 Note 1 Note 2 Note 2 Note 2...
  • Page 64: Connection Of Reset Pin

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1.3 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.
  • Page 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 4.1.2 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 Ω...
  • Page 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 4-15.
  • Page 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 4-16.
  • Page 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.
  • Page 69: Cautions On Target System Design

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1.4 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.
  • Page 70: Mounting Connector Onto Target System

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.1.5 Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. 2.54 mm pitch 10- or 16-pin general-purpose connector can be used. The following products are recommended.
  • Page 71: On-Chip Debugging

    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 MINICUBE2. 4.2.1 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.
  • Page 72: System Configuration

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 78K0-OCD board (accessory) <6>...
  • Page 73: System Startup Procedure

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2.3 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.
  • Page 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 4-20. 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 4-22.
  • Page 75 Securing of user resources and setting of security ID. • Unsupported software (debugger, device file, or firmware) is used Refer to the document ″ QB-MINI2 The software used may not support debugging of the target device. Operating Precautions ″ and check the supported version.
  • Page 76: System Shutdown Procedure

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2.4 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.
  • Page 77: Clock Setting

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2.5 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...
  • Page 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. ″...
  • Page 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.
  • Page 80: Securing Of User Resources And Setting Of Security Id

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2.6 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.
  • Page 81 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.
  • Page 82 [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 ″...
  • Page 83 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-31. 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.
  • Page 84 [How to secure ″ debug monitor area + 256 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.
  • Page 85 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER Figure 4-33. 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. ″...
  • Page 86: Cautions On Debugging

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.2.7 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.
  • Page 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 ← (1) MOV FLPMC,#1H MOV FLPMC,#0FEH MOV FLPMC,#1H ----------------------- From this position ←...
  • Page 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.
  • Page 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)>...
  • Page 90: Flash Programming

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 91: System Startup Procedure

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.3.3 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.
  • Page 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 ″...
  • Page 93: Usage Examples

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.3.4 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.
  • Page 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 4-37.
  • Page 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 4-39. [Standard] Tab of Device Setup Dialog Box After Setting <5>...
  • Page 96 CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER <6> By clicking the button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure 4-41. Completion of Programming Environment Setting User’s Manual U18371EJ1V0UM...
  • Page 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 4-42.
  • Page 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.
  • Page 99: System Shutdown Procedure

    CHAPTER 4 HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 4.3.5 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.
  • Page 100: Chapter 5 How To Use Minicube2 With 78K0S Microcontroller

    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.
  • Page 101: Target System Design

    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.
  • Page 102: Pin Assignment

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.1 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.
  • Page 103: Circuit Connection Example

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.2 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.
  • Page 104: Connection Of Reset Pin

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.3 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.
  • Page 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 5.1.2 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Ω...
  • Page 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.
  • Page 107: Connection Of Intp Pin

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.4 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.
  • Page 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 1 kΩ 1 kΩ Target connector Target connector Target device Target device Jumper...
  • Page 109: Connection Of X1 And X2 Pins

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.5 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.
  • Page 110: Mounting Connector Onto Target System

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.1.6 Mounting connector onto target system The connector must be mounted on the target system for connecting MINICUBE2 with the target system. 2.54 mm pitch 16-pin general-purpose connector can be used. The following products are recommended.
  • Page 111: On-Chip Debugging

    , X2 , 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).
  • Page 112: System Configuration

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 113: System Startup Procedure

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2.3 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.
  • Page 114 The software used may not support debugging of the target device. 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.
  • Page 115: System Shutdown Procedure

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2.4 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.
  • Page 116: Securing Of User Resources

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2.5 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.
  • Page 117 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.
  • Page 118 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER Describe the address to the portion of ″0ed0h″ in accordance with the flash memory capacity of the Remark target device (see the following table). Flash Memory Capacity of Value Described in Target Device Assembler Source 1 KB...
  • Page 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.
  • Page 120: Debugging Of Alternate-Functions Of X1 And X2 Pins

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2.6 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.
  • Page 121: Cautions On Debugging

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.2.7 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.
  • Page 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.
  • Page 123: Flash Programming

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 124: System Startup Procedure

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.3.3 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.
  • Page 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″...
  • Page 126: Usage Examples

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.3.4 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.
  • Page 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 5-20.
  • Page 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 5-22. [Standard] Tab of Device Setup Dialog Box After Setting <5>...
  • Page 129 CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER <6> By clicking the button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure 5-24. Completion of Programming Environment Setting User’s Manual U18371EJ1V0UM...
  • Page 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 5-25.
  • Page 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.
  • Page 132: System Shutdown Procedure

    CHAPTER 5 HOW TO USE MINICUBE2 WITH 78K0S MICROCONTROLLER 5.3.5 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.
  • Page 133: Chapter 6 How To Use Minicube2 With 78K0R Microcontroller

    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.
  • Page 134: Target System Design

    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.
  • Page 135: Pin Assignment

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.1.1 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.
  • Page 136: Circuit Connection Example

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.1.2 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.
  • Page 137: Connection Of Reset Pin

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.1.3 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.
  • Page 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 6.1.2 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Ω...
  • Page 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.
  • Page 140: Mounting Connector Onto Target System

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.1.4 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. •...
  • Page 141: On-Chip Debugging

    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 MINICUBE2. 6.2.1 Debug functions Table 6-4 lists the debug functions when a 78K0R microcontroller is the target device and the ID78K0R-QB is used.
  • Page 142: System Configuration

    <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 143: System Startup Procedure

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.2.3 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.
  • Page 144 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.
  • Page 145: System Shutdown Procedure

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.2.4 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.
  • Page 146: 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.
  • Page 147 [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.
  • Page 148 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]″...
  • Page 149 (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.
  • Page 150 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER Figure 6-14. 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. User’s Manual U18371EJ1V0UM...
  • Page 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.
  • Page 152: Cautions On Debugging

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.2.6 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.
  • Page 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.
  • Page 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>...
  • Page 155 <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: http://www.necel.com/micro/ods/eng/ <3> USB cable (accessory) <4> MINICUBE2 (this product) <5> 16-pin target cable (accessory) <6>...
  • Page 156 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.3.3 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.
  • Page 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″...
  • Page 158 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.3.4 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.
  • Page 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 6-19.
  • Page 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 6-21. [Standard] Tab of Device Setup Dialog Box After Setting <5>...
  • Page 161 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER <6> By clicking the button, the programming environment is set and the Device Setup dialog box is closed. The main window appears as follows. Figure 6-23. Completion of Programming Environment Setting User’s Manual U18371EJ1V0UM...
  • Page 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 6-24.
  • Page 163 CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R 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], and [Verify] commands are executed for the target device sequentially.
  • Page 164: System Shutdown Procedure

    CHAPTER 6 HOW TO USE MINICUBE2 WITH 78K0R MICROCONTROLLER 6.3.5 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.
  • Page 165: Chapter 7 Self-Testing

    Products with USB ports <2> Software Includes the USB driver and MINICUBE2 diagnostic tool. These software can be installed when an NEC Electronics debugger or QB-Programmer is installed. Download these NEC Electronics software from the following website (ODS). URL: http://www.necel.com/micro/ods/eng/ <3>...
  • Page 166: Self-Testing Procedure

    Host machine (4) Startup of MINICUBE2 diagnostic tool Start the MINICUBE2 diagnostic tool. If the MINICUBE2 diagnostic tool was installed when NEC Electronics software was installed, the diagnostic tool is registered on the Start menu as follows. ″NEC Electronics″→″MINICUBE Utilities″→″Vx.xx (version)″...
  • Page 167: Chapter 8 Firmware Update

    Products with USB ports <2> Software Includes the USB driver and MINICUBE2 diagnostic tool. These software can be installed when an NEC Electronics debugger or QB-Programmer is installed. Download these NEC Electronics software from the following website (ODS). URL: http://www.necel.com/micro/ods/eng/ <3>...
  • Page 168: Firmware Update Procedure

    Host machine (4) Startup of MINICUBE2 diagnostic tool Start the MINICUBE2 diagnostic tool. If the MINICUBE2 diagnostic tool was installed when NEC Electronics software was installed, the diagnostic tool is registered on the Start menu as follows. ″NEC Electronics″→″MINICUBE Utilities″→″Vx.xx (version)″...
  • Page 169 Kawasaki, Kanagawa 211-8668, Japan Tel: 044-435-5111 http://www.necel.com/ [Asia & Oceania] [America] [Europe] NEC Electronics (China) Co., Ltd NEC Electronics America, Inc. NEC Electronics (Europe) GmbH 7th Floor, Quantum Plaza, No. 27 ZhiChunLu Haidian 2880 Scott Blvd. Arcadiastrasse 10 District, Beijing 100083, P.R.China Santa Clara, CA 95050-2554, U.S.A.
  • Page 170 X-ON Electronics Largest Supplier of Electrical and Electronic Components Click to view similar products for manufacturer: Other Similar products are found below : NL128102AC31-01 621488F NL10276AC28-02 NL10276AC30-04R EE2-4.5NUH NL8060AC26-11/VIS EF2-5SNU UPC1352C EE2- 24TNU UPD43256BCZ-85-LL UA2-4.5SNU QF62V1 UD2-9NU EE2-3TNUX UA2-4.5NU UD2-4.5NE NL6448AC30-09 UPA1572H RB06H2C12 65LHS-3L EE2-5SNU EC2-24NJ MN41C4256A-07 EE2-4.5SNUX EF2-1.5SNU MR62-5SR EC2-4.5NU EF2-4.5NUX EC2-12TNU EE2-5TNU EA2-3SNU NL6448AC20-06 ED2-24NU EC2-24SNJ UPD70F3102GJ-A33-8EU EB2-24TNU EE2-4.5NU EE2- 3TNU UA2-1.5NU UB2-5SNU UB2-1.5NU UD2-4.5SNUN EE2-12NUH UA2-9NU UPD4218165G5-60-7JF EP2-B3G1S-1-D EE2-...

This manual is also suitable for:

Minicube2

Table of Contents