Download User`s Manual

Transcript
User’s Manual
TK-78K0R/KG3+NET
Date published: June 2008
Rev. 1.1
© TESSERA TECHNOLOGY INC. 2007-2008
Printed in Japan
TK-78K0R/KG3+NET 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 in this document is current as of February, 2007. The information is subject to change without
notice. For actual design-in, refer to the latest publications of the product data sheets.
・No part of this document may be copied or reproduced in any form or by any means without prior written consent
of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may appear in this document.
・NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document or
any other liability arising from the use of such products. No license, express, implied or otherwise, is granted under
any patents, copyrights or other intellectual property rights of NEC Electronics or others.
・Descriptions of circuits, software and other related information in this document are provided for illustrative
purposes in semiconductor product operation and application examples. The incorporation of these circuits,
software and information in the design of a customer's equipment shall be done under the full responsibility of the
customer. NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising
from the use of these circuits, software and information.
・While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC Electronics
products, customers must incorporate sufficient safety measures in their design, such as redundancy,
fire-containment and anti-failure features.
・NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific". The recommended applications of NEC Electronics products depend on its quality grade, as indicated
below. Customers must check the quality grade of each NEC Electronics product before using it.
"Standard": Computers, office equipment, communications equipment, test and measurement equipment,
audio and visual equipment, home electronic appliances, machine tools, personal electronic
equipment and industrial robots.
"Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support).
"Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers need to use NEC Electronics products in applications not
intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to determine
NEC Electronics' willingness to support a given application.
(Note)
(1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
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.
TK-78K0R/KG3+NET User’s Manual
・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.
TK-78K0R/KG3+NET User’s Manual
Contents
CHAPTER 1 PREPARATION.....................................................................................................................................................8
1.1 Development Tools / Software .....................................................................................................................9
1.2 Installation of Development Tools ............................................................................................................. 10
1.2.1 Installation Package.................................................................................................................. 10
1.2.2 Installation of Development Tools ...................................................................................... 10
1.3 Installation of USB Driver ............................................................................................................................. 16
1.3.1 Installation on Windows XP.................................................................................................... 17
1.3.2 Installation on Windows 2000................................................................................................ 20
1.3.3 Completion of USB Driver Installation .............................................................................. 23
1.4 Sample Programs.............................................................................................................................................. 24
1.4.1 Preparation of Sample Programs ........................................................................................ 24
1.4.2 Overview of Sample Programs ............................................................................................. 27
CHAPTER 2 EXPERIENCES................................................................................................................................................... 28
2.1 Start PM+ ............................................................................................................................................................ 30
2.2 What is PM+........................................................................................................................................................ 31
2.3 Load Workspace (project) ............................................................................................................................. 33
2.4 Set Linker Options........................................................................................................................................... 35
2.4.1 "Output1" Tab............................................................................................................................ 35
2.4.2 "Output2" Tab............................................................................................................................ 37
2.5 Set Compiler Options ..................................................................................................................................... 38
2.5.1 "Extend" Tab .............................................................................................................................. 38
2.5.2 "Startup Routine" Tab............................................................................................................ 39
2.5.3 "Preprocessor" Tab................................................................................................................. 40
2.6 Create Load Module Files ............................................................................................................................. 41
2.7 Check Debugger Settings ............................................................................................................................. 43
2.8 Check Board Settings .................................................................................................................................... 45
2.9 Start Debugger (ID78K0R-QB) ................................................................................................................... 46
2.10 Run Programs.................................................................................................................................................. 49
2.11 Stop Programs ................................................................................................................................................ 51
2.12 Close Debugger (ID78K0R-QB)................................................................................................................ 52
2.13 Quit PM+ ........................................................................................................................................................... 53
CHAPTER 3 HARDWARE SPECIFICATIONS .................................................................................................................. 54
3.1 TK-78K0R/KG3+NET Function Layout................................................................................................... 55
3.2 TK-78K0R/KG3+NET Function Details................................................................................................... 55
3.2.1 J1..................................................................................................................................................... 55
3.2.2 CN1 ................................................................................................................................................. 55
3.2.3 CN2 ................................................................................................................................................. 56
3.2.4 LAN Controller............................................................................................................................ 56
3.2.5 CN3 ................................................................................................................................................. 57
3.2.6 LED1 ............................................................................................................................................... 57
TK-78K0R/KG3+NET User’s Manual
3.3 EXT-232CFunction Layout .......................................................................................................................... 58
3.4 EXT-232C Function Details ......................................................................................................................... 58
3.4.1 CN1 ................................................................................................................................................. 58
3.4.2 CN2 ................................................................................................................................................. 58
3.4.3 CN3 ................................................................................................................................................. 59
3.4.4 DSUB1 ........................................................................................................................................... 60
3.4.5 Universal Area ............................................................................................................................ 60
CHAPTER 4 SAMPLE PROGRAMS .................................................................................................................................... 61
4.1 Sample Program Overview............................................................................................................................ 61
4.2 Sample Program Structure........................................................................................................................... 61
4.3 Use Sample Programs .................................................................................................................................... 62
4.3.1 Preparations ................................................................................................................................ 62
4.3.2 Equipment Connections .......................................................................................................... 63
4.3.3 Setting for Network Address ................................................................................................ 64
4.3.4 Setting for Serial Communication ....................................................................................... 64
4.3.5 Web Sample Programs............................................................................................................. 65
CHAPTER 5 TROUBLESHOOTING..................................................................................................................................... 70
5.1 If you cannot find USB driver when you connect PC to the kit ................................................... 70
5.2 Error when you start the debugger ........................................................................................................... 70
5.2.1 "Can not communicate with Emulator..." (F0100 or A0109).................................... 71
5.2.2 "Incorrect ID Code." (Ff603) ................................................................................................ 72
5.2.3 "The on-chip debug function had been disabled in the device." (F0c79) .......... 72
5.2.4 "Disabling the on-chip debug function is prohibited." (F0c33)............................... 72
CHAPTER 6 OTHER INFORMATION.................................................................................................................................. 73
6.1 Create a new workspace ............................................................................................................................... 74
6.2 Register additional source file..................................................................................................................... 79
6.3 Debugger tips ..................................................................................................................................................... 81
6.3.1 Change display of buttons ..................................................................................................... 81
6.3.2 Display source list and function list................................................................................... 81
6.3.3 Set/delete breakpoints ........................................................................................................... 82
6.3.4 Display global variables ........................................................................................................... 83
6.3.5 Display global variables while programs are running.................................................... 84
6.3.6 Display local variables.............................................................................................................. 85
6.3.7 Display memory and SFR contents.................................................................................... 85
6.3.8 Erase microcontroller built-in flash memory .................................................................. 86
6.4 Circuit diagram .................................................................................................................................................. 88
TK-78K0R/KG3+NET User’s Manual
Introduction
TK-78K0R/KG3+NET is the evaluation kit for development with Ethernet systems using "78K0R/Kx3",
NEC Electronics 16bit all flash microcontroller.
The user only needs to install the development tools and USB driver, and connect the host machine with
the target board to start the code development, build, monitoring the output, and debugging code.
(This demonstration kit uses the on-chip debug feature from the microcontroller itself, without emulator
connection)
Configuration for Debugging
TK-78K0R/KG3+NET User’s Manual
Overview
This manual consists of the following contents.
Read chapter 1 and 2 first for installing the development tools and using the sample
programs.
Read chapter 3-6 for customizing the sample programs and the hardware.
Chapter 1:
Chapter 2:
Chapter 3:
Chapter 4:
Chapter 5:
Chapter 6:
Preparations
Install the development tools
Experiences
Experience the basic operations of integrated development environment
(PM+) and integrated debugger (ID78K0R-QB) with using sample
programs.
Hardware Specifications
Explain the hardware of TK-78K0R/KG3+NET
Sample Programs
Explain functions used in sample programs
Troubleshooting
Describe how to solve troubles you may face, such as errors when
starting the integrated debugger (ID78K0R-QB)
Other Information
Introduce other information, such as how to create a new workspace
(project) on integrated development environment (PM+), how to register
additional source file, and some useful tips of the integrated debugger.
The circuit diagrams of demonstration kit are included in this chapter.
Reader
This manual is intended for development engineers who wish to become familiar with the
development tools for the 78K0R.
It is assumed that the readers have been familiar with basics of microcontrollers, C and
Assembler languages, and the WindowsTM operating system.
Purpose
This manual is intended to give users an understanding of the features, hardware configurations,
development tools for the 78K0R.
TK-78K0R/KG3+NET User’s Manual
CHAPTER 1 Preparation
This
-
chapter describes following topics:
Overview of development tools
Installation of development tools
Overview and preparation of sample programs
Users can experience the development flow such as coding, build, debugging, and test, by using the
development tools bundled with TK-78K0R/KG3+NET.
TK-78K0R/KG3+NET User’s Manual
1.1 Development Tools / Software
● Device file DF781188 V3.00
A device file contains device specific information. So, users need a device file to use the
development tools.
● Integrated Development Environment (IDE) PM+ V6.30
The IDE works on Windows operation system.
Users can develop a system efficiently by using the editor with idea processor function,
compiler, and debugger.
● C Compiler CC78K0R W1.10 (code size limited version)
C compiler for the 78K0R microcontrollers. The object code size is limited to 64 Kbyte.
This compiles C code for 78K0R and ANSI-C code program into assembler code.
This produces object code and linker.
● Assembler RA78K0R W1.10 (code size limited version)
Assembler for the 78K0R microcontrollers. The object code size is limited to 64 Kbyte.
This convert the assembler code for 78K0R into object program. The object program will be
used for debugger.
● 78K0R Integrated Debugger ID78K0R-QB V3.30
This is the tool for debugging the object program generated by C compiler and assembler. The
debugger enables to do C source level debugging. With the debugger, you can debug the code
easily and efficiently by refering and changing variables, using step-in debuging function, and
so on.
● Starter Kit USB Driver
USB driver for the USB connection with the TK-78K0R/KG3+NET and PC.
● Sample program
WEB server sample program
TK-78K0R/KG3+NET User’s Manual
1.2 Installation of Development Tools
1.2.1 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.
<1> Readme First
The contents of the CD-ROM, and some notes are available.
Please read it at first.
<2> Install…
Click “Install” to start installation of development tools.
For details, please refer to the next section.
TK-78K0R/KG3+NET User’s Manual
<3> Documents
Manuals of development tools and the evaluation kit are available in PDF files.
When this button is clicked, the WWW browser will start. Adobe® Acrobat® Reader is available in the
CD-ROM.
<4> Sample Program
Click this button to start the WWW browser for the sample program and the tutorial.
<5> Link to NEC Electronics Microcontrollers
Click this button to start the WWW browser display the link to the NEC Electronics Microcontroller
web site (http://www.necel.com/micro/index_e.html)
The NEC Electronics Microcontroller web page provides with the latest product/tool information
and FAQs.
<6> Exit
Terminate the setup.
② Click the "Install"
TK-78K0R/KG3+NET 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 TK-78K0R/KG3+NET 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.
TK-78K0R/KG3+NET 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.
for continuing the installation.
TK-78K0R/KG3+NET User’s Manual
⑧ Click
Next
when "Select Files" installation wizard dialog opened.
⑨ When the installation is completed, the following dialog opens.
Click OK .
⑩ "NEC Electronics Starter Kit Virtual UART" USB driver must be installed on PC before you
connect to TK-78K0R/KG3+NET.
Install the USB driver by referring "1.3 Installation of USB Driver".
TK-78K0R/KG3+NET User’s Manual
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 RA78K0R and C compiler CC78K0R limit the object size to 64 Kbytes.
TK-78K0R/KG3+NET User’s Manual
1.3 Installation of USB Driver
"NEC Electronics Starter Kit Virtual UART" USB driver must be installed on PC before you start using
the TK-78K0R/KG3+NET.
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 TK-78K0R/KG3+NET.
First, connect the TK-78K0R/KG3+NET to PC with USB extension cable.
Make sure that the setting of JP1 is the same as below.
Setting of JP1
Jumper Open
(Supplying power from EXT-232C board)
Depending on the version of Windows OS, the installation will be differed. Please check your
Windows version, and follow the instructions
- Windows XP
-> "1.3.1 Installation on Windows XP"
- Windows 2000 -> "1.3.2 Installation on Windows 2000"
After the installation, go to "1.3.3 Completion of USB Driver Installation"
8
TK-78K0R/KG3+NET User’s Manual
1.3.1 Installation on Windows XP
1. Once the TK-78K0R/KG3+NET 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"
TK-78K0R/KG3+NET User’s Manual
3.
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"
TK-78K0R/KG3+NET User’s Manual
6.
The installation of "NEC Electronics Starter Kit Virtual UART" driver is completed.
Click Finish .
Click "Finish"
7.
Go to "1.3.3 Completion of USB Driver Installation".
TK-78K0R/KG3+NET User’s Manual
1.3.2 Installation on Windows 2000
1. Once the TK-78K0R/KG3+NET 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"
TK-78K0R/KG3+NET User’s Manual
3.
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
TK-78K0R/KG3+NET User’s Manual
5.
Click
Next >
.
Click "Next"
6.
The installation of "NEC Electronics Starter Kit Virtual UART" driver is completed.
Click Finish .
Click "Finish"
7.
Go to "1.3.3 Completion of USB Driver Installation".
TK-78K0R/KG3+NET User’s Manual
1.3.3 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 ID78K0R-QB is not in use, you can
use this port number for connecting TK-78K0R/KG3+NET.
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.
TK-78K0R/KG3+NET User’s Manual
1.4 Sample Programs
This section explains the overview and preparation of sample programs.
For details about the sample programs, see "4. Sample Programs".
1.4.1 Preparation of Sample Programs
① Insert the CD-ROM disk in the CD-ROM drive of your PC. 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.
TK-78K0R/KG3+NET User’s Manual
③ Click the “TK-78K0R/KG3+NET Sample Programs” link , the following download confimation window
appears.
④ Click the
Save
butten.
TK-78K0R/KG3+NET User’s Manual
⑤ After specifying the download destination folder,click the
Save
button.
⑥ The self-extraction sample program set (TK78K0R.exe) is copied to the specified folder.
The folder that the “TK78K0R” folder is made when this file is executed, and the sample program is
stored under the folder in addition is made.
TK-78K0R/KG3+NET User’s Manual
1.4.2 Overview of Sample Programs
The sample programs consist of following directories.
\TK78K0R
└ \KG3+NET
・・・ User program directory
├ ¥inc
・・・ include files
│ └ \uip-1.0
・・・ uIP include files
├ \lib
・・・ Object files of evaluation kit software (unable to modify)
├ \prj
・・・ Project files
└ \src
・・・ User program source files
├ main.c
・・・ Main routine file
├ timer.c
・・・ Timer file
├ uart.c
・・・ UART file
└ \webserver
・・・ Web application program source files
├ httpd-cgi.c ・・・ CGI file that is used in Web contents
├ httpd-fsdata.c ・・・ Web content data file that is produced by makefsdata.exe
├ httpd-fs.c
・・・ File that is used for displaying Web contents
├ makefsdata.exe ・・・ Executable file for creating Web content data file
└ \fs
・・・ HTML files created by user
├ 404.html
・・・ HTML file for "File not found"
├ index.html ・・・ HTML file for top (home) page.
├ \cgi
・・・ CGI files crated by user
│ ├ iostat
・・・ CGI file for displaying I/O port
│ ├ nwstat ・・・ CGI file for displaying network address
│ ├ uart2web・・・ CGI file for displaying UART to Web
│ └ web2uart ・・・ CGI file for displaying Web to UART
└ \css
・・・ CSS files created by user
└ header.css
TK-78K0R/KG3+NET User’s Manual
CHAPTER 2 Experiences
In this chapter, you will experience how to use the development tools with using the sample programs.
The development tools are :
- Integrated Development Environment (IDE), PM+
- Integrated Debugger, ID78K0R-QB
You will use the programs that you prepared in "1.4 Sample Programs", as the sample programs for
TK-78K0R/KG3+NET.
You will be able to understand how to use the development tools and the concept of project files which
you need for producing application programs.
TK-78K0R/KG3+NET User’s Manual
The overall steps are 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+
TK-78K0R/KG3+NET 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+ starts up
TK-78K0R/KG3+NET 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.
Menu bar
Project Window
Project window
Tool bar
Output 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"
TK-78K0R/KG3+NET 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".
TK-78K0R/KG3+NET User’s Manual
2.3 Load Workspace (project)
In this section, you will use the workspace that you created in "1.4 Sample Programs"
For creating a new workspace, refer to "Chapter 6 Other Information".
The workspace has information about the build environment for the sample programs.
Select "File" on menu bar and "Open Workspace…".
Then, select "78K0R+NET.prw" under the directory "TK78K0R\KG3+NET\prj\".
Select the directory that
contains the sample
programs.
Select "78K0R+NET.prw", then click
Open
.
TK-78K0R/KG3+NET User’s Manual
Workspace name: "78K0R+NET.prw"
Load the workspace file
"78K0R+NET.prw"
Project group
Project
The workspace file "78K0R+NET.prw" contains one project called "78K0R+NET". You will use this
project "78K0R+NET".
CAUTION:
Please ignore when you get a prompt saying "files could not be found". This may occurred when
the installation directory is not a default.
TK-78K0R/KG3+NET 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 (Disable/Enable, security ID)
- Watchdog timer
Select "Tools" on menu bar, then "Linker options....".
2.4.1 "Output1" Tab
Select "Output1" tab on "Linker Options" window, and see following settings.
TK-78K0R/KG3+NET User’s Manual
- Load Module File settings
Check "Output Symbol Information".
This enables to do source level debugging (setting break points, monitoring variables in watch
window, etc).
Also, you can specify the load module file name.
- On-Chip Debug Option Byte
Check "On-Chip Debug Option Byte". Enter "85" in "Control value". This setting enables the
on-chip debugging function of the microcontroller.
* For details of "Control value", refer to the user's manual of 78K0R/KG3 (U17847E).
See "Start address" is set to "3FC00", and "Size" is set to "1024".
These settings reserve the memory address area for the monitor program (the flash memory area
that the debugger uses for on-chip debugging).
In this case, the "Control value" is allocated to the address of C3H in flash memory, and FFH is set
to the next address. Because of this, the following areas could not be set the segments.
<Address area that reserved by on-chip debugging>
- 2H, 3H
- CEH-D7H
- From the address set in "Start address" to the byte set in "Size"
- Security ID
Check "Security ID", and enter the security ID which is a unique ID code (10 bytes) to authenticate
when the debugger is launched.
The security ID is stored in the flash memory (C4H-CDH), and checked if it is the same as the code
entered in Linker options dialog when the debugger is launched.
The debugger will not be launched when the security ID is unmatched. By using this function, you
can secure the programs from leaks.
If you do not need to set the security, it is recommended to set the security ID
"FFFFFFFFFFFFFFFFFFFF" as this is the initial code.
If you forget about the security ID (stored in the address of C4H-CDH) or if you set wrong on-chip debug
option byte, you will not be able to use the debugger (ID78K0R-QB).
To solve this, you can use the "78K0R Starter Kit Setting" for changing the setting to initialize the flash
memory at the time debugger launched.
For details, refer to "6.3.8 Erase microcontroller built-in flash memory".
TK-78K0R/KG3+NET User’s Manual
2.4.2 "Output2" Tab
Select "Output2" tab on "Linker Options" window, and see following settings.
- User Option Byte
Check "User Option Byte", and then enter "00FFFF". Here, you can do the setting of watchdog
timer, low-voltage detector, and system reserved memory area. The 3 bytes you entered are stored
at C0H-C2H on flash memory:
- C0H: setting for watchdog timer
- C1H: setting for low-voltage detector
- C2H: setting for system reserved memory area (must be set as FFH)
This time, you disabled the watchdog timer and the default start function of low-voltage detector.
For details, refer to the user's manual, 78K0R/KG3 (U17847E).
TK-78K0R/KG3+NET 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
- Use multiplier and divider
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.
TK-78K0R/KG3+NET User’s Manual
2.5.2 "Startup Routine" Tab
Select "Startup Routine" tab, and check "Using Library" and "Using Multiplier". The 78K0R/KG3 has
feature of multiplier to increase those calculation speed.
TK-78K0R/KG3+NET User’s Manual
2.5.3 "Preprocessor" Tab
Select "Preprocessor" tab, and enter ”..\inc\uip-1.0,..\inc” in the “Include Search Path”.
TK-78K0R/KG3+NET 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 process is executed
Build has been completed successfully.
TK-78K0R/KG3+NET User’s Manual
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.
TK-78K0R/KG3+NET 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...".
TK-78K0R/KG3+NET User’s Manual
Check if "ID78K0R-QB V3.30 78K0R Integrated Debugger" is selected on "Debugger".
If you cannot select "ID78K0R-QB V3.30 78K0R Integrated Debugger", select "Project" on menu
bar, "Project settings" -> "Tool version settings" -> "Detailsetting" -> then select
"ID78K0R-QB".
TK-78K0R/KG3+NET User’s Manual
2.8 Check Board Settings
Before connecting the PC and the TK-78K0R/KG3+NET with USB, you should check the setting of JP1
on the TK-78K0R/KG3+NET.
Set CN1 on TK-78K0R/KG3+NET and CN1 on EXT-232C board as shown below.
J1 Setting
1-2 Open
3-4 Open
Connect LAN cable
Connect AC adapter
After the switch settings are completed, connect the PC to CN3 on TK-78K0R/KG3+NET with USB
extension cable.
Connect CN2 and PC with LAN cross cable.
Supply power by connecting bundled AC adapter to CN3 on RS-232C board.
LED1 is lighted when CPU gets power supplied.
If the "Found New Hardware Wizard" is started, install USB driver with referring "1.3 Installation of USB
Driver".
TK-78K0R/KG3+NET User’s Manual
2.9 Start Debugger (ID78K0R-QB)
Click the debug button
, 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.
The steps to start the debugger will be explained below.
ID78K0R-QB is launched
TK-78K0R/KG3+NET User’s Manual
"Configuration" dialog is opened.
Enter "FFFFFFFFFFFFFFFFFFFF" (F x 20) in "ID Code", then click
Click
Yes
OK
.
when the confirmation dialog for downloading load module file is opened.
TK-78K0R/KG3+NET User’s Manual
ID78K0R-QB 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 SW1 on
the board, it does not make anything happened. To run the demonstration, see "2.10 Run Programs".
TK-78K0R/KG3+NET 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.
TK-78K0R/KG3+NET User’s Manual
Start Web browser on PC and access "http://192.168.0.200/".
Confirm the following page is displayed.
You could confirm the sample program is working.
● When the page is not displayed, check the network address setting of PC.
Setting example of network address
IP address
192.168.0.XXX (XXX=0~255)
Subnet mask
255.255.255.0
●For more information about the functions that are used in those sample program, see "Chapter 4
Sample Programs".
TK-78K0R/KG3+NET User’s Manual
2.11 Stop Programs
Now, you are going to stop the program.
Click the 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.
TK-78K0R/KG3+NET User’s Manual
2.12 Close Debugger (ID78K0R-QB)
Select "File" on menu bar, then "Exit".
The exit confirmation dialog is displayed.
If you click
Yes
, it saves the settings in the project file, and then closes the ID78K0R-QB. 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 ID78K0R-QB.
TK-78K0R/KG3+NET User’s Manual
2.13 Quit PM+
Select "File" on menu bar, then "Exit PM+".
PM+ is closed.
The experiences section ends now.
You can find more information how to use the development tool and information about other useful
features in "Chapter 6 Other Information".
TK-78K0R/KG3+NET User’s Manual
CHAPTER 3 Hardware Specifications
In this chapter, the hardware of TK-78K0R/KG3+NET will be explained.
Microcontroller
Microcontroller supply Voltage
μPD78F1166GC *78K0R/KG3
3.3V
External main system clock: 20MHz
Subsystem clock: 32.768KHz
Clock
Internal high-speed oscillation clock: 8MHz
Internal low-speed oscillation clock: 240
kHz
Ethernet controller
ASIX AX88796B
Ethernet 10/100Base-T (RJ-45)
USB (A Type Connector for debugging)
TK-78K0R/KG3+NET
Extension connector (40pin 2mm pitch
header socket)
Connector for TK-78K0R/KG3+NET (40pin
Interface
2mm pitch header pin)
RS-232C (D-SUB 9pin plug)
EXT-232C
Extension I/O (Same as signal I/O of
TK-78K0R/KG3+NET extension connector)
AC adaptor input
5V (You can use USB bus power when you
Power supply voltage
need to use TK-78K0R/KG3+NET
stand-alone)
Dimension
W75xH38xD20mm(TK-78K0R/KG3+NET)
W138xH81xD25mm
TK-78K0R/KG3+NET User’s Manual
3.1 TK-78K0R/KG3+NET Function Layout
CN3 (For Debugging)
LED1
J1
CN1
CN2 (RJ-45)
3.2 TK-78K0R/KG3+NET Function Details
3.2.1 J1
JP1 is the jumper switch pin to select power supply.
When you need to use USB bus power, short 1-2 and 3-4 with jumper pins. When you use EXT-232C
board, do not use jumper pins.
J1
1-2 Short
Supply power to microcontroller by USB bus power.
(Do not use EXT-232C board connected.)
3-4 Short
Supply power to LAN controller by USB bus power.
(Do not use EXT-232C board connected.)
Open
Supply power to the EXT-232C board by AC adapter.
3.2.2 CN1
CN1 is the extension connector for connecting EXT-232C board.
With using Samtec TMM-120-01-G-D connector (2mm pitch header pin), you can connect other boards
as well.
TK-78K0R/KG3+NET User’s Manual
CN1
Pin No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Destination CPU Pin
P60/SCL0
P61/SDA0
RESET
P40/TOOL0
P41/TOOL1
FLMD0
P42/TI04/TO04
P43/SCK01
P44/SI01
P45/SO01
P46/INTP1/TI05/TO05
P47/INTP2
P120/INTP0/EXLVI
P140/PCLBUZ0/INTP6
P141/PCLBUZ1/INTP7
P142/SCK20/SCL20
P143/SI20/RxD2/SDA20
P144/SO20/TxD2
P145/TI07/TO07
P00/TI00
P01/TO00
P02/SO10/TxD1
P03/SI10/RxD1/SDA10
P04/SCK10/SCL10
P131/TI06/TO06
P150/ANI8
P151/ANI9
P152/ANI10
P153/ANI11
P154/ANI12
P155/ANI13
P156/ANI14
P157/ANI15
P111/ANO1
P110/ANO0
VDD
38
-
39
40
GND
GND
Remarks
CPU Reset Output
CPU Reset Input
Use for EXT-232C
Use for EXT-232C
Power Supply for CPU (3.3V)
Power Supply for LAN Controller
(3.3V)
3.2.3 CN2
CN2 is the RJ-45 connector for Ethernet 10/100Base-T.
Use cross cable when you connect to PC directly, and use straight cable when you connect to router.
3.2.4 LAN Controller
TK-78K0R/KG3+NET User’s Manual
The board mounts AX88796B, LAN controller by ASIX. You can make Ethernet communication with
IEEE802.3u 100BASE-TX from CN2 connector.
Connection between CPU and LAN controller
CPU Pin
EX16-EX21
EX0-EX15
P16
RD (P64)
WR0 & WR1
P17
INTP4 (P31)
INTP3(P30)
Signal
Direction
→
⇔
→
→
→
→
←
←
AX88796B Pin
Logic
SA0-SA5
SD0-SD15
CSn
RDn
WRn
RSTn
IRQ
PME
Active-Low
Active-Low
Active-Low
Active-Low
Programmable
Programmable
・ Reset LAN controller
Use P17 port to reset the LAN controller.
・ Access to LAN controller
Access to LAN controller with setting the external bus to 16bit separate bus mode.
・ For chip select (CSn) of LAN controller, use P16 port. Set this low level when you access to LAN
controller.
3.2.5 CN3
CN3 is a USB connector for on-chip debug
3.2.6 LED1
This is the POWER LED. It is lighted when it gets power supply.
TK-78K0R/KG3+NET User’s Manual
3.3 EXT-232CFunction Layout
DSUB1 (Dsub-9pin)
CN1
GND
Universal area
3.3V
GND
CN2 (Extension I/O)
CN3
3.4 EXT-232C Function Details
3.4.1 CN1
CN1 is a connector for TK-78K0R/KG3+NET.
3.4.2 CN2
CN2 is an extension I/O. (connector is not mounted)
When you use TK-78K0R/KG3+NET, the same signal as CN1 connector on TK-78K0R/KG3+NET is sent.
You can connect other external circuit.
TK-78K0R/KG3+NET User’s Manual
CN2
Pin No.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Signal
P60/SCL0
P61/SDA0
RESET
T_RESET
P40/TOOL0
P41/TOOL1
FLMD0
P42/TI04/TO04
P43/SCK01
P44/SI01
P45/SO01
P46/INTP1/TI05/TO05
P47/INTP2
P120/INTP0/EXLVI
P140/PCLBUZ0/INTP6
P141/PCLBUZ1/INTP7
P142/SCK20/SCL20
P143/SI20/RxD2/SDA20
P144/SO20/TxD2
P145/TI07/TO07
P00/TI00
P01/TO00
P02/SO10/TxD1
P03/SI10/RxD1/SDA10
P04/SCK10/SCL10
P131/TI06/TO06
P150/ANI8
P151/ANI9
P152/ANI10
P153/ANI11
P154/ANI12
P155/ANI13
P156/ANI14
P157/ANI15
P111/ANO1
P110/ANO0
VDD
VDD
GND
GND
Remarks
Reset Input from CPU
Reset Output to CPU
Use for EXT-232C
Use for EXT-232C
3.3V
3.3V
3.4.3 CN3
This is the connector for AC adapter. Please, connect the bundled AC adapter (+5V).
TK-78K0R/KG3+NET User’s Manual
3.4.4 DSUB1
DSUB1 is a D-sub 9Pin connector for RS-232C communication. It makes serial communication with
using UART1 on 78K0R/KG3.
RTS and CTS signal, DSR and DTR signal are connected on the board. To change the connection, you
can cut the default short pad P1 and P2 using cutter.
Microcontroller
CN1
MAX3232
P03/RxD1
ROUT
P02/TxD1
TIN
DSUB1
RIN
RxD
TOUT
TxD
RTS
P1
CTS
DSR
P2
DTR
DSUB1
Pin No.
Signal
Name
1
Destination CPU Pin
N.C.
2
RXD
P03/SI10/RxD1/SDA10
3
TXD
P02/SO10/TxD1
4
5
Connected to Pin6
GND
GND
6
Connected to Pin4
7
Connected to Pin8
8
Connected to Pin7
9
N.C.
Shell
N.C.
3.4.5 Universal Area
The kit has the universal area. Users can use this to develop custom circuit.
Also, There are GND and 3.3V power supply upper and under the universal area.
TK-78K0R/KG3+NET User’s Manual
CHAPTER 4 Sample Programs
In this chapter, the sample programs are explained.
4.1 Sample Program Overview
This is the Web server program that can run with 78K0R built-in memory.
As soon as you get TK-78K0R/KG3+NET, you can start evaluating the Web server functions.
When you develop user applications, you can refer to the sample code as the source code is available.
4.2 Sample Program Structure
Sample Software
Sample Application
uIP Protocol Stack
Web Sample Application
Network Address Display Sample
I/O Port Display Sample
Web → UART Display Sample
UART → Web Display Sample
Provided with Source Code
Provided with Library
For details about the sample programs, refer to "TK-78K0R/KG3+NET Evaluation Kit User's
Manual –Practice-"
TK-78K0R/KG3+NET User’s Manual
4.3 Use Sample Programs
Following functions are available in the sample application.
Functions
Overview
Display Network Address
It displays MAC address, IP address, net mask, and gateway of
TK-78K0R/KG3+NET.
Control I/O Port
It controls I/O port of TK-78K0R/KG3+NET.
Control Serial
It makes serial communication between TK-78K0R/KG3+NET and
terminal software.
Each application can be used with following steps.
Install Software
→ With referring Chapter 2, start the debugger and
write sample programs.
Connect Equipments
Execute Functions
・Network Address
・I/O Port
・Serial
4.3.1 Preparations
System requirements for evaluation PC.
CPU
Pentium3 800MHz, equivalent, or higher
Memory
128MB or higher (256MB recommended)
OS
Windows 2000/XP
Web Browser
Internet Explorer 6.0 or higher
Ethernet
100BASE-TX/10BASE-T (RJ-45) x1
COM Port
D-sub 9pin
TK-78K0R/KG3+NET User’s Manual
4.3.2 Equipment Connections
Connect PC and TK-78K0R/KG3+NET.
① As shown below, connect CN1 on TK-78K0R/KG3+NET board and CN1 on EXT-232C board.
② Connect CN2(RJ-45) connector on TK-78K0R/KG3+NET board and PC with LAN cross cable.
When you use a network hub, use LAN straight cable.
Connection Example
EXT-232C Board
LAN cross cable
PC
TK-78K0R
/KG3+NET
Board
Serial cross cable
③ Connect DSUB1(D-sub 9Pin connector) on EXT-232C board and PC with RS-232C serial cross
cable.
④ Set the J1 jumper pin on TK-78K0R/KG3+NET board to open. (take out the pin)
⑤ Connect bundled AC adapter to CN3 connector on EXT-232C board. The board is booted up as
soon as it gets power. (there is no power switch)
TK-78K0R/KG3+NET User’s Manual
4.3.3 Setting for Network Address
To access the Web contents of Web server sample program, you need to use browser
software on PC. The IP address of the Web server is 192.168.0.200. The network address of
the PC must be set as follows.
Example of Network Address Settings
IP Address
192.168.0.XXX (XXX=0~255)
Subnet Mask
255.255.255.0
4.3.4 Setting for Serial Communication
To establish the UART communication between TK-78K0R/KG3+NET board and PC, you
need to use terminal software on PC. Set the network as shown below.
Baud Rate
9600bps
Data Bit
8 bit
Parity
None
Stop Bit
1 bit
Flow Control
None
For COM port number, use the COM port that the RS-232C serial cross cable is connected.
※ You can start the terminal software (Hyper Terminal) by selecting "Start", "Programs",
"Accessories", "Network", then "Hyper Terminal".
TK-78K0R/KG3+NET User’s Manual
4.3.5 Web Sample Programs
4.3.5.1Web Sample Top Page
Web sample top page is displayed when you access following URL with Web browser.
http://192.168.0.200/
Network address
I/O port status
Go to Network address page
Go to I/O port page
Web to UART
Go to Web to UART page
UART to Web
Go to UART to Web page
TK-78K0R/KG3+NET User’s Manual
4.3.5.2Network Address Page
It displays MAC address, IP address, subnet mask and gateway of TK-78K0R/KG3+NET board.
By clicking the "Back" link, you can go back to Web sample top page.
TK-78K0R/KG3+NET User’s Manual
4.3.5.3I/O Port Page
It displays I/O port list. The blue background color means input mode, and white means output mode.
The status of each port are shown with "0" or "1". For the ports with output mode, you can change
the port output by selecting "0" or "1" and clicking "Update" button. The red background indicates
that the port is in use by network programs.
By clicking the "Back" link, you can go back to Web sample top page.
※ To update the information on the page, click "Update" button.
TK-78K0R/KG3+NET User’s Manual
4.3.5.4Web to UART Page
It outputs the text entered in the text box of the page to terminal software by clicking "Submit".
By clicking the "Back" link, you can go back to Web sample top page.
TK-78K0R/KG3+NET User’s Manual
4.3.5.5UART to Web Page
It displays the text entered on terminal software to the browser.
By clicking the "Back" link, you can go back to Web sample top page.
※ The browser reload the data in every five seconds.
TK-78K0R/KG3+NET User’s Manual
CHAPTER 5 Troubleshooting
This chapter describes how to solve troubles you may face.
5.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 "Starter Kit USB Driver" in "1.2 Installation of Development Tools". If not,
install the driver.
Check Point 3
Check if the settings of J1 on the kit are correct with referring to "3.2.1 J1". Check the power
supply to microcontroller.
Check Point 4
If above 3 check points are confirmed, disconnect the USB cable from PC and re-connect again.
It should show the "Found New Hardware Wizard" wizard. Operate the installation with referring
to "1.3 Installation of USB Driver". After the installation, make sure you go through "1.3.3
Completion of USB Driver Installation" to confirm the USB driver installation.
5.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.
TK-78K0R/KG3+NET User’s Manual
5.2.1 "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 J1 on the kit are correct with referring to "3.2.1 J1". Check the power
supply to microcontroller.
Check Point 3
If above 2 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.
TK-78K0R/KG3+NET User’s Manual
5.2.2 "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 "6.3.8 Erase microcontroller built-in flash
memory".
5.2.3 "The on-chip debug function had been disabled in the device." (F0c79)
This error occurs when the value at address C3H (On-chip debug option byte) in microcontroller
built-in flash memory is incorrect. You need to erase the flash memory.
Check Point 1
Check if you actually set the correct on-chip debug option byte with referring to "2.4 Set Linker
Options". If it is not correct, then set correctly.
Check Point 2
Erase the flash memory with referring to "6.3.8 Erase microcontroller built-in flash memory".
5.2.4 "Disabling the on-chip debug function is prohibited." (F0c33)
Basically, this error occurs when you start (download) the debugger without doing the settings
described at "2.4 Set Linker Options". Do the same checking processes as"5.2.3 The on-chip debug
function had been disabled in the device. (F0c79)".
TK-78K0R/KG3+NET User’s Manual
CHAPTER 6 Other Information
This chapter explains some useful operation techniques of development tools and circuit diagram of the
kit for developing of user programs.
6.1 Create a new workspace (project)
6.2 Register additional source file
6.3 Debugger tips
6.4 Circuit diagram
TK-78K0R/KG3+NET User’s Manual
6.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.
Device Name:
-> Specify the name of the device to be used.
The concrete information set here is
described on the following pages
TK-78K0R/KG3+NET User’s Manual
Input the workspace information setting
as follows.
Workspace file name
→ test
Folder
→ C:\test
Project Group Name
→ (no input)
Microcontroller Name
→ 78K0R
Device Name
→ uPD78F1166_A0
Click
Click
Yes
Next >
button
button
Click
Detail Setting
button
TK-78K0R/KG3+NET User’s Manual
Set the version of tools as
follows.
CC78K0R:W1.10
RA78K0R:W1.10
ID78K0R-QB:V3.30
Select tools as above screenshot, then click
Click
Next >
Click
Next >
OK
.
TK-78K0R/KG3+NET User’s Manual
Select ID78K0R-QB V3.30
Click
Next >
Check the project information
settings
Click
Finish
TK-78K0R/KG3+NET 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 "6.2 Register additional source file".
Also, you need to do the settings for on-chip debug. Please refer to "2.4 Set Linker Options", "2.5 Set
Compiler Options", and "2.7 Check Debugger Settings".
TK-78K0R/KG3+NET User’s Manual
6.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
Ctrl
key.
TK-78K0R/KG3+NET User’s Manual
Source file "b.c" and
"c.c" are additionally
registered to the project.
TK-78K0R/KG3+NET User’s Manual
6.3 Debugger tips
This section describes some useful techniques for the debugger (ID78K0R-QB).
6.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.
6.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.
When you click "game1"...
Source window shows "game1"
TK-78K0R/KG3+NET User’s Manual
6.3.3 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
TK-78K0R/KG3+NET User’s Manual
6.3.4 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
OK
.
③Adding a variable to watch window is completed.
TK-78K0R/KG3+NET User’s Manual
6.3.5 Display global variables while programs are running
Global variable could be referred even when the programs are running.
①Select "Option" menu -> "Extended Option...". Follow below settings.
Check
Check
Specify the sampling time (ms) of the real-time monitor function
(default: 500ms). The sampling time can be specified in 100-ms
units from 100 to 65500.
②Right-click the variable in watch window while programs are running, then select "RRM Setting...".
③RRM Setting dialog opens. Click
close the dialog.
Set
button to complete the setting, then
Close
button to
First, click "Set" to
complete the setting.
Then, click "Close" to
close the dialog.
This completes the settings.
CAUTION:
- The maximum size of variable area is as total of 16byte when programs are running.
- The maximum number of variable area is 8 locations
- The user program momentarily breaks upon a read.
TK-78K0R/KG3+NET User’s Manual
6.3.6 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.
6.3.7 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.
TK-78K0R/KG3+NET User’s Manual
6.3.8 Erase microcontroller built-in flash memory
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. For the case like this, there is the function to erase the flash
memory.
①First, check if you actually set the correct On-Chip Debug Option byte with referring to "2.4 Set
Linker Options". If it is not correct, then set correctly. Remember the security ID you set.
②Use Windows Explorer to go to the path "C:\Program Files\NEC Electronics Tools\TK-driver", then
open "exk0r32ocfg.exe". (the directory path is for the default installation directory)
The "78K0R Starter Kit Setting" starts. Select "Erase flash memory at debugger start up" at Flash
Memory, then click Setting .
③Now, start the debugger. As you erased the flash memory with above processes, you need to enter
"FFFFFFFFFFFFFFFFFFFF" (F x 20) in ID code on the configuration window of the debugger.
Enter "FFFFFFFFFFFFFFFFFFFF"
If you start the debugger with using PM+ debug button, the below error dialog may displayed because
the debugger remember the ID Code from previous use. In this case, click OK to close the dialog,
open the configuration dialog to enter "FFFFFFFFFFFFFFFFFFFF" (F x 20) in ID code, and then
re-start the debugger again.
TK-78K0R/KG3+NET User’s Manual
④When you could confirm the debugger is working, open "exk0r32ocfg.exe" again. This time, select
"KEEP flash memory at debugger start up", then click Setting .
(Because there is a limit of erasing times for flash memory, it is recommended to try not to erase flash
memory many times)
⑤After the debugger is started and programs are downloaded, the security ID on microcontroller
changes to the code that you set at "2.4 Set Linker Options". On the other hand, the debugger stores
the security ID "FFFFFFFFFFFFFFFFFFFF" (F x 20). Therefore, when you close and start the
debugger again, you may get below error.
In this case, click OK to close the dialog, then enter the code you entered at "2.4 Set Linker
Options" to "ID Code" on the configuration dialog.
For other information, refer to the user's manual "ID78K0R-QB Integrated Debugger –Operation-".
TK-78K0R/KG3+NET User’s Manual
6.4 Circuit diagram
From following page, it shows the circuit diagram of the demonstration kit.
C2
12p
1
2
4
3
Y2
Y1
C3
12p
MC-146(32.768KHz)
R3
100
XT1
XT2
CSTCE20M0V53
X1
X2
T_RESET
RESET
Pg.3
Pg.3
VDD
1
2
1
C1 0.47uF
R2
10K
R1
1K
Pg.3
Pg.3
Pg.3
VDD
C5
0.1uF
C4
0.1uF
FLMD0
P41
P40
0.1uF
C6
0.1uF
C7
VDD
P60
P61
X2
X1
XT2
XT1
P142
P141
P140
P120
P47
P46
P45
P44
P43
P42
78K0R/KG3
P142/SCK20/SCL20
P141/PCLBUZ1/INTP7
P140/PCLBUZ0/INTP6
P120/INTP0/EXLVI
P47/INTP2
P46/INTP1/TI05/TO05
P45/SO01
P44/SI01
P43/SCK01
P42/TI04/TO04
P41/TOOL1
P40/TOOL0
RESET
P124/XT2
P123/XT1
FLMD0
P122/X2/EXCLK
P121/X1
REGC
VSS
EVSS0
VDD
EVDD0
P60/SCL0
P61/SDA0
Pg.2 LANC_INT
Pg.2
RD#
Pg.2
WR0#
Pg.2
WR1#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
U1
P143
P144
P145
P00
P01
P02
P03
P04
P131
78K0R/KG3_GC
μPD78F1166GC-UEU-AX
FLASH=256KB、RAM=12KB
A5
A4
A3
A2
A1
A0
2
P150
P151
P152
P153
P154
P155
P156
100
99
98
97
96
95
94
93
92
91
90
89
88
87
86
85
84
83
82
81
80
79
78
77
76
P157/ANI15
AVSS
AVREF0
P111/ANO1
P110/ANO0
AVREF1
P10/EX24/SCK00
P11/EX25/SI00/RXD0
P12/EX26/SO00/TXD0
P13/EX27/TXD3
P14/EX28/RXD3
P15/EX29/RTCDIV/RTCCL
P16/EX30/TI01/TO01/INTP5
P17/EX31/TI02/TO02
P57/EX15
P56/EX14
P55/EX13
P54/EX12
P53/EX11
P52/EX10
P51/EX9
P50/EX8
EVDD1
P30/INTP3/RTC1HZ
P87/EX7
P143/SI20/RXD2/SDA20
P144/SO20/TXD2
P145/TI07/TO07
P00/TI00
P01/TO00
P02/SO10/TXD1
P03/SI10/RXD1/SDA10
P04/SCK10/SCL10
P131/TI06/TO06
P130
P20/ANI0
P21/ANI1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
P150/ANI8
P151/ANI9
P152/ANI10
P153/ANI11
P154/ANI12
P155/ANI13
P156/ANI14
P62
P63
P31/TI03/TO03/INTP4
P64/RD
P65/WR0
P66/WR1
P67/ASTB
P77/EX23/KR7/INTP11
P76/EX22/KR6/INTP10
P75/EX21/KR5/INTP9
P74/EX20/KR4/INTP8
P73/EX19/KR3
P72/EX18/KR2
P71/EX17/KR1
P70/EX16/KR0
P06/WAIT
P05/CLKOUT
EVSS1
P80/EX0
P81/EX1
P82/EX2
P83/EX4
P84/EX4
P85/EX5
P86/EX6
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
D0
D1
D2
D3
D4
D5
D6
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
D7
D15
D14
D13
D12
D11
D10
D9
D8
Pg.2
Pg.2
A[5..0]
D[15..0]
P111
P110
P157
VDD
VDD
Date:
Size
A3
Title
Pg.2
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
TLE-120-01-G-DV
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
CN1
Thursday , January 18, 2007
Document Number
62-0178A
TK-78K0R/KG3+NET
K0R CPU
PME
LANC_CS#
Pg.2
LANC_RESET# Pg.2
VDD
VDD
P60
RESET
P40
FLMD0
P43
P45
P47
P140
P142
P144
P00
P02
P04
P150
P152
P154
P156
P111
Sheet
P41
P42
P44
P46
P120
P141
P143
P145
P01
P03
P131
P151
P153
P155
P157
P110
P61
1
of
VDDLAN
T_RESET
3
Rev
1.0
Pg.3
TK-78K0R/KG3+NET User’s Manual
Pg.1
RD#
C16
0.1uF
C17
0.1uF
C23
22uF/16V
C28
0.1uF
VDDLAN
+
4
3
1
R16 1M
1
2
2
R6
10K
R5
10K
R4
10K
C18
0.1uF
C29
0.1uF
C30
0.1uF
C31
0.1uF
C19
0.1uF
53
54
52
WE#
L1
R17
1K
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
D15
56
13
12
57
62
61
17
23
51
55
22
50
49
48
47
46
45
A0
A1
A2
A3
A4
A5
L2
2
C32
10uF/2012
BLM18BD601SN1
1
2
AX88796B
C33
0.1uF
C34
0.1uF
C22
0.1uF
TP+
TP-
TPO+
TPO-
RSET_BG
VDDLAN_A
VDD18_A
C24
10uF/2012
EECS
EECK
EEDIO
21
20
19
15
14
16
64
3
4
6
7
C25
0.1uF
VDDLAN
VDD18_A
I_SPEED
I_LK/ACT
I_FULL/COL
VDD18
60
5
VCC18A
VCC18A
VDDLAN_A
C21
0.1uF
TCLK
TEST1
TEST2
TEST_CK_EN
XTALIN
XTALOUT
RSTn
IRQ
AEN,PSEN
IOIS16
PME
RDn
WRn
CSn
SD0
SD1
SD2
SD3
SD4
SD5
SD6
SD7
SD8
SD9
SD10
SD11
SD12
SD13
SD14
SD15
SA0
SA1
SA2
SA3
SA4
SA5,FIFO_SEL
U2
C20
10uF/2012
BLM18BD601SN1
1
VDDLAN
VDD18
C13
10pF
R7
10K
VDDLAN
A[5..0]
D[15..0]
GND
X1
X2
GND
Y3
Pg.1
Pg.1
1
C14
10pF ABM3B-25.000MHZ-10-1-U-T
VDD18
1
2
Pg.1 LANC_RESET#
Pg.1 LANC_INT
Pg.1 PME
Pg.1 LANC_CS#
1
2
1
2
1
1
1
2
1
2
1
2
1
2
2
1
2
2
2
1
1
2
1
2
1
2
1
2
1
1
C26
10uF/2012
1
R9
R20 1K
2
R19
XXX
C10
0.1uF
C27
0.1uF
VDD18
R18
10K
VDDLAN
R8 12.1K(1%)
2
RXP
RXN
TXP
TXN
1
R10
R12
WR1#
VCC
NC
ORG
VSS
C8
0.1uF/1608
2
1
VDDLAN
U4
4
WE#
R15
1M/1608
C9
0.01uF/1608
SN74LVC1G08DCK
VDDLAN
8
7
6
5
VDDLAN
VDDLAN_A
93LC46A SN
C15
0.1uF
Pg.1
CS
SK
DI
DO
WR0#
1
2
3
4
R11
U3
C11
0.1uF
49.9(1%)/1608
2
1
Pg.1
EECS
EECK
EEDO
EEDI
2
44
25
10
VCC3IO
VCC3IO
VCC3R3
2
2
1
49.9(1%)/1608
1
VCC3A3
GND
GND
GND
18
26
58
1
2
2
1
2
1
2
43
59
24
VCCK
VCCK
VCCK
2
11
63
8
1
1
2
9
V18F
GND3A3
GND3R3
GND18A
GND18A
2
1
2
1
2
1
2
1
2
1
2
1
2
49.9(1%)/1608
2
1
1
2
1
2
49.9(1%)/1608
1
2
1
2
5
3
12
10
4
5
6
8
7
3
2
1
FG1
FG2
1
GND
C12
0.1uF/1608
0.1uF
C35
GREEN
Date:
Size
A3
75Ω
8
7
6
5
4
3
2
1
11
9
Thursday , January 18, 2007
Document Number
62-0178A
TK-78K0R/KG3+NET
LAN
Title
CABLE
75Ω 75Ω
YELLOW
0.001uμ
75Ω
RX
TX
RJLBC-248TA1
SG
SG
CN2
VDDLAN
2
2
1
VDDLAN
Sheet
R14
330
R13
330
2
1
2
1
VDDLAN
2
of
3
Rev
1.0
TK-78K0R/KG3+NET User’s Manual
1
2
C38
0.1uF
FG1
FG2
GND
DD+
1
4
2
3
+
USBVDD
UAR10-4W5J00
FG1
FG2
CN3
VBUS
C45
10uF/25V
3
I
2
Pg.1
T_RESET
+
13
4
2
3
5
VDD
33ohm
33ohm
C46
10uF/25V
VDD33
1.5K
1
2
R23
2
2
1
1
U9
LM1117MPX-3.3
O
R21
R22
USBVDD
TPU5
MR1-5
CN1J8T103J
TPU4
1
5
12
1
4
R24
330
J1
2
0.47uF
5
2
3
U6
1
3
INTP1
3
U_P00
USBVDD
Pg.1
15
14
13
12
11
10
9
8
(CLK10MHz)
P41
0.1uF
C41
6
FLMD0U
7
5
RESETU
4
2
VDDLAN
VDD
POWER
CN1J8T103J
MR1-1
USBVDD
FFC-4BMEP1
2
4
VDD
SN74LVC2G07DCK
U8B
VDD33
1
C37
0.47uF
2
C36
CSTCE16M0V53
Y4
1
SN74LVC1G125DCK
4
LED1
PG1112H
CN1J8T103J
MR1-4
1
U_P01
U_P01
U_P16
U_P00
TxD6
RxD6
USBPUC
USBM
USBP
USBVDD
VDD
P16/TOH1
P15
P14/RxD6
P13/TxD6
P12/SO10
P11/SI10
P10/SCK10
A
GND
B
DIR
VCCA VCCB
VDD
U7B
B
A
GND
VCCB VCCA
DIR
MR1-7
CN1J8T103J
8
2
4
7
5
8
16
17
18
19
20
21
22
23
24
25
26
27
VDD
3
4
1
TPU3
1
VDD
3
SN74LVC2G126DCU
U10B
8
5
4
VDD
R25
1.5K
RESET
FLMD0
TI50
TPU6 TPU7
Pg.1
Pg.1
(Tool0)
P40
C40
0.1uF
USBVDD
C39
0.1uF
USBVDD
MR1-6
CN1J8T103J
USBVDD
FLMD0U
TI50
U_P16
RxD6
USBVDD
6
TPU2
1
TxD6
TPU1
1
SN74LVC2G126DCU
U10A
MR1-2
CN1J8T103J
MR1-3
CN1J8T103J
VDD
30
29
28
SN74LVC2G07DCK
6
SN74LVC2T45DCU
6
5
8
2
1
U8A
SN74LVC2T45DCU
2
4
1
U7A
uPD78F0730
P61
P60
P32/INTP3/OCD1B
P31/INTP2/OCD1A
EVdd
EVss
P33/TI51/TO51
P17/TI50/TO50
CN1J8T103J
MR1-8
5
USBVDD
USBREGC
Vdd
Vss
REGC
P121/X1/OCD0A
P122/X2/EXCLK/OCD0B
FLMD0
RESET
P120/INTP0/EXLVI
P00/TI000
P01/TI010/TO00
P30/INTP1
U5
6
11
INTP1
1
2
1
P1
1
2
1
2
VDD
Pg.1
TP2
TP1
1
1
L3
BLM41PG750S
1
2
TAB
G TAB
1
9
3
14
1
2
1
16
1
1
8
7
10
2
15
7
C47
0.1uF
VDD
C44
0.1uF
VDD
C43
0.1uF
Date:
Size
A3
Title
Thursday , January 18, 2007
Document Number
62-0178A
TK-78K0R/KG3+NET
K0 USB
C42
0.1uF
USBVDD
1
2
1
1
2
1
2
1
2
USBVDD
Sheet
3
of
3
Rev
2.0
TK-78K0R/KG3+NET User’s Manual
FFC-2AEMP
1
2
3
DCVDD
CN3
HEC0470-01-630
1
2
J1
3.3V
1
2
+
3
C3
10uF/25V
FFC-2AEMP
J2
I
1
2
TMM-120-01-G-D
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
TAB
G TAB
1
DCVDD
3.3V
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
CN1
2
U2
LM1117MPX-3.3
O
FFC-2AEMP
J3
+
3.3V
P61
T_RESET
P41
P42
P44
P46
P120
P141
P143
P145
P01
P03
P131
P151
P153
P155
3.3V
P157
P110
C4
10uF/25V
T5
1
P02
R1
100K
3.3V
P3
0.1uF
C1
P03
P60
RESET
P40
FLMD0
P43
P45
P47
P140
P142
P144
P00
P02
P04
P150
P152
P154
P156
P111
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
C6
0.1uF
MAX3232ECD
C1+
C1C2+
C2V+
V-
R1OUT
R2OUT
T1IN
T2IN
0.1uF
1
3
4
5
2
6
12
9
C7
0.1uF
C5
T7
1
U1
P61
T_RESET
P41
P42
P44
P46
P120
P141
P143
P145
P01
P03
P131
P151
P153
P155
3.3V
P157
P110
11
10
Not mount
FFC-40BEMP
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
CN2
GND
VCC
R1IN
R2IN
T1OUT
T2OUT
15
16
13
8
14
7
1
1
T4
T3
T2
T1
3.3V
0.1uF
C2
T8
T6
1
1
1
1
P2
P1
RS1_DTR
RS1_DSR
RS1_CTS
RS1_RTS
Date:
Size
A3
Title
1
6
2
7
3
8
4
9
5
Monday , February 26, 2007
Document Number
62-0178B
EXT-232C
RS1_DSR
RS1_RXD
RS1_RTS
RS1_TXD
RS1_CTS
RS1_DTR
D-SUB1
XM2C-0942-132L
10
P60
RESET
P40
FLMD0
P43
P45
P47
P140
P142
P144
P00
P02
P04
P150
P152
P154
P156
P111
Sheet
1
of
1
Rev
1.0
TK-78K0R/KG3+NET User’s Manual