Download User`s Manual StickLIN-78K0

Transcript
User’s Manual
StickLIN-78K0
Date published: March 2009
Rev. 3.1
Ⓒ TESSERA TECHNOLOGY INC. 2009
Printed in Japan
StickLIN-78K0
User’s Manual
Windows and Windows XP are registered trademarks or trademarks of Microsoft Corporation in the United States
and/or other countries.
・ The information is subject to change without notice.
・ No part of this document may be copied or reproduced in any form or by any means without prior written
consent of TESSERA TECHNOLOGY INC.. TESSERA TECHNOLOGY INC. assumes no responsibility for any errors
that may appear in this document.
・ TESSERA TECHNOLOGY INC. 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 TESSERA TECHNOLOGY
INC. 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 TESSERA TECHNOLOGY INC. or others.
・ Descriptions of circuits, software and other related information in this document are provided for
illustrative purposes in semiconductor product operation and application examples. The incorporation
of these circuits, software and information in the design of a customer's equipment shall be done
under the full responsibility of the customer. TESSERA TECHNOLOGY INC. assumes no responsibility
for any losses incurred by customers or third parties arising from the use of these circuits, software
and information.
CAUTION
・Do not give any physical damage to this equipment such as dropping
・Do not superimpose voltage to this equipment.
・Do not use this equipment with the temperature below 0℃ or over 40℃.
・Make sure the USB cables are properly connected.
・Do not bend or stretch the USB cables.
・Keep this equipment away from water.
・Take extra care to electric shock.
・This equipment should be handled like a CMOS semiconductor device. The user must take all
precautions to avoid build-up of static electricity while working with this equipment.
・All test and measurement tool including the workbench must be grounded.
・The user/operator must be grounded using the wrist strap.
・The connectors and/or device pins should not be touched with bare hands.
- 2 -
StickLIN-78K0
User’s Manual
Contents
Introduction............................................................................ 5
CHAPTER 1 Preparation ................................................................... 7
1.1 Development tools / Software ..................................................... 8
1.2 Installation of Development Tools ................................................ 9
1.2.1
Installation Package ....................................................... 9
1.2.2
Installation of Development Tools........................................... 9
1.3 Sample environment.............................................................. 13
1.4 Installation of USB Driver ...................................................... 17
1.4.1
Installation on Windows XP ................................................ 18
1.4.2
Installation on Windows 2000 .............................................. 21
1.4.3
Completion of USB Driver Installation...................................... 24
CHAPTER 2 Experiences .................................................................. 25
2.1 Start PM+ ......................................................................
2.2 What is PM+ ....................................................................
2.3 Load Workspace(project).........................................................
2.4 Set Linker Options..............................................................
2.4.1
"Output1" Tab .............................................................
2.5 Set Compiler Options............................................................
2.5.1
"Extend" Tab ..............................................................
2.6 Create Load Module Files ........................................................
2.7 Check Debugger Settings.........................................................
2.8 Check Board Settings............................................................
2.9 Start Debugger..................................................................
2.10
Run Programs ..................................................................
2.11
Stop Programs .................................................................
2.12
Close Debugger ................................................................
2.13
Quit PM+......................................................................
27
28
30
32
32
34
34
35
37
39
40
43
45
46
47
CHAPTER 3 Hardware Specifications ...................................................... 48
3.1 Introduction....................................................................
3.1.1
Features ..................................................................
3.1.2
Hardware Overview .........................................................
3.1.3
Attached goods list .......................................................
3.1.4
Block Diagram .............................................................
3.2 Interface Connection............................................................
3.2.1
J1 ........................................................................
3.3 Switches and LEDs...............................................................
3.3.1
Switch ....................................................................
3.3.2
LED1 ......................................................................
3.3.3
LED2: Power Indication ....................................................
3.3.4
LED3 ......................................................................
- 3 -
48
48
48
48
49
50
50
51
51
52
52
53
StickLIN-78K0
User’s Manual
3.4 Power Source.................................................................... 54
3.5 Design Data .................................................................... 55
3.5.1
Circuit Schematics ........................................................ 56
CHAPTER 4 Troubleshooting .............................................................. 58
4.1 If you cannot find USB driver when you connect PC to the kit ....................
4.2 Error when you start the debugger ...............................................
4.2.1
"No response from the Emulator..." (A01a0).................................
4.2.2
"Can not communicate with Emulator..." (F0100 or A0109) ....................
4.2.3
"Incorrect ID Code." (Ff603) ..............................................
58
58
58
59
59
CHAPTER 5 Other Information ............................................................ 60
5.1 Create a new workspace..........................................................
5.2 Register additional source file .................................................
5.3 Debugger tips...................................................................
5.3.1
Change display of buttons .................................................
5.3.2
Display source list and function list......................................
5.3.3
Set/delete breakpoints ....................................................
5.3.4
Display global variables ..................................................
5.3.5
Display local variables ...................................................
5.3.6
Display memory and SFR contents............................................
5.4 WriteEZ3 .......................................................................
- 4 -
61
67
69
69
69
70
71
72
72
73
StickLIN-78K0
User’s Manual
Introduction
Target Reader
This document intended for users for the 78K0 series microcomputer development tools.
A basic knowledge of microcomputers, C language, assembles, and WindowsTM operating
is assumed.
Purpose
This material has aimed the understanding of the customer of a basic operation method
of the development tool for 78K0 series appended to StickLIN-78K0 evaluation kit.
Readers will be able to further their understanding by actually using the development
tool while reading this document.
How to use this manual
This PDF file should be read with Adobe™ Acrobat™ Reader5.0 or later.
Organization
This manual consists of the following contents
Chapter 1 Preparations
→ This chapter provides an outline of the 78K0 series development used in this guide
and describes the sample program installation method.
Chapter 2 Experiences
→ Experience the basic operations of integrated development environment (PM+) and
integrated debugger (ID78K0-QB-EZ) with using sample programs.
Chapter 3 Hardware Specifications
→ Explain the hardware of StickLIN-78K0.
Chapter 4 Troubleshooting
→ Describe how to solve troubles you may face, such as errors when starting the
integrated debugger (ID78K0-QB-EZ).
Chapter 5 Other Information
→ It explains the new making method of the PM+ workspace(project), the additional
registration method of the source file, and how to use of WriteEZ3.
- 5 -
StickLIN-78K0
Caution
User’s Manual
- This contents of this document are subject to change without prior notice.
- No part of this document may be reproduced without the prior written permission of NEC
Electronics Corporation.
- NEC Electronics Corporation does not make any guarantees nor does if grant any license
regarding intellectual property rights on any other right of NEC Electronics Corporation or
third parties pertaining to the use of the products and the use of the informaiton describes in
this document. NEC Electronis Corporation shall not be held liable for problems related to the
right of third parties that arise from the above uses.
- This circuits, software, and appurtenant information describes in this document is provided
solely for the sake of semiconductor device operation examples or application examples.
Therefore, in case these circuit, software, and/or information items are to be used for a
customer’s equipment, the design of said equipmentt shall be the responsibility of the
customer. NEC Electronics Corporation declines any and all responsibility for damage arising
from the use of such circuits, software, and/or information by a customer of a third party.
Trademark
Microsoft and Windows are either registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries.
Adobe and Acrobat are trademarks of Adobe Systems Incorporated (Adobe System
Incorporated).
Other company names and product names that appear in this document are the registered
trademarks or trademarks of their respective companies.
- 6 -
StickLIN-78K0
User’s Manual
CHAPTER 1 Preparation
This chapter provides an outline of the development tools used in this document and describes how to install
the sample programs.
The sample program function only for the development tools included in the StickLIN-78K0 evaluation kit
in this document
- 7 -
StickLIN-78K0
User’s Manual
1.1
Development tools / Software
This section outlines the development tools used in this document.
The name of the development tools and their main function are as follows.
● Device file DF788020 V1.00
Since the device file contains the device-specific information, this file is required for using
the development tools.
The sample used in this document has been created as a StickLIN-78K0(uPD78F8020DA)
● Integrated development environment PM+ V6.30
This is an integrated development environment platform that operates on Windows.
An editor with an idea processor function is provided as the Edit window, allowing effcient
development linked with development tools such as a compiler and a debugger.
● C compiler CC78K0 W4.00(size restriction version)
It is “Object size restriction(32Kbyte)” compiler for 78K0 series.
It is a program that translates the source program written by C language for 78K0 series and
C language in accordance with ANSI-C into the machin language.
The source program written by C language is input, and the object program that becomes an input
of the source program and the linker that becomes an input of the assembler for 78K0 series is
output.
● Assembler RA78K0 W4.01 (size restriction version)
It is “Object size restriction(32Kbyte)” assembler for 78K0 series.
The source program written by the assembly language for 78K0 series is input, and the generic
name of a series of program that object program of the machine language. The output object program
becomes an input of the flash programmer and debugger.
● 78K0 integrated debugger ID78K0-QB-EZ V3.00
This is windows-based software that runs on a host PC.
It is integrated debugger that achieves debug at source level C.
Source debug of the reference, the change in the variable, and the step execution, etc. by such
source line can be done easily and efficiently.
● Program for writing to on-chip flash memory of microcontroller WriteEZ3
This is a Windows-based software used to write programs to the on-chip flash memory of a
microcontroller.
It is possible to write/delete it to a built-in flash memory of uPD78F8020DA by connecting
StickLIN-78K0 with the PC .
- 8 -
StickLIN-78K0
1.2
1.2.1
User’s Manual
Installation of Development Tools
Installation Package
The attached CD-ROM includes the development tools and documentations. Users can use the installer to
install those development tools and documentations.
1.2.2
Installation of Development Tools
①
Please insert the CD-ROM in the drive. The installer will show up automatically.
If it does not start automatically, please initiate it by double clicking the
SETUP.EXE.
②
Click the "Install"
- 9 -
StickLIN-78K0
③
User’s Manual
"Tool Installer" dialog box is opened.
Select products that you need to install.
(as default, all the products that you need to use the StickLIN-78K0 are selected.)
"Explain" area displays an explanation of the selected product.
To change the installation destination, click Browse… .
When all the settings are completed, click
Install…
.
* In this document, it is assumed that users install the programs under "NEC Electronics Tools" directory
(default installation directory). Users can find the tools by selecting “Start Menu” -> "Programs"
-> "NEC Electronics Tools".
④
Click OK when "Install" comfirmation dialog box is opened.
- 10 -
StickLIN-78K0
User’s Manual
⑤
Read "software license agreement" and click
To stop the installation, click No .
Yes
⑥
Enter the product ID, and click Next .
* The product ID is available on the other sheet.
⑦ It starts copying the files.
- 11 -
for continuing the installation.
StickLIN-78K0
⑧
User’s Manual
When the installation is completed, the following dialog opens.
Click OK .
Notes on the installation authority
To install this tool in Windows 2000 or XP, the authority of an administrator is necessary. Therefore,
please login as an administrator.
Notes on the install-directory
Please do not use 2-byte characters, such as umlaut in the directory name, where the product is to be
installed.
Note on the version of Windows
If the language of the Windows is not English, a file transfer error during installation might be observed.
In this case, please abort the installation in the language, and re-install it in an English version of
Windows.
The identical problem may be observed, if a language other than English is specified as the system language
in the “Regional Settings Properties” tab.
Limitation
Assembler RA78K0 and C compiler CC78K0 limit the object size to 32Kbyte.
- 12 -
StickLIN-78K0
User’s Manual
1.3
Sample environment
This section describes the preparations for the sample programs used in this document. The preparations
consist of installing the sample programs in the customer’s environment.
To uninstall the sample programs, delete the folder that was specified as the installation destination.
The installation method and the installation destination are cescribed below.
- 13 -
StickLIN-78K0
User’s Manual
● Installing the sample programs
Inset the CD-ROM disk provided as part of the StickLIN-78K0 products in the CD-ROM drive. The [NEC
Electronics Microprocessor Development Tools Setup] screen automatically appears.(if this screen
does not appear automatically, start setup.exe from Explorer. etc.)
Press the Sample Program button to start the WWW browser, and then click the[Stick LIN-78K0 Sample
Programs] link.
The WWW browser
start up.
Click the [Stick LIN-78K0 Sample
programs] link you can also download the
[User’s Manual]
When[Stick LIN-78K0 Sample Programs] is clicked, the following download confimation window appears.
Please push the Save button.
- 14 -
StickLIN-78K0
User’s Manual
After specifying the download destination folder,press the
Save
button. The self-extraction sample
program set(TK78K0.exe) is copied to the specified folder.
The folder that the “TK78K0” folder is made when this file is executed, and the sample program
is stored under the folder in addition is made.
- 15 -
StickLIN-78K0
User’s Manual
●Folder structure of sample programs
When the sample program set is decompressed, the files are to the following folder structure.。
TK78K0
SAMPLE_Stick_LIN-78K0
SAMPLE_Stick_LIN-78K0.prw
Sample workspace file
main.c
Source file
- 16 -
StickLIN-78K0
User’s Manual
1.4
Installation of USB Driver
"NEC Electronics Starter Kit Virtual UART" USB driver must be installed on PC before you start using the
StickLIN-78K0.
Please, follow the instruction below to install the driver.
"Starter Kit USB Driver" must be installed on the PC. If not, please refer to "1.2 Installation of Development
Tools" to install the driver first.
CAUTION:
Do not use a USB hub for connecting StickLIN-78K0.
First, connect the Stick-LIN-78K0 to PC with USB.
Depending on the version of Windows OS, the installation will be differed. Please check your Windows
version, and follow the instructions
- Windows XP
->
"1.4.1 Installation on Windows XP"
- Windows 2000
->
"1.4.2 Installation on Windows 2000"
After the installation, go to "1.4.3 Completion of USB Driver Installation"
8
- 17 -
StickLIN-78K0
1.4.1
User’s Manual
Installation on Windows XP
1. Once the StickLIN-78K0 is connected with USB, the "Found New Hardware Wizard" will be started.
Select "No, not this time" and click Next > .
Select "No, not this time"
Click "Next"
2.
Select "Install from a list or specific location" and click
Next >
.
Select "Install from a list or specific
location"
Click "Next"
- 18 -
StickLIN-78K0
3.
User’s Manual
Select "Search for the best driver in these locations.", check "Include this location in the search:",
and then click "Browse..." to select the driver directory path. The path should be "C:\Program Files\NEC
Electronics Tools\TK-driver" as default installation. If the installation directory is not default,
then select "TK-driver" under the installation directory.
Click Next > .
Select the driver directory
Click "Next"
4.
If the following dialog is opened, click
Continue Anyway
.
Click "Continue Anyway"
- 19 -
StickLIN-78K0
6.
User’s Manual
The installation of "NEC Electronics Starter Kit Virtual UART" driver is completed.
Click Finish .
Click "Finish"
7.
Go to "1.4.3 Completion of USB Driver Installation".
- 20 -
StickLIN-78K0
1.4.2
User’s Manual
Installation on Windows 2000
1. Once the StickLIN-78K0 is connected with USB, the "Found New Hardware Wizard" will be started.
Select "No, not this time" and click Next > .
Click "Next"
2.
Select "Search for a suitable driver for my device".
Click Next > .
Select "Search for a suitable driver for
my device"
Click "Next"
- 21 -
StickLIN-78K0
3.
User’s Manual
Select "Specify a location".
Click Next > .
Select "Specify a location"
Click "Next"
4.
Select the driver directory path. The path should be "C:\Program Files\NEC Electronics Tools\TK-driver"
as default installation.
If the installation directory is not default, then select "TK-driver" under the installation directory.
Click OK .
Click "OK"
Select the driver directory
- 22 -
StickLIN-78K0
5.
Click
User’s Manual
Next >
.
Click "Next"
6.
The installation of "NEC Electronics Starter Kit Virtual UART" driver is completed.
Click Finish .
Click "Finish"
7.
Go to "1.4.3 Completion of USB Driver Installation".
- 23 -
StickLIN-78K0
1.4.3
User’s Manual
Completion of USB Driver Installation
Confirm the USB driver is installed on PC.
Start "Device Manager", and find "NEC Electronics Starter Kit Virtual UART" (without "?" mark) under the
"Ports (COM & LPT)".
Device Manager
Find "NEC Electronics Starter
Kit Virtual UART (COMx)"
The screen above shows that the COM port number is "COM8". If ID78K0-QB-EZ is not in use, you can use this
port number for connecting StickLIN-78K0.
When you change the USB port connection, the COM port number will be changed as well.
CAUTION
・Do not do “Hardware Modification Scan” when you communicate with the target device.
- 24 -
StickLIN-78K0
User’s Manual
CHAPTER 2 Experiences
This chapter lets the reader experience the operation of the completed StickLIN-78K0 program using
the integrated debugger (ID78K0-QB-EZ)
Here, LED1 and LED3 alternately blinks program is used as StickLIN-78K0 sample program.
This chapter is designed to give an understanding of the concrete operation method of the development
tools (PM+, ID78K0-QB-EZ) and the outline of the project files required when creating application programs,
through building of sample programs and operating ID78K0-QB-EZ.
- 25 -
StickLIN-78K0
User’s Manual
The overall flow is as follows.
2.1 Start PM+
2.3 Load Workspace
2.4 Set Linker Options
2.5 Set Compiler Options
2.6 Create Load Module Files
2.7 Check Debugger Settings
2.8 Check Board Settings
Run Programs
2.9 Start Debugger
2.10 Run Programs
2.11 Stop Programs
2.12 Close Debugger
2.13 Quit PM+
- 26 -
StickLIN-78K0
User’s Manual
2.1
Start PM+
Let's start using the development tools.
First, start the PM+
Select "Windows Start Menu" -> "Program" -> "NEC Electronics Tools" -> "PM+” -> “V6.30" -> "PM+ V6.30".
PM+ starts up
- 27 -
StickLIN-78K0
User’s Manual
2.2
What is PM+
In PM+, application programs and environment setting are handled as a single project, and series of
actions such as program creation using the editor, source management, build, and debugging are managed.
Also, one of more project files is managed together as a workspace.
Tool bar
Menu bar
Output window
Project window
Project window
A window in which project names, source files, and include file are displayed using a
tree structure.
Output window
A window in which the build execution status is displayed.
For details regarding menu bars and tool bars, refer to "Help" menu in PM+.
"Help" on menu bar , then "PM+ Help"
- 28 -
StickLIN-78K0
User’s Manual
What is a project?
A project is the unit that is managed by PM+. A project refers to an application system and environment
development based on PM+.
PM+ saves project information in a "project file".
What is a project file?
A project file contains project information that includes the source files, device name, tool options
for compiling, editor, and debugger information.
The file name format is "xxxxx.prj".
Project files are created in the directory you specifies when you create a new workspace.
What is a project group?
A project group is a group comprised of a number of projects in an application system.
The target device of each project must be the same within a project group.
What is a workspace?
A workspace is the unit used to manage all the projects and project group required for one application
system.
A workspace file contains one or more project files.
The file name format is "xxxxx.prw".
- 29 -
StickLIN-78K0
User’s Manual
2.3
Load Workspace(project)
In this chapter, you will use an already created workspace.
The method for creating a new workspace is described in “Chapter 5 Other Information”
The source file name of the LED blinking program and the uPD78F8020DA setting emulated with
ID78K0-QB-EZ are saved to the workspace used in this chapter.
In the PM+ menu, select [File(F)]→[Open Workspace(W)...] and specify “SAMPLE_Stick_LIN-78K0.prw”
If you have not set an environment, refer to “Sample Environment”.
Open the folder in which the
sample program is located.
Click”SAMPLE_Stick_LIN-78K0.prw”and then press the
- 30 -
Open
button.
StickLIN-78K0
User’s Manual
The”SAMPLE_Stick_LIN-78K0.prw”
workspace
file is read.
Workspace file name :SAMPLE_Stick_LIN-78K0.prw
Project group
Project
Only one “StickLIN-78K0” project is included in the “SAMPLE_Stick_LIN-78K0.prw” workspace file.
The operations described below are done in relation to this “SAMPLE_Stick_LIN-78K0” project.
- 31 -
StickLIN-78K0
User’s Manual
2.4
Set Linker Options
The linker options have been set by the project file. However, some option settings will be covered in this
section because the linker option settings are important for debugging. Following three settings are covered
specifically.
- Outputs from debugging
- On-chip debug (Desable/Enable, security ID)
Select "Tools" on menu bar, then "Linker options....".
2.4.1
"Output1" Tab
Select "Output1" tab on "Linker Options" window. Confirm "Output Symbol Information" and "On-Chip Debug"
are checked.
Also, confirm "Security ID" and confirm "FFFFFFFFFFFFFFFFFFFF" (20 of "F") is entered at "ID" field if there
will not be a problem entering it.
- 32 -
StickLIN-78K0
User’s Manual
"Output File Name" filed at "Load Module File" specifies the path and file name of output load module file.
When "Output Symbol Information" is checked, it outputs the local symbol information in the load module
file.
"On-Chip Debug" specifies if you need to use on-chip debug or not. Check this when you wish to use on-chip
debug. In this case, you cannot locate segments in the address from 02H to 03H and from 8FH to the bytes
specified at "SIZE" + 1.
"Security ID" is the ID code to protect the memory data from others.
The ID code is set with hexadecimal number. The security ID is stored at the address 85H-8EH. For that reason,
when a security ID is set, you cannot locate segments in the address 85H-8EH.
If there is a security ID set in the assembler source code and another security ID in this option, the system
uses the one in this option.
If you forgot the security ID code in the address 0x85-0x8E or you write 0x00 at 0x84, ID78K0-QB-EZ will
not be able to connect.
In this case, run "WriteEZ3" and erase the built-in flash memory.
For details, refer to "5.4 WriteEZ3".
- 33 -
StickLIN-78K0
User’s Manual
2.5
Set Compiler Options
The compiler options have been set by project file. However, because some compiler options are useful,
following two settings are covered specifically in this section.
- Enable C++ comments
Select "Tools" on menu bar, then "Compiler options".
2.5.1
"Extend" Tab
Select "Extend" tab, and check "Enable C++ Comment".
This setting allow you to use the C++ comment using "//".
It is useful feature when developing code.
- 34 -
StickLIN-78K0
User’s Manual
2.6
Create Load Module Files
After developing the source code, you have to create load module files by compiling, assembling, and
linking. This process is called build.
Click the build button
, or select "Build" on menu bar, then "Build".
Build processing is
executed
- 35 -
StickLIN-78K0
User’s Manual
Build has been completed successfully.
What is build?
Build is a function that creates an executable file from source files in a project.
PM+ automatically performs compiling, assembling, linking, and other processing actions.
To reduce the time for the build, PM+ detects and compiles/assembles only the files that
have been updated from the previous build process.
What is rebuild?
Build compiles and assembles only the source files that have been updated from the previous
time, whereas rebuild compiles and assembles all the source files.
When setting, such as compiler options, have been changed, you must rebuild instead of build.
- 36 -
StickLIN-78K0
User’s Manual
2.7
Check Debugger Settings
After the build, you should configure the debugger settings.
The debugger settings have been set by the project file as well. However, because those settings are important for
debugging, some settings are covered in this section.
Select "Tools" on menu bar, then "Debugger Setting...".
- 37 -
StickLIN-78K0
User’s Manual
Check if "ID78K0-QB-EZ V3.00 78K0 Integrated Debugger" is selected on "Debugger".
If you cannot select "ID78K0-QB-EZ V3.00 78K0 Integrated Debugger", select "Project" on menu bar,
"Project settings" -> "Tool version settings" -> "Detailsetting" -> then select "ID78K0-QB-EZ V3.00".
- 38 -
StickLIN-78K0
User’s Manual
2.8
Check Board Settings
Before connecting the PC and the StickLIN-78K0 with USB, you should check the setting of Writer SW
and Debug SW on the StickLIN-78K0.
① Set the Writer SW and Debug SW of the StickLIN-78K0 as follows.
Switch name
setting
Writer
OFF
Debug
ON
Writer SW
Debug SW
②
After the switch settings are completed, connect the PC to USB on StickLIN-78K0.
If the "Found New Hardware Wizard" is started, install USB driver with referring "1.4 Installation
of USB Driver".
- 39 -
StickLIN-78K0
User’s Manual
2.9
Click the debug button
Start Debugger
, or select "Build" on menu bar, then "Debug".
If you do not see the debug button, go to "2.7 Check Debugger Settings" for changing the settings.
ID78K0-QB-EZ is launched
- 40 -
StickLIN-78K0
User’s Manual
"Configuration" dialog is opened.
Enter "FFFFFFFFFFFFFFFFFFFF" (F x 20) in "ID Code", then click OK .
Click
Yes
when the confirmation dialog for downloading load module file is opened.
- 41 -
StickLIN-78K0
User’s Manual
ID78K0-QB-EZ starts and downloading
the program to flash memory.
When the download is
completed, the source code
will be displayed
NOTE:
Completion of the download does not mean running the programs. Therefore, even though you press switch
on the board, it does not make anything happened. To run the sample program , see "2.10 Run Programs".
- 42 -
StickLIN-78K0
User’s Manual
2.10 Run Programs
Now, you are ready to run the program.
Click the restart button
, or select "Run" on menu bar, then "Restart".
The sample program runs.
Run the sample program
When programs are running, the status bar will be red.
- 43 -
StickLIN-78K0
User’s Manual
Next, confirm the LED1 and LED3 blinking.
LED1
LED3
The above-described procedure checks that the LED blinking program functions normally.
- 44 -
StickLIN-78K0
User’s Manual
2.11 Stop Programs
Now, you are going to stop the program.
Click the ID78K0-QB-EZ’s stop button
,or select "Run" on menu bar, then "Stop".
Stop the program
When the program stops, the status bar changes back to the original color.
- 45 -
StickLIN-78K0
User’s Manual
2.12 Close Debugger
Select "File" on menu bar, then "Exit".
The exit confirmation
displayed.
dialog
is
If you click Yes , it saves the settings in the project file, and then closes the ID78K0-QB-EZ. It is
recommended to save the settings as it saves the window you used, window size, layout, etc.
If you click No , it does not save the settings and closes the ID78K0-QB-EZ.
- 46 -
StickLIN-78K0
User’s Manual
2.13 Quit PM+
Select "File" on menu bar, then "Exit PM+".
PM+ is closed.
- 47 -
StickLIN-78K0
User’s Manual
CHAPTER 3 Hardware Specifications
3.1
Introduction
μPD78F8020DA is the NEC Electronics 8 bit single chip microcomputer. The features and hardware
specification of StickLIN-78K0 are described.
3.1.1
Features
Features of the StickLIN-78K0 are as follows.
● The evaluation board used the NEC Electronics 8bit single chip microcontroller μPD78F8020DA (The part
of 8-bit microcontroller is same as 78K0/KE2). All of the ROM, RAM, circumference circuit and LIN
transceiver are efficiently built in one chip on a StickLIN-78K0.
● High-speed operation is realized via the 20MHz internal clock.
● 128 Kbytes of Flash EEPROM, available on the chip,
● StickLIN-78K0 is programmable and debuggable from PC via USB connection without any additional hardware
tools.
●μPD78F0730 (NEC Electronics 8bit single chip microcontroller) is available on board for USB interface.
3.1.2
Hardware Overview
Microcontroller
Clock
Interfaces
Power supply
3.1.3
●
●
●
μPD78F8020DAGB
20MHz main
USB connector(TypeA)
Expansion interface(J1)
5.0V by USB, 7.0V-18.0V by Expansion interface
Attached goods list
StickLIN-78K0
Development tool/Manual CD-ROM
Expansion interface cable for LIN (separate cable with clip)
- 48 -
StickLIN-78K0
3.1.4
User’s Manual
Block Diagram
5V
uPD78F0730
5V → 8.5V
Voltage Converter
uPD78F8020D
I/O I/F
8-bit Micro
USB I/F
P01
P16
Debug SW
VSUP
(78K0/KE2)
Writer SW
OCD1B
P17
Logic
circuit
OCD1A
P15
Logic
circuit
RESET
P11
Logic
circuit
FLMD0
UART6
Logic
circuit
UART0
P70
Analog
Driver
LIN
UART6
P00
P30
- 49 -
StickLIN-78K0
User’s Manual
3.2
Interface Connection
3.2.1
J1
Expansion Interface: J1
J1: Hirose DF11-10DP-2DS
J1
1
2
3
4
5
6
7
8
9
10
Name
VSUP
LIN
DR1
DR21
DR22
DR22_I
DR4
DR21_I
GND
SWI
Connection to microcontroller
Notes
(VSUP,HDS)
LIN
Dr1
Dr21
Dr22
Dr22_I
Dr4
Dr21_I
External Power Supply
LIN Bus
Low side driver Dr1 output
Low side driver Dr21 output
Low side driver Dr22 output
Driver 22 control signal input
High side driver Dr4 output
Driver 21 control signal input
SWI
High voltage SW input
1Pin
9Pin
10Pin
2Pin
Location of J1: TOP VIEW
- 50 -
StickLIN-78K0
User’s Manual
3.3
Switches and LEDs
3.3.1
Switch
Debug SW : The mode selection for Debugging with the ID78K0-QB-EZ.
Writer SW : Programming mode selection for Flash EEPROM on the MCU with WriteEZ3.
Status
Writer SW
Setting
Debug SW
Setting
Normal Mode
OFF
OFF
Debugging Mode
OFF
ON
Flash Programming Mode
Forbid SW to set
ON
ON
OFF
ON
Writer SW
Debug SW
SW layout (TOP VIEW)
- 51 -
StickLIN-78K0
3.3.2
User’s Manual
LED1
LED1 is connected to Low side driver DR3.
LED1 status
P33 Output data
DR3 status
LED
High
Low
ON
OFF
Green
Off
LED1
LED1: TOP VIEW
3.3.3
LED2: Power Indication
LED2 is a green LED to indicate the availability of power.
LED2 status
Status
LED
Power ON
Power OFF
Green
Off
LED2
LED2: TOP VIEW
- 52 -
StickLIN-78K0
3.3.4
User’s Manual
LED3
LED3 indicate LIN Bus Pull-up.
LED3 status
P70 Output data
LIN Bus Pull-up
LED
Low
High
Pull-up enable(Master)
Pull-up disable(Slave)
Green
Off
LED3
LED3: TOP VIEW
- 53 -
StickLIN-78K0
3.4
User’s Manual
Power Source
StickLIN-78K0 are able to choice two ways of power source.
Microcontroller power(VDD) and driver module power(VSUP) are both supplied when power source are supplied
from either USB or expansion interface(VSUP).
If you supply power using the expansion interface(VSUP), then keep power source voltage DC 7.0V – DC 18.0V.
- 54 -
StickLIN-78K0
3.5
User’s Manual
Design Data
- 55 -
VDD
LED2
PG1112H
R16
390
Y1
P.2
P.2
RESET
FLMD0
P.2
P.2
OCD1A
P.2
TP
TP
TP
TP
OCD1B
T P7
T P8
T P3
T P4
VDD
P.2
R8
10K
1
1
1
1
T P6
RXD6
TXD6
0.47uF
C6
P33
P70
X2
X1
P120
0.1uF
C4
VDD
TP
1
X1
X2
U2
P.2
P.2
T P1
1
TP
T P10
P.2
FPL3
R17
10K
T P2
TXD0
RXD0
P20
ANI1
P00/TI00
P120/INTP0/EXLVI
RESET
FLMD0
P122/X2/EXCLK/OCD0B
P121/X1/OCD0A
REGC
VSS
VDD
P60/SCL0
P61/SDA0
P33/TI51/TO51/INTP4
P70/KR0
P06/TI011/TO01
P05/TI001
P32/INTP3/OCD1B
T P9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
TP
1
TP
ANI3
ANI4
P30
P17
P16
P15
CSTCE 20MHz V
TP
1
T P5
VDD
R10
10K
FLMD0
1
TP
P15
- 56 1
0.1uF
C1
VDD
P30
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
P01/TI010/TO00
P20/ANI0
P21/ANI1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
AVSS
AVREF
P10/SCK10/TxD0
P11/SI10/RxD0
P12/SO10
I.C.
I.C.
SWO
LIN
P31/INTP2/OCD1A
P30/INTP1
P17/TI50/TO50
P16/TOH1/INTP5
P15/TOH0
P14/RxD6
P13/TxD6
MSLP
UMODE
N.C.
N.C.
VRO
VIC
HDS
SUP
N.C.
+
R15
C12
22uF/16V
4.12(0.5W,3226,1%)
0.1uF
C13
VDD
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
0.1uF
C9
uPD78F8020DAGB
GND2
SWI
DR1_I
DR1
DR21_I
DR21
GND3
DR22
DR22_I
DR3
DR3_I
DR4_I
DR4
N.C.
N.C.
GND1
RD27S
D4
D2
RD27S
LIN
+
C10
47uF/35V(5*11)
VSUP
P33
P20
DR22
DR21
SWI
P120
DR1
220pF
C2
R6
47K
R18
10K
1SS400
D6
47K
R7
1SS400
D5
R14
10K
DR4
P17
DR22_I
P16
DR21_I
C14
1uF
+
USBVDD
ANI4
ANI1
0.1uF
C5
R5
1.5K
C15
1uF
+
R13
10K
R9
30K
LED1
PG1112H
VSUP
4
3
2
1
U3
IN
OUT
LV
Date:
Size
A3
Title
5
6
7
8
2
1
2
4
6
8
10
3
4
C11
1uF
Tuesday , February 03, 2009
+
D7
Sheet
1
LIN
DR21
DR22_I
DR21_I
SWI
R3
1K
D1
1SS400
VSUP
RB160M-40
DF11-10DP-2DS
1
3
5
7
9
J1
U1
G3VM-61G1
Document Number
5E1-027A
Stick LIN
MAX1681ESA
CAP-
GND
560
R2
DR1
DR22
DR4
CAP+ SHDN
FSEL
VDD
P70
RB160M-40
D3
0.001uF
C7
ANI3
VSUP
R1
100K
VDD
of
VSUP
0.1uF
C3
R11
1.5K
2
R4
100K
Rev
3.0
LED3
PG1112H
3.5.1
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
StickLIN-78K0
User’s Manual
Circuit Schematics
0.1uF
C26
UAR10-4W5100
GND
DD+
VBUS
USB1
4
2
3
1
OCD1B
RXD0
1
TXD0
1
R32
10K
VDD
R33
10K
VDD
1.5K
1
6
OCD_SW
R34
2
1
TXD6
L1
1
BLM41PG750S
C20 +
4.7uF/25V
USBVDD
3
TXD6or0
5
2
5
2
SSSS222700
6
4
3
1
SW1
SSSS222700
6
4
3
1
C24
1
R28
1
R29
OCD_SW
TxD6USB
TXD6or0
TPU4 TPU5
USBVDD
2
2
27
2
27
0.47uF
0.47uF
2
1
1
10K
FLMD0U
1
10K
CSTCE16M0V13L
Y2
2
C19
SN74LVC1G125DCK
4
U10
2
R35
2
R25
74LVC1G97DCK
USBVDD
SW2
A/B
B
Y
4
5
VDD
USBPUC
USBM
USBP
USBREGC
Vdd
Vss
REGC
4
U12
CTL_USB
TxD6USB
SN74LVC2G125DCU
U9B
3
C23
0.1uF
2
VDD
P121/X1/OCD0A
P122/X2/EXCLK/OCD0B
FLMD0
RESET
P120/INTP0
USBVDD
15
14
13
12
11
10
9
8
7
6
5
4
P00/TI000
P01/TI010/TO00
P30/INTP1
U8
SN74LVC1G86DCK
VDD
0.1uF
C25
PD1
3
2
1
100K
R24
C22
0.1uF
FPL3
10K
C28
0.1uF
VDD
SN74LVC1G126DCK
4
U11
P61
R31
USBVDD
uPD78F0730MC
P60
P32/INTP3/OCD1B
P31/INTP2/OCD1A
EVdd
EVss
P33/TI51/TO51
P17/TI50/TO50
P16/TOH1
P15
P14/RxD6
P13/TxD6
P12/SO10
P11/SI10
P10/SCK10
OCD_SW
1
RXD6
C27
0.1uF
VDD
C29
0.1uF
1
PD6
16
1
R27
1
1
1
PD5
USBVDD
2
1
4
17
18
19
20
21
22
23
24
25
26
27
28
29
30
100K
R19
CTL_USB
8
VDD
VDD
100K
R30
TPU3
TPU2
TPU1
6
5
7
3
MR1
1
2
3
4
CN1E4K-105J
8
7
6
5
(Shield)
100K
R26
FLMD0U
2
1.5K (Shield)
(Shield)
100K
R21
(Shield)
SN74LVC2G32DCU
U4B
SN74LVC2G32DCU
U4A
8
4
VDD
VDD
VDD
5
8
VDD
4
5
VCC
GND
2
A
1
U6
1
1
1
1
3
OCD1B
5
3
FG2
FG1
FG2
FG1
C17
0.1uF
7
2
2
U5B
3
1
U7
4
27
R20
5.6K
R22
2
2
USBVDD
TPU6 TPU7
SN74LVC2G125DCU
U9A
6
TPU8 TPU9
Date:
Size
A3
Title
VDD
VDD
R23
10K
Tuesday , February 03, 2009
TxD6USB
C18
0.1uF
VDD
(Shield)
Document Number
5E1-027A
StickLIN-78K0
C21
0.1uF
VDD
SN74LVC1G125DCK
VDD
CTL_USB
PD6
PD5
PD1
C16
0.1uF
VDD
SN74LVC2G125DCU
U5A
6
SN74LVC2G125DCU
7
1
USBVDD
8
4
1
USBVDD
5
3
5
1
3
2
1
5
1
8
4
8
4
1
1
3
1
- 57 -
1
2
1
Sheet
2
RESET
OCD1A
FLMD0
1
1
of
1
2
Rev
3.0
StickLIN-78K0
User’s Manual
StickLIN-78K0
User’s Manual
CHAPTER 4 Troubleshooting
This chapter describes how to solve troubles you may face.
4.1
If you cannot find USB driver when you
connect PC to the kit
Check Point 1
If you use USB hub, do not use it. (USB hub is not supported)
Check Point 2
Check if you installed "NEC Electronics Starter Kit Virtual UART Driver" in "1.4 Installation of
USB Driver". If not, install the driver.
4.2
Error when you start the debugger
There could be several reasons to make errors happen.
The solving processes differ depending on errors. Please check the error message first.
The solving processes for each error are as follows.
4.2.1
"No response from the Emulator..." (A01a0)
Check Point 1
Check if the settings of switches on the kit are correct with referring "2.8 Check Board Settings".
Check Point 2
Erase the flash memory with the WriteEZ3.
Check Point 3
If above check points are confirmed, close the debugger and disconnect the USB cable from PC.
Re-connect USB cable properly to both the PC and the kit, and then re-start the debugger.
- 58 -
StickLIN-78K0
4.2.2
User’s Manual
"Can not communicate with Emulator..." (F0100 or A0109)
Check Point 1
If you use USB hub, do not use it. (USB hub is not supported)
Check Point 2
Check if the settings of switches on the kit are correct with referring "2.8 Check Board Settings".
Check Point 3
Confirm the USB driver installation with referring to "1.4 Installation of USB Driver".
Check Point 4
If above 3 check points are confirmed, close the debugger and disconnect the USB cable from PC.
Re-connect USB cable properly to both the PC and the kit, and then re-start the debugger.
4.2.3
"Incorrect ID Code." (Ff603)
This error occurs when the security ID stored on microcontroller built-in flash memory is different
from the ID code you entered at the start of debugger.
Security ID entry area at the start of debugger
Check Point 1
Enter correct security ID and click OK on the configuration window.
Check Point 2
If you forgot the security ID, you have to erase the microcontroller built-in flash memory. Before
erasing, check if you actually set the security ID with referring to "2.4 Set Linker Options". Also
remember the code you set for the security ID.
After this, erase the flash memory with referring to "5.4 WriteEZ3".
- 59 -
StickLIN-78K0
User’s Manual
CHAPTER 5 Other Information
This chapter describes how to create a new PM+ workspace (project) required for debugging using the
integrated debugger (ID78K0-QB-EZ), registering additional source file, and how to use the WriteEZ3.
5.1 Create a new workspace (project)
5.2 Register additional source file
5.3 Debugger tips
5.4 WriteEZ3
- 60 -
StickLIN-78K0
User’s Manual
5.1
Create a new workspace
Now, create a new workspace and project.
PM+ allows you to create a new workspace with following "New WorkSpace" dialog.
Select "File" on PM+ menu bar, then "New Workspace...".
"New WorkSpace" dialog
opens
<Description of items>
Workspace File Name:
-> Specify the name of the workspace file that
manages the project files.
.prw is automatically suffixed as the file
type.
A project file (.prj) of the same name is
simultaneously created.
Folder:
-> Specify the folder for saving the workspace
file by writing its absolute path.
This item can be selected from a reference
dialog box by pressing the Browse… button.
Project Group Name:
-> Specify this item if wishing to manage
multiple projects together in function units.
If nothing is specified, this item is the same
as the workspace file name.
Microcontroller Name:
-> Specify the name of the microcontroller to be
used.
The concrete information set here is
described on the following pages
Device Name:
-> Specify the name of the device to be used.
- 61 -
StickLIN-78K0
User’s Manual
Input the workspace information setting
as follows.
Workspace file name
→ test
Folder
→ C:\78K0\test
Project Group Name
→ (no input)
Microcontroller Name
→ 78K0
Device Name
→ uPD78F8020
Click
Click
Yes
Next >
button
button
Click
- 62 -
Detail Setting
button
StickLIN-78K0
User’s Manual
Set the version of tools as
follows.
CC78K0:W4.00
RA78K0:W4.01
ID78K0-QB-EZ:V3.00
Select tools as above screenshot, then click
Click
Next >
Click
- 63 -
Next >
OK
.
StickLIN-78K0
User’s Manual
Select ID78K0-QB-EZ V3.00
Click
Next >
Check the project information
settings
Click
- 64 -
Finish
StickLIN-78K0
User’s Manual
Project “test" was registered.
This completes workspace and project creation.
Additional source files can be registered at any time thereafter.
For details, refer to “Registering additional source file”
Next, on chip debug function can be used.
[Tool] → [Linker Options...]is selected.
- 65 -
StickLIN-78K0
User’s Manual
Checks are put in "On-Chip Debug" and
"SIZE". Then input a default value of
“256” into the “SIZE”.
A check is put in "Security ID".
The actualities of
"FFFFFFFFFFFFFFFFFFFF" are taken if
there is no problem in the value of ID
in security.
Push the OK button.
Next, please add the following “word.asm” file and set the method of attesting security ID as the setting of the
option byte. Please refer to the user’s manual of the device for details of the option byte.
Refer to "a notice point in use" of ID78K0-QB for the details of the security ID.
“word.asm” please the file must be included in the sample program, and copy this file and use it.
Please refer to “Registering additional source file of next page for the method of adding the file.
ORG 80H
DB 0,0,0,0
; setting of option byte
;
ORG 84H
DB 3
; The authentication of the security ID is indispensable.
end
The example of word.asm
- 66 -
StickLIN-78K0
User’s Manual
5.2
Register additional source file
Now, register additional source files.
The following example shows the additional registration of source files “b.c” and “c.c” with source
file “a.c” already registered.
Place the cursor on the source file in the Project window of PM+, and select [Add Source Files…] displayed
in the right-click menu.
Select source files "b.c" and "c.c",
then click Open
Multiple source files can be selected by clicking them with pressing
- 67 -
Ctrl
key.
StickLIN-78K0
User’s Manual
Source file "b.c" and
"c.c" are additionally
registered to the project.
- 68 -
StickLIN-78K0
User’s Manual
5.3
Debugger tips
This section describes some useful techniques for the debugger (ID78K0-QB-EZ).
5.3.1
Change display of buttons
Execution controls (run, stop, step-in debugging, reset, etc) and opening functional window can be made
by below buttons. However, it could be difficult to know which button does what.
In this case, select "Options" on menu bar, then "Debugger Options". Check "Pictures and Text" on setting
area.
With this setting, the buttons display the text as well, so that it is easier to know what they are.
5.3.2
Display source list and function list
When you wish to see source file list or function list, select "Browse" on menu bar, then "Other" ->
"List" to open the list window. The information in the windows is synchronized. Therefore, it is not
just for referring to the list, but it is useful when you wish to update files or functions.
Source window shows "main"
When you click "main"...
- 69 -
StickLIN-78K0
5.3.3
User’s Manual
Set/delete breakpoints
Breakpoints are executed by clicking lines in which " * " is displayed
"B" is displayed in the line where a breakpoint is set.
Breakpoints are deleted by clicking "B".
Click
Breakpoint was set
- 70 -
StickLIN-78K0
5.3.4
User’s Manual
Display global variables
With using Watch Window, you can display global variables. There are several ways to register global
variables to watch window. In this section, how to register from source window is described.
①
Right-click the variable on source window, then select "Add Watch..."
②
Add Watch dialog opens. Click
③
Adding a variable to watch window is completed.
OK
.
- 71 -
StickLIN-78K0
5.3.5
User’s Manual
Display local variables
Local variable window is used to display local variables.
By clicking the button below, you can open the local variable window.
Unlike global variables, local variables cannot be displayed when programs are running.
5.3.6
Display memory and SFR contents
By clicking the button below, you can open the memory window.
By clicking the button below, you can open the SFR window.
- 72 -
StickLIN-78K0
User’s Manual
5.4
WriteEZ3
If you forgot the security ID or if you set On-Chip Debug Option Byte to disable the on-chip debug function,
you cannot start debugger. In this case, you need to delete the setting values of security ID and On-Chip
Debug Option Byte. Use WriteEZ3 to erase the flash memory.
WriteEZ3 cannot be installed from an integrated installer. Please execute
¥WriteEZ3¥WriteEZ3.exe
from the Explorer etc.
The hardware for WriteEZ3 is incorporated in StickLIN-78K0.
①
The switch of StickLIN-78K0 is set as follows, and connects StickLIN-78K0 to PC.
Switch name
setting
Writer
ON
Debug
OFF
②
Please execute “¥WriteEZ3¥WriteEZ3.exe”. if you find “Security Warning”, click “Run”
③
Push the「Setup」button.
- 73 -
StickLIN-78K0
User’s Manual
④
Push the「PRM File Read」button.
⑤
Please select “78F8020DA .prm” in the directory of “\PRM” in the CD-ROM.
- 74 -
StickLIN-78K0
⑥
User’s Manual
"Port" selects the COM port number where StickLIN-78K0 is allocated.
※ Only the COM port number that the personal computer has is displayed in this pulldown menu.
Input “20.00” to “Frequency”
Input “1.00” to “Multiply rate”, and chick “OK”
⑦
"Erase" The deletion of the flash memory begins when the button is pushed.
⑧
StickLIN-78K0 is detached from the PC.
- 75 -