background image

CHAPTER  4   HOW TO USE MINICUBE2 WITH 78K0 MICROCONTROLLER 

User’s Manual    U18371EJ1V0UM 

79

(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. 

Summary of Contents for MINICUBE2

Page 1: ...hed November 2006 NS CP K Printed in Japan User s Manual QB MINI2 On Chip Debug Emulator with Programming Function Target Devices V850 Microcontrollers 78K0R Microcontrollers 78K0 Microcontrollers 78K0S Microcontrollers NEC Electronics Corporation 2006 ...

Page 2: ...User s Manual U18371EJ1V0UM 2 MEMO ...

Page 3: ...ile 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 desig...

Page 4: ...here 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 a...

Page 5: ...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 MINIC...

Page 6: ...arked 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 2 90 Integrated Debugger Operation U17437E ID78K0S QB Ver 2 81 Integrated Debugger Operation U17287E ID78K0R QB Ver 3 20 Integrated Debugger Operation U17839E Ca...

Page 7: ... configuration 28 3 2 3 System startup procedure 29 3 2 4 System shutdown procedure 31 3 2 5 Securing of user resources and setting of security ID 32 3 2 6 Cautions on debugging 38 3 3 Flash Programming 40 3 3 1 Specifications of programming function 40 3 3 2 System configuration 40 3 3 3 System startup procedure 41 3 3 4 Usage examples 43 3 3 5 System shutdown procedure 49 3 3 6 Cautions on flash...

Page 8: ...ion 112 5 2 3 System startup procedure 113 5 2 4 System shutdown procedure 115 5 2 5 Securing of user resources 116 5 2 6 Debugging of alternate functions of X1 and X2 pins 120 5 2 7 Cautions on debugging 121 5 3 Flash Programming 123 5 3 1 Specifications of programming function 123 5 3 2 System configuration 123 5 3 3 System startup procedure 124 5 3 4 Usage examples 126 5 3 5 System shutdown pro...

Page 9: ...ration 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 166 CHAPTER 8 FIRMWARE UPDATE 167 8 1 System Configuration 167 8 2 Firmware Update Procedure 168 ...

Page 10: ...rams 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 suppo...

Page 11: ...R Target system design 5 1 Target System Design On chip debugging 5 2 On Chip Debugging 78K0S 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 78K0R Flash memory programming 6 3 Flash Programming MINICUBE2 self testing CHAPTER 7 SELF TESTING Expansion of sup...

Page 12: ...10 to 80 RH no condensation Storage environment conditions Temperature 15 to 60 C Humidity 10 to 80 RH no condensation External dimensions 48 48 13 9 mm MINICUBE2 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 Host machine interface Current consumption 500 mA max T...

Page 13: ...er 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 78K0 OCD board A 20 MHz oscillator mounted USB cable 16 pin target cable 1...

Page 14: ...crocontroller 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...

Page 15: ... started and CPU is in the break mode Blue Flashing A debugger for V850 microcontrollers has been started and the CPU is running or a program is being downloaded Glowing A debugger for 78K0 microcontrollers has been started and the CPU is in the break mode Orange Flashing A debugger for 78K0 microcontrollers has been started and the CPU is running or a program is being downloaded Glowing A debugge...

Page 16: ...ure an oscillation circuit can be mounted on the 14 pin DIP socket A parts board such as the 160 90 314 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 ...

Page 17: ...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...

Page 18: ...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 bu...

Page 19: ... 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 d...

Page 20: ...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...

Page 21: ... 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...

Page 22: ...hed 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Ω Target device Target connector 1 2 3 4 5 6 7 8 9 ...

Page 23: ...erefore 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 signa...

Page 24: ...t device VDD VDD R2 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 ...

Page 25: ... signal Target connector Jumper 1 2 3 Jumper setting When MINICUBE2 is connected 1 2 shorted When MINICUBE2 is not connected 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 prog...

Page 26: ...6002PL 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 http www necel com micro english product sc allflash minicube2 html Figure 3 8 2 54 mm Pitch 16 Pin General Purpose Connector Pin Layout Target system TOP VIEW Pin 1 13 14 11 12 15 16 9 10 7 8 5 6 3 4 1 ...

Page 27: ...ntication 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 ROM area 4 points Software break 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 ...

Page 28: ...guration for On Chip Debugging 1 3 4 5 2 Target system 6 1 3 4 5 2 Target system 6 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 Target connector sold ...

Page 29: ...B 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 ratin...

Page 30: ...ual 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 se...

Page 31: ...erved 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...

Page 32: ...4 bytes 0x0 reset vector Internal ROM space 0x60 interrupt vector for debugging 0x70 security ID area 2 KB 10 bytes 4 bytes 4 bytes 10 to 16 bytes Internal RAM space Internal ROM end address Internal RAM end address Debugging area CSI or UART receive interrupt vector 4 bytes 0x0 reset vector Internal ROM space 0x60 interrupt vector for debugging 0x70 security ID area 2 KB 10 bytes 4 bytes 4 bytes ...

Page 33: ...ps 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 progr...

Page 34: ... 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 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 Secures 2 ...

Page 35: ...n 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 7 6 5 4 3 2 1 0 CSI0IC0 x 0 x x x x x x x Any Note When the target device is the V850ES IE2 do not mask r...

Page 36: ...ration 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 d...

Page 37: ...EJ1V0UM 37 Address Value 7 0 0x70 0x12 0x71 0x34 0x72 0x56 0x73 0x78 0x74 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 ...

Page 38: ...pped 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 maskab...

Page 39: ...figuration 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 re...

Page 40: ... system can be used Power supply 3 or 5 V maximum current rating 100 mA Acquisition of device specific information Parameter file for NEC Electronics PG FP4 is used Security flag setting Available Standalone operation Unavailable must be connected to host machine 3 3 2 System configuration Figure 3 14 illustrates the system configuration for flash programming Figure 3 14 System Configuration for F...

Page 41: ...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 hig...

Page 42: ...Caution Do not change the switch setting while the USB cable is connected Figure 3 16 Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable 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 startu...

Page 43: ...gramming GUI Operation User s Manual The conditions used for a series of operations in this section are as follows Target system Target device µPD70F3732 Power supply voltage 5 V supplied from MINICUBE2 Communication channel CSI H S 2 MHz MINICUBE2 Switches Mode select switch M2 Power select switch 5 QB Programmer Parameter file 70F3732 PRM Clock setting 5 MHz x4 oscillator on the target system si...

Page 44: ... 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 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 3 18 Parameter File Select Dialog Box ...

Page 45: ...he µ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 Prog...

Page 46: ... 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 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 3 22 Completion of Programming Environment Setting ...

Page 47: ...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 Program File Select Dialog Box 3 Select the program file for the target device and then click the Open button Figure 3 24 Completion of Program File Selection ...

Page 48: ...re 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 3 25 Completion of Autoprocedure EPV Command Execution ...

Page 49: ... 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 3 3 6 Cautions on flash ...

Page 50: ...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...

Page 51: ...terface for On Chip Debugging Target system Host machine MINICUBE2 Target device USB communication Communication via X1 X2 or OCD1A OCD1B Communication circuits must be mounted on the target system 78K0 OCD board Target system Host machine MINICUBE2 Target device USB communication Communication via X1 X2 or OCD1A OCD1B Communication circuits must be mounted on the target system 78K0 OCD board Figu...

Page 52: ...2 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 program...

Page 53: ... Signal names in MINICUBE2 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 ...

Page 54: ...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 Used Programming Interface Debug Interface Operating Clock Source Used by Target Device FLMD1 pin Note1 Refer to Internal high speed oscillator X1 oscillator not used Not provided Figure 4 3 Not provided Figure 4 ...

Page 55: ...o 10 kΩ 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 suppl...

Page 56: ...s 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 debug...

Page 57: ...ce 100 Ω or less For details refer to 4 1 3 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Ω 1 2 3 4 5 6 7 8 9 10 GND RESET_OUT VDD R F U R F...

Page 58: ...evice 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...

Page 59: ...get 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 suppl...

Page 60: ...the N ch open drain buffer output resistance 100 Ω or less For details refer to 4 1 3 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Ω 1 2 3...

Page 61: ... 10 kΩ VDD VDD VDD 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 4 1 3 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 ...

Page 62: ...rom the N ch open drain buffer output resistance 100 Ω or less For details refer to 4 1 3 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 inpu...

Page 63: ...d 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 1 2 3 4 5 6 7 8 9 10 GND RESET_OUTNote 1 VDD R F U R F U R F U CLKNote 3 R F U GND _RESET TxD VDD RxD 11 1...

Page 64: ...nection 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 d...

Page 65: ...evice VDD VDD R2 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 co...

Page 66: ...OW Side B 1 to 10 kΩ A B RESET_OUT RESET_IN FLMD0Note Target device _RESET Reset connector RESET signal Selector Target connector VDD 1 to 10 kΩ HI Side A LOW Side B 1 to 10 kΩ A B RESET_OUT RESET_IN FLMD0Note Target device _RESET Reset connector RESET signal Selector Note FLMD0 is high level when MINICUBE2 is connected and FLMD0 is pulled down when MINICUBE2 is not connected Figure 4 15 Circuit C...

Page 67: ...ET Reset connector RESET signal Target connector Jumper 1 2 3 RESET_OUT RESET_IN Target device _RESET Reset connector RESET signal Target connector Jumper 1 2 3 Jumper setting When MINICUBE2 is connected 1 2 shorted When MINICUBE2 is not connected 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 4 17 Figure 4 17 Jump...

Page 68: ...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 4 18 Circuit Connection for the Case Where Target Device Is Only Reset via POC RESET_OUT RESET_IN Target device _RESET Target connector VDD 1 to 10 kΩ RESET...

Page 69: ...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 4 19 Reference Diagram of Target System GND pattern Target device X1 X2 Make the pattern where X1 and X2 are next to each ot...

Page 70: ...right angle type made by Sumitomo 3M Ltd 7616 6002PL 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 http www necel com micro english product sc allflash minicube2 html Figure 4 20 2 54 mm Pitch 10 16 Pin General Purpose Connector Pin Layout Target sy...

Page 71: ...tions of the debugger used Table 4 6 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 Break before execution 1 point unavailable when using software break Access break 1 point Software break 2 000 points Forced break Available Pseudo real time RAM monitoring Available ...

Page 72: ... 7 2 Target system or 6 5 8 1 3 4 7 2 Target system or 6 5 8 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 10 pin target cable accessory 7 16 pin target cab...

Page 73: ... 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...

Page 74: ...stem MINICUBE2 10 16 pin target cable 78K0 OCD board Target system MINICUBE2 10 16 pin target cable 78K0 OCD board 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 ...

Page 75: ...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 sec...

Page 76: ...erved 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...

Page 77: ...he 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 fr...

Page 78: ...ws the appearance after mounting the oscillator 160 90 314 made by PRECI DIP can be used as the parts board to be mounted in the socket Figure 4 27 78K0 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 4 28 Appearan...

Page 79: ...e 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 conne...

Page 80: ...ure 4 29 Reserved Area Used by MINICUBE2 256 bytes 10 bytes 2 bytes 257 bytes 1 byte 2 bytes 85H c Security ID area 190H f Pseudo RRM area 8FH a Debug monitor area 84H b Option byte area 7EH e Software break area 02H a Debug monitor area Internal ROM space Max 16 bytes Internal RAM space 00H d Stack area for debugging Area that must be reserved 290H 16 bytes F7FFH F7F0H f Pseudo RRM area 256 bytes...

Page 81: ...ormed 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 ...

Page 82: ...ram 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 pr...

Page 83: ...ies 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 Figure 4 32 Variation of Address of Stack Area for Debugging 0xFEDF 0xFB00 Stack area Stack area for debugging Available space in internal high speed RAM 7 bytes 0xFEDF 0xFB00 0xFEDF 0xFB00 0xFB07 7 bytes 7 bytes 1 2 3 0xFEDF 0xFB00...

Page 84: ...e 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 f...

Page 85: ...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 ...

Page 86: ...y 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...

Page 87: ...ction 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 W...

Page 88: ...s 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 be...

Page 89: ...10 4 440 µs 110 µs 16 bytes 110 110 16 1 870 µs 110 µs A approx 110 µs Pseudo real time RAM monitor function processing in progress during a break RRM data collection and RRM data transmission B approx 1 ms User program is running C 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 ...

Page 90: ...em can be used Power supply 3 or 5 V maximum current rating 100 mA Acquisition of device specific information Parameter file for NEC Electronics PG FP4 is used Security flag setting Available Standalone operation Unavailable must be connected to host machine 4 3 2 System configuration Figure 4 34 illustrates the system configuration for flash programming Figure 4 34 System Configuration for Flash ...

Page 91: ...on 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 ...

Page 92: ...Caution Do not change the switch setting while the USB cable is connected Figure 4 36 Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable 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 startu...

Page 93: ...tions 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 78F0547D PRM Clock setting 20...

Page 94: ... 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 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 4 38 Parameter File Select Dialog Box ...

Page 95: ...ccordance with your programming environment The following figure shows an example Figure 4 39 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 4 40 Advanced Tab of Device Setup Dialog Box ...

Page 96: ...ICROCONTROLLER User s Manual U18371EJ1V0UM 96 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 4 41 Completion of Programming Environment Setting ...

Page 97: ...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 Program File Select Dialog Box 3 Select the program file for the target device and then click the Open button Figure 4 43 Completion of Program File Selection ...

Page 98: ...re 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 4 44 Completion of Autoprocedure EPV Command Execution ...

Page 99: ... 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 4 3 6 Cautions on flash ...

Page 100: ...ethod 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 ...

Page 101: ...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 Target system Host machine MINICUBE2 Target device USB communication Serial communication INTP Communication circuits must be mounted on the target sys...

Page 102: ...ignal names in MINICUBE2 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...

Page 103: ...al DATA CLK CLK DATA _RESETNote 1 X2Note 2 X1Note 2 INTPNote 5 VDD 3 to 10 kΩ VDD 1 kΩ 10 kΩ 1 to 10 kΩ VDD 1 kΩ 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 5 1 3 Connection of reset pin 2 This is the pin connection when the...

Page 104: ...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 sig...

Page 105: ...et device VDD VDD R2 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...

Page 106: ...T signal Target connector Jumper 1 2 3 Jumper setting When MINICUBE2 is connected 1 2 shorted When MINICUBE2 is not connected 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 pro...

Page 107: ... 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 Target connector INTP 12 INTP VDD 1 kΩ Target device Target connector INTP 12 INTP VDD ...

Page 108: ...device External device 1 2 3 Jumper Target connector I O to INTP INTP 12 INTP VDD 1 kΩ Target device External device 1 2 3 Jumper 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 inclu...

Page 109: ... Figure 5 10 Circuit Connection for the Case Where X1 and X2 Pins Are Not Used in Target System Target connector X2 3 X2 VDD 3 to 10 kΩ Target device X1 X1 9 1 to 10 kΩ Target connector X2 3 X2 VDD 3 to 10 kΩ Target device X1 X1 9 1 to 10 kΩ Figure 5 11 Circuit Connection for the Case Where X1 and X2 Pins Are Used in Target System Target connector X2 3 X2 Target device X1 X1 9 Oscillator or extern...

Page 110: ...6002PL 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 http www necel com micro english product sc allflash minicube2 html Figure 5 12 2 54 mm Pitch 16 Pin General Purpose Connector Pin Layout Target system TOP VIEW Pin 1 13 14 11 12 15 16 9 10 7 8 5 6 3 4 1...

Page 111: ...ty 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 resolu...

Page 112: ...figuration for On Chip Debugging 1 3 4 5 2 Target system 6 1 3 4 5 2 Target system 6 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 Target connector sol...

Page 113: ...ot 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 u...

Page 114: ...r 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 Check...

Page 115: ...served 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 MINICUBE...

Page 116: ...s Figure 5 16 Memory Spaces Where Debug Monitor Programs Are Allocated Internal ROM space 0x0A or 0x18 INTP interrupt vector 0x7E for software break 304 bytes 2 bytes 2 bytes 5 bytes Internal RAM space Internal ROM end address Internal RAM end address Debug monitor program area Stack area for debugging Internal ROM space 0x0A or 0x18 INTP interrupt vector 0x7E for software break 304 bytes 2 bytes ...

Page 117: ...e 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 us...

Page 118: ...ed 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 5 bytes Stack area Stack area for debugging Available space in in...

Page 119: ...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 7 6 5 4 3 2 1 0 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 oth...

Page 120: ...2 2 Turn on power to the target system and MINICUBE2 in accordance with 5 2 3 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 5 2 4 System shutdown procedure 6 Connect the exter...

Page 121: ...y 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 comm...

Page 122: ...ging 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...

Page 123: ...y 3 or 5 V maximum current rating 100 mA Acquisition of device specific information Parameter file for NEC Electronics PG FP4 is used Security flag setting Available Standalone operation Unavailable must be connected to host machine 5 3 2 System configuration Figure 5 17 illustrates the system configuration for flash programming Figure 5 17 System Configuration for Flash Programming 1 3 4 5 2 Targ...

Page 124: ...ion 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...

Page 125: ... Caution Do not change the switch setting while the USB cable is connected Figure 5 19 Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable 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 start...

Page 126: ...r 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 µPD78F9234 Power supply voltage 5 V supplied from MINICUBE2 Communication channel UART 115 200 bps MINICUBE2 Switches Mode select switch M1 Power select switch 5 QB Programmer Parameter file 78F9234 PRM Clock set...

Page 127: ...d 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 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 5 21 Parameter File Select Dialog Box ...

Page 128: ...r 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 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 5 23 Advanced Tab of Device Setup Dialog Box ...

Page 129: ...ICROCONTROLLER User s Manual U18371EJ1V0UM 129 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 5 24 Completion of Programming Environment Setting ...

Page 130: ... 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 Program File Select Dialog Box 3 Select the program file for the target device and then click the Open button Figure 5 26 Completion of Program File Selection ...

Page 131: ...ure 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 5 27 Completion of Autoprocedure EPV Command Execution ...

Page 132: ...e 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 5 3 6 Cautions on flash...

Page 133: ... 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 secti...

Page 134: ...Target device USB communication Single wire UART communication 1 wire 2 wire mode Note Communication circuits must be mounted on the target system Target system Host machine MINICUBE2 Target device USB communication Single wire UART communication 1 wire 2 wire mode Note Communication circuits must be mounted on the target system Note 1 wire mode Single wire UART communication using TOOL0 pin 2 wir...

Page 135: ...unctions 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...

Page 136: ... 15 16 GND RESET_OUT RXDNote 1 VDD TXDNote 1 R F U R F U R F U R F U R F U R F U R F U R F U FLMD0 RESET_INNote 3 CLK_IN GND _RESET TOOL0 VDD X1 X2 TOOL1Note 2 FLMD0 Reset circuit RESET signal 1 kΩ 10 kΩ VDD VDD VDD Note 4 Clock circuit 3 to 10 kΩ VDD VDD 0 to 10 kΩ Notes 1 With MINICUBE2 the circuit enclosed by a dashed line is not necessary because the RXD and TXD pins are internally shorted If ...

Page 137: ...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 sig...

Page 138: ...et device VDD VDD R2 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...

Page 139: ...mper 1 2 3 RESET_OUT RESET_IN Target device _RESET Reset connector RESET signal Target connector Jumper 1 2 3 Jumper setting When MINICUBE2 is connected 1 2 shorted When MINICUBE2 is not connected 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 R...

Page 140: ... 6002PL 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 http www necel com micro english product sc allflash minicube2 html Figure 6 7 2 54 mm Pitch 16 Pin General Purpose Connector Pin Layout Target system TOP VIEW Pin 1 13 14 11 12 15 16 9 10 7 8 5 6 3 4 1...

Page 141: ...tart from Here Come Here Restart step execution Hardware break 1 point commonly used by execution and access Software break 2 000 points Forced break Available Pseudo real time RAM monitoring RRM Available in 2 wire mode DMM writing to memory during RUN Available in 2 wire mode Reset masking Available internal external reset Time measurement from execution start to break Measurement resolution 100...

Page 142: ...iguration for On Chip Debugging 1 3 4 5 2 Target system 6 1 3 4 5 2 Target system 6 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 Target connector sold...

Page 143: ...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 ...

Page 144: ...gger 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 ha...

Page 145: ...served 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 MINICUBE...

Page 146: ...r Programs Are Allocated 1024 bytes 10 bytes 2 bytes 10 bytes 1 byte C4H D7H C3H b On chip debug option byte area Internal ROM space Internal ROM end address 6 bytes Internal RAM space Internal RAM end address d Stack area for debugging CDH a Debug monitor area D8H CEH c Security ID area a Debug monitor area Area used for on chip debugging 03H 02H a Debug monitor area 1024 bytes 10 bytes 2 bytes 1...

Page 147: ...nd 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...

Page 148: ...n 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 000010B to bits 6 to 1 Remark Values set to bits 3 to 1 are changed during on chip deb...

Page 149: ...revent 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 byt...

Page 150: ...78K0R MICROCONTROLLER User s Manual U18371EJ1V0UM 150 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 ...

Page 151: ...0xFCF00 Figure 6 15 Variation of Address of Stack Area for Debugging 6 bytes Stack area Stack area for debugging Available space In internal high speed RAM 0xFCF00 0xFFEDF 6 bytes 0xFCF00 0xFFEDF 6 bytes 0xFCF00 0xFFEDF 0xFCF06 1 2 3 6 bytes Stack area Stack area for debugging Available space In internal high speed RAM 0xFCF00 0xFFEDF 6 bytes 0xFCF00 0xFFEDF 6 bytes 0xFCF00 0xFFEDF 0xFCF06 1 2 3 H...

Page 152: ...chine 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 returni...

Page 153: ...el 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 s...

Page 154: ...or 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...

Page 155: ...sed Power supply 3 or 5 V maximum current rating 100 mA Acquisition of device specific information Parameter file for NEC Electronics PG FP4 is used Security flag setting Available Standalone operation Unavailable must be connected to host machine 6 3 2 System configuration Figure 6 16 illustrates the system configuration for flash programming Figure 6 16 System Configuration for Flash Programming...

Page 156: ...ion 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...

Page 157: ... Caution Do not change the switch setting while the USB cable is connected Figure 6 18 Connecting MINICUBE2 to Host Machine MINICUBE2 USB cable 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 start...

Page 158: ...cations 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 µPD78F1166 Power supply voltage 5 V supplied from MINICUBE2 Communication channel UART 1 Mbps MINICUBE2 Switches Mode select switch M1 Power select switch 5 QB Programmer Parameter file 78F1166 PRM Clock setting None in...

Page 159: ...d 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 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 6 20 Parameter File Select Dialog Box ...

Page 160: ...r 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 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 6 22 Advanced Tab of Device Setup Dialog Box ...

Page 161: ...ICROCONTROLLER User s Manual U18371EJ1V0UM 161 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 6 23 Completion of Programming Environment Setting ...

Page 162: ... 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 Program File Select Dialog Box 3 Select the program file for the target device and then click the Open button Figure 6 25 Completion of Program File Selection ...

Page 163: ...rocedure 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 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 6 26 Completion of Autoprocedure EPV Command Execution ...

Page 164: ...e 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 6 3 6 Cautions on flash...

Page 165: ...em Configuration Figure 7 1 illustrates the system configuration for self testing Figure 7 1 System Configuration for Self Testing 1 3 4 2 1 3 4 2 1 Host machine 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 follo...

Page 166: ...necting the USB cable Connect MINICUBE2 to the host machine Do not connect MINICUBE2 to the target system The mode LED glows white after connection Figure 7 2 Connecting MINICUBE2 to Host Machine USB cable MINICUBE2 Host machine USB cable MINICUBE2 Host machine 4 Startup of MINICUBE2 diagnostic tool Start the MINICUBE2 diagnostic tool If the MINICUBE2 diagnostic tool was installed when NEC Electro...

Page 167: ...2 may no longer operate if firmware is updated incorrectly 8 1 System Configuration Figure 8 1 illustrates the system configuration for updating firmware Figure 8 1 System Configuration for Firmware Update 1 3 4 2 1 3 4 2 1 Host machine 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 Pro...

Page 168: ...ing the USB cable Connect MINICUBE2 to the host machine Do not connect MINICUBE2 to the target system The mode LED glows white after connection Figure 8 2 Connecting MINICUBE2 to Host Machine USB cable MINICUBE2 Host machine USB cable MINICUBE2 Host machine 4 Startup of MINICUBE2 diagnostic tool Start the MINICUBE2 diagnostic tool If the MINICUBE2 diagnostic tool was installed when NEC Electronics...

Page 169: ... Singapore 307684 Tel 6253 8311 http www sg necel com NEC Electronics Korea Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 02 558 3737 http www kr necel com For further information please contact G06 11A Europe NEC Electronics Europe GmbH Arcadiastrasse 10 40472 Düsseldorf Germany Tel 0211 65030 http www eu necel com Hanover Office Podbielskistrasse 166 B 30177 ...

Page 170: ...1352C 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 ...

Reviews: