PowerPoint 簡報

Download Report

Transcript PowerPoint 簡報

Introduction to Holtek
HT-ICE/HT-IDE3000
主題
HT-ICE/IDE3000 簡介
HT-IDE3000 的安裝
快速瀏覽專案的建立
HT-IDE3000 的視窗
Debug Commands
Breakpoints & Trace conditions
LCD simulator
Simulator & VPM
Holtek In-Circuit Emulator
HT-ICE Features
Real-time emulation
Support data-sensitive breakpoints
Support real-time conditional tracing
External signals for breakpoints and tracing
Allow internal/external oscillator
RS232 or USB Interface
HT-IDE3000 Features
Section-based multiple sources programming
Mixed language programming (C & ASM)
Relocated Section-based programming style
Source level debugging
Support Library management
VFD/LCD Simulator integrated
MCU simulator integrated
Work for Windows 98/ME/2000/XP…
HT-IDE3000 的安裝(一)
從 CD
點選 ‘Setup HT-IDE3000’ 按鈕
若要安裝 HT-IDE3000 主系統
․點選 ‘HT-IDE3000’ 按鈕
若要安裝最新之 Service Pack
․點選 ‘Service Pack’按鈕
CD Title
Install HT-IDE3000 & Service Pack
HT-IDE3000 的安裝(二)
從盛群公司網站
連線到 http://www.holtek.com.tw
若要安裝 HT-IDE3000 主系統
• 下載 ht-ide3000v6.exe 並執行它
若要安裝最新之 Service Pack
• 下載 ht-ide3000spx.exe 並執行它
快速瀏覽專案的建立
Step 0. 啟動 HT-IDE3000
Step 1. 開新專案
Step 2. 撰寫程式
Step 3. 將程式檔加入專案中
Step 4. 程式的編譯
Step 5. 專案的偵錯
Step 6. 專案完成
Step 0. 啟動 HT-IDE3000
在 windows 作業系統環境下,
點選開始/程式集/Holtek Development
System/HT-IDE3000
Windows 98 下的啟動
設定區域碼
當你是第一次使用HT-IDE3000 時, 系統會
出現一個Dialog要求你輸入一些基本資訊
HT-IDE3000商標畫面
每一次重新啟動 HT-IDE3000時, 系統會
顯示以下的商標畫面
你可以點一下滑鼠跳過該畫面, 或者等待
約2秒的時間, 系統會自動跳過
Welcome LOGO
連線失敗
此時若你的 HT-ICE 未接上 PC, 系統會出
現一個Dialog 提醒你
在整個使用的過程當中, 一旦系統發現連
線失敗, 也會立刻出現該訊息
連線成功
若是正常連線, 系統會出現以下 Dialog,
告訴你連線成功, 你可以開始使用 HTIDE3000/HT-ICE
盛群對於各系列的 MCU 有不同的 ICE
Step 1. 開新專案
Select Project/New
New Project Dialog
選定此 project 要儲存的目錄與名稱,並選
定你要採用那一個 MCU。
Project Option Dialog
讓你對 Assembler 與 Linker 的一些選項作設定
Configuration Options Dialog
設定一些與 MCU及ICE有關的選項
Step 2. 撰寫程式
HT-IDE3000 內建有文字編輯器(Text Editor)
Select File/New
Select File/Save As
Step 3. 將程式檔加入專案中
HT-IDE3000 的 project 可以由一個或兩
個以上的程式檔所組成
Select Project/Edit
Edit Project Dialog
Step 4. 程式的編譯(1/3)
Select Project/Build 或 Project/Rebuild All
程式的編譯(2/3)
Build 與 Rebuild All 的差別在於
• Rebuild All 會編譯project中所有的程式檔
• Build 則只會編譯自上次的編譯動作後, 有
修改過的程式檔
Select Project Assemble/Compile
• 對編輯視窗中的程式檔作編譯的動作
程式的編譯(3/3)
在編譯的過程中, 若程式有語法上的錯誤,
系統會將錯誤訊息顯示在底下的 Output
window
你可以用滑鼠雙擊錯誤訊息處, 系統會自
動標處該錯誤的程式所在位置
Step 5. 專案的偵錯(1/2)
若所有的程式都無語法上的錯誤, 則系統
會在完成編譯後, 會自動將程式下載到
HT-ICE 或 Simulator 中, 讓你開始進行
debug 的動作
Emulation (HT-ICE) 與 Simulation
(Simulator) 的切換, 在 Debug Option
Dialog.
Step 5. 專案的偵錯(2/2)
Step 6. 專案完成
對於 Mask type MCU (eg. HT48C10-1),在
Build OK 時, 系統會產生 .COD (eg.
EX1.COD)供你將檔案傳回Holtek 生產
對於 OTP type MCU (eg. HT48R10A-1),在
Build OK 時, 系統會產生 .OTP (eg.
EX1.OTP)供你使用燒錄器燒錄
Files and Building Process
Source files
(ASM/C)
Assembler/Compiler
Listing File
Object File
(LST)
(OBJ)
Linker
Librarian
Library File
Option File
(LIB)
(OPT)
Map File
Task File
(MAP)
(TSK)
Debug File
(DBG)
Option Configurer
COD/OTP Generator
COD/OTP File
HT-IDE3000的視窗
RAM
ROM
Trace List
Register
Watch
Stack
Program
Output
ROM Window
RAM Window
Trace List Window
Register Window
Register window is dockable
Watch Window
Watch window is dockable
Stack Window
Stack window is dockable
Program Window
Program window is dockable
Output Window
Output window is dockable
Debug Commands(0/2)
Debug Commands(1/2)
Go: 開始執行程式
Go to Cursor: 執行程式至目前游標所在之
指令行位置
Jump to Cursor: 將 Program counter設成目
前游標所在行的address
Stop: 停止執行程式
Stop Trace: 停止追縱程式
Reset: 執行軟體的 Reset 動作
Debug Commands(2/2)
•
•
•
•
•
Power-on Reset: 執行軟體的 Power-on Reset
動作
Reset Trace: 清除Trace buffer 中的資料
Step Into: 單步執行一行程式, 若是函式呼叫
的指令則進入該函式
Step Over: 單步執行一行程式, 若是函式呼叫
的指令則執行完該函式後停在下一行指令行
Step Out: 執行程式至最上層Stack所含之
Program Counter的位置
Stepping: 自動以單步的方式執行程式
Breakpoint(1/2)
•
•
•
•
•
•
Code breakpoints
例如, 將第21行的程式設為斷點,
Step1. 用滑鼠或鍵盤將游標移至程式的第21行位置
Step2. 開啟 Breakpoint Dialog
你會發現在 location 的欄位出現 .21, 表示將把第21
行設成斷點, 至於斷點的 space 則選擇 code
Step 3. 接著按下 Add, 你會發現下方的 Breakpoint
ListBox 出現了一筆資料
Step 4. 請記得按OK 完成此次設定
Breakpoint Dialog (Code)
Breakpoint(2/2)
Data breakpoints
• Step 1. 開啟 Breakpoint Dialog
• Step 2. 在 location 的欄位輸入 .lamp, 表示要設定
lamp 變數為斷點, 至於斷點的 space 則必須選擇
data, 並且在 content 欄位輸入 0FFh, 並勾選 write,
這就是代表當 lamp 被寫成0FFh 時為斷點
• Step 3. 接著按下 Add, 你會發現下方的
Breakpoint ListBox 出現了一筆資料
• Step 4. 請記得按OK 完成此次設定
Breakpoint Dialog (Data)
Trace Condition (1/2)
Trace Mode
• Normal
• Trace Main
• Trace INT
Trace Condition(2/2)
Trigger Mode
• No 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
Logical View of Trace List
Start
Trigger
Stop
30%
70%
Backward
Forward
Trace Condition Dialog
Holtek LCD Simulator
HT-LCDS
User-defined LCD Panel
Real time simulation
work for both Emulation(HT-ICE) and
Simulation (HT-Simulator) modes.
HT-LCDS Main Window
Menu Bar
Tool Bar
Status Bar
LCD Panel
COM\SEG Map
Panel Configuration Dialog
Set LCD Panel Color
Pattern Information Dialog
Pattern Arrangement
in LCD Panel
Click to select one pattern
Drag and Drop to move patterns
Double click to modify pattern settings
Simulation Window
To Stop Simulation
• Double click on window title bar
• Maximize the window
批次定義檔(.BTH)
•
•
•
•
•
用文字檔的方式定義 LCD panel (.LCD)
適用於安排重覆性的圖案畫面
e.g
; BMPfile.bmp, COM, SEG, X, Y
CRYSTAL.BMP, 0, 2, 120, 30
FION.BMP
, 2, 3, 200, 50
CLIN.BMP
, 3, 2, 130, 90
STEVE.BMP , 4, 4,
20, 40
User-Define Matrix (I)
HT-LCDS supports system default matrix
for COM x SEG
eg. For a 3 COM x 4 SEG matrix
C0S0
C1S0
C2S0
C0S1
C1S1
C2S1
C0S2
C1S2
C2S2
C0S3
C1S3
C2S3
User-Define Matrix (II)
Assume there is a LCD panel of 2 COMs
and 6 SEGs and if this LCD panel is a 3
ROWs x 4 COLs matrix
C0S0
C1S0
C0S4
C0S1
C1S1
C0S5
C0S2
C1S2
C1S4
C0S3
C1S3
C1S5
User-Define Matrix (Example)
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
; MATRIX.DEF
; This is a comment line
ROW = 3
COLUMN = 4
; ROW,COL => COM,SEG
0 , 0 => 0 , 0 ; Map Row0
0 , 1 => 0 , 1 ; Map Row0
0 , 2 => 0 , 2 ; Map Row0
0 , 3 => 0 , 3 ; Map Row0
1 , 0 => 1 , 0 ; Map Row1
1 , 1 => 1 , 1 ; Map Row1
1 , 2 => 1 , 2 ; Map Row1
1 , 3 => 1 , 3 ; Map Row1
2 , 0 => 0 , 4 ; Map Row2
2 , 1 => 0 , 5 ; Map Row2
2 , 2 => 1 , 4 ; Map Row2
2 , 3 => 1 , 5 ; Map Row2
Col0
Col1
Col2
Col3
Col0
Col1
Col2
Col3
Col0
Col1
Col2
Col3
to
to
to
to
to
to
to
to
to
to
to
to
COM0
COM0
COM0
COM0
COM1
COM1
COM1
COM1
COM0
COM0
COM1
COM1
SEG0
SEG1
SEG2
SEG3
SEG0
SEG1
SEG2
SEG3
SEG4
SEG5
SEG4
SEG5
VPM Main Window
VPM - Functions
VPM - Add Peripheral
VPM - Connect
VPM - Configuration
VPM - An Example