Introduction to HT-IDE3000 Micro-C development System Department.

52
Introduction to HT- IDE3000 Micro-C development System Department

Transcript of Introduction to HT-IDE3000 Micro-C development System Department.

Page 1: Introduction to HT-IDE3000 Micro-C development System Department.

Introduction to HT-IDE3000

Micro-C development System Department

Page 2: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

HT-ICE Features

Real-time emulation

Support data-sensitive breakpoint

Support real-time conditional tracing

External signals for breakpoints and tracing

Allow internal/external oscillator

Connect to PC via LPT or USB(coming soon)

Page 3: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

HT-IDE3000 Features

Section-based multiple sources programming

Support mixed C & assembly(ASM) language

Auto-relocation for code and data sections

Comprehensive on-line help

Support MCU Simulator & VPM

LCD simulator (for both HT-ICE & simulator)

Work for windows 95/98/2000/XP/ME

Page 4: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

HT-IDE3000 installation(1)

From CD

click ‘Setup HT-IDE3000’ button

To install HT-IDE3000 V6.0click ‘HT-IDE3000’ button

To install the latest Service Packclick ‘Service Pack’ button

Page 5: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

Page 6: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

Page 7: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

HT-IDE3000 installation(2)

From Holtek’s web site

Visit http://www.holtek.com.tw

To install HT-IDE3000 V6.0download ht-ide3000v6.exe & execute it

To install the latest Service Packdownload ht-ide3000spx.exe & execute it

Page 8: Introduction to HT-IDE3000 Micro-C development System Department.

Quick Start

Step 0. Starting HT-IDE3000Step 1. Creating a new project Step 2. Writing source programsStep 3. Adding source programs into the projectStep 4. Building the project Step 5. Debugging the projectStep 6. project Build OK

Page 9: Introduction to HT-IDE3000 Micro-C development System Department.

Step 0. Starting HT-IDE3000

Under windows platform, Select

Start/Program Files/Holtek Development System/HT-IDE3000

Page 10: Introduction to HT-IDE3000 Micro-C development System Department.
Page 11: Introduction to HT-IDE3000 Micro-C development System Department.

Area code

HT-IDE3000 System will ask you for some information when you start it first time.

Page 12: Introduction to HT-IDE3000 Micro-C development System Department.

HT-IDE3000 welcome Logo

The welcome logo will be shown when you start HT-IDE3000

Click the mouse left button or wait 2 seconds to pass it

Page 13: Introduction to HT-IDE3000 Micro-C development System Department.

Welcome LOGO

Page 14: Introduction to HT-IDE3000 Micro-C development System Department.

Connection failure

In the duration of running HT-IDE3000, the system will show this dialog while detecting a connection failure between the computer and the HT-ICE.

Page 15: Introduction to HT-IDE3000 Micro-C development System Department.

Connection success

While starting HT-IDE3000, the system will show this dialog after the computer connect to the HT-ICE successfully.

Page 16: Introduction to HT-IDE3000 Micro-C development System Department.

Step 1. Creating a new project

Select Project/New.

Page 17: Introduction to HT-IDE3000 Micro-C development System Department.

New Project Dialog

To choose the position to save the project.

To select the MCU item.

Page 18: Introduction to HT-IDE3000 Micro-C development System Department.

Project Option Dialog

To setup options for Assembler and Linker

Page 19: Introduction to HT-IDE3000 Micro-C development System Department.

Mask Option Dialog

To setup options for MCU.

Page 20: Introduction to HT-IDE3000 Micro-C development System Department.

Click OK,

You have finished initializing the new project.

Page 21: Introduction to HT-IDE3000 Micro-C development System Department.

Step 2. Writing source programs

HT-IDE3000 has a build-in text editor.

To create a new source fileSelect File/New

To save the source fileSelect File/Save As

Page 22: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

Single program file

All procedures and variables are defined in the same file.

No external variables and procedures are allowed.

Suits the simple program for the MCUs of small ROM size.

Cannot be reused by another project.

Page 23: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

Multiple program files

Separate different modules into different files

Use public/extern label for external procedure

Use public/extern symbol for external variable

A project consists of two or more files

Advantages:Programs will be more readable.

Program codes can be reusable.

Reduce the build time for the project.

Page 24: Introduction to HT-IDE3000 Micro-C development System Department.

Step 3. Adding source programs into the project

A project consists of one or more source program(s).

Select Project/Edit command to add the files to the project.

Page 25: Introduction to HT-IDE3000 Micro-C development System Department.

Edit Project Dialog

Page 26: Introduction to HT-IDE3000 Micro-C development System Department.

2003 Holtek MCU Product Seminar2003 Holtek MCU Product Seminar

Linking Library files

Use Options/Project command to link library with the project

Page 27: Introduction to HT-IDE3000 Micro-C development System Department.

Step 4. Building the project

Select Project/Build or Project/Rebuild All

Page 28: Introduction to HT-IDE3000 Micro-C development System Department.

Differences between Build and Rebuild AllRebuild All will compile all files in the project.Build will compile the dirty files only.A dirty file means that the file had been modified since the last build time.

Select Project Assemble/CompileAssemble/Compile the .ASM/.C program in the active window.

Page 29: Introduction to HT-IDE3000 Micro-C development System Department.

The error messages will be shown in the output window while compiling/building the file/project.Double click on the message line, the system will automatically highlight the line of the program syntax error.

Page 30: Introduction to HT-IDE3000 Micro-C development System Department.

Step 5. Debugging the project

If the project is free of syntax error, the system will download the program to the HT-ICE and show ‘Build OK’

You can use debug commands to debug the project.

Page 31: Introduction to HT-IDE3000 Micro-C development System Department.
Page 32: Introduction to HT-IDE3000 Micro-C development System Department.

Debug Commands(I)

Go: Start running the program.

Go to Cursor: Run the program and stop it if the cursor line is executed.

Jump to Cursor: Set the program counter to the position of the cursor line.

Stop: Stop the program.

Stop Trace: Stop tracing.

Reset: Execute a software Reset.

Page 33: Introduction to HT-IDE3000 Micro-C development System Department.

Debug Commands(II)

Power-on Reset: Execute a software Power-on Reset.

Reset Trace: Clear the trace buffer.

Step Into: Execute an instruction. If a function call is meet, stop at the first instruction line of the function.

Step Over: Execute an instruction. If a function call is meet, stop at the next line of the function call.

Step Out: Execute the program and stop at the position indicated by the top stack level.

Stepping: Stepping automatically.

Page 34: Introduction to HT-IDE3000 Micro-C development System Department.

Step 6. Project build OK

The system will generate a .COD file if you select Mask type MCU (eg. HT48C10-1)

The system will generate a .OTP file if you select OTP type MCU (eg. HT48R10A-1)

Page 35: Introduction to HT-IDE3000 Micro-C development System Department.

Windows of HT-IDE3000RAMROMTrace ListRegisterWatchStackProgramOutput

Page 36: Introduction to HT-IDE3000 Micro-C development System Department.

RAM window

Page 37: Introduction to HT-IDE3000 Micro-C development System Department.

ROM window

Page 38: Introduction to HT-IDE3000 Micro-C development System Department.

Trace List window

Page 39: Introduction to HT-IDE3000 Micro-C development System Department.

Register window

Register window is dockable

Page 40: Introduction to HT-IDE3000 Micro-C development System Department.

Watch window

Watch window is dockable

Page 41: Introduction to HT-IDE3000 Micro-C development System Department.

Stack window

Stack window is dockable

Page 42: Introduction to HT-IDE3000 Micro-C development System Department.

Program window

Program window is dockable

Page 43: Introduction to HT-IDE3000 Micro-C development System Department.

Output window

Output window is dockable

Page 44: Introduction to HT-IDE3000 Micro-C development System Department.

Files and Building ProcessSource files(ASM/C)

COD/OTP File

Assembler/Compiler

LibrarianListing File(LST)

Object File(OBJ)

Linker

Map File(MAP)

Task File(TSK)

Library File(LIB)

Option File(OPT)

COD/OTP Generator

Option Configurer

Debug File(DBG)

Page 45: Introduction to HT-IDE3000 Micro-C development System Department.

Breakpoint(I)

Code breakpoints Eg, To set the 21th line of program as breakpoint,

Step1. Move the cursor to the 21th line.

Step2. Select Debug\Breakpoints

The location field shows .21 and the space selection is code, indicates the 21th line is to be set as breakpoint.

Step 3. Click Add button, the new breakpoint will be added into the Breakpoint ListBox.

Step 4. Be sure to click OK button before exit.

Page 46: Introduction to HT-IDE3000 Micro-C development System Department.

Breakpoint Dialog (code)

Page 47: Introduction to HT-IDE3000 Micro-C development System Department.

Breakpoint(II)

Data breakpointsStep 1. Select Debug\Breakpoints

Step 2. Enter the variable name in the location field, select the data space, enter 0FFh in the content field and check the write radio box.

Indicate that the break condition is meet if the variable is written as 0FFh

Step 3. Click Add button, the new breakpoint will be added into the Breakpoint ListBox

Step 4. Be sure to click OK button before exit.

Page 48: Introduction to HT-IDE3000 Micro-C development System Department.

Breakpoint Dialog (data)

Page 49: Introduction to HT-IDE3000 Micro-C development System Department.

Trace Condition(I)

Trace ModeNormal

Trace Main

Trace INT

Page 50: Introduction to HT-IDE3000 Micro-C development System Department.

Trace Condition(II)

Trigger ModeNo trigger

Trigger at condition A

Trigger at condition B

Trigger at condition A or B

Trigger at condition B after A

Trigger when meets condition A k times

Trigger at condition B after meet A k times

Page 51: Introduction to HT-IDE3000 Micro-C development System Department.

Start

Forward

30% 70%

Stop

Backward

Trigger

Logical View of Trace List

Page 52: Introduction to HT-IDE3000 Micro-C development System Department.

Trace Condition Dialog