Contents
1 Introduction .................................................................................................... 3
Features .......................................................................................................................................... 3
Description ................................................................ ...................................................................... 3
2 Hardware Setup ............................................................................................. 4
3 Software Setup .............................................................................................. 6
3.1 Install the USB Device Driver for the ICE Adapter ................................................................... 6
3.2 Install the Megawin 8051 Database in the Keil 8051 IDE Software .......................................... 6
4 Keil IDE Setup ............................................................................................... 7
4.1 Options- Device ....................................................................................................................... 8
4.2 Options- Target ....................................................................................................................... 8
4.3 Options- Output ....................................................................................................................... 9
4.4 Options- C51 ........................................................................................................................... 9
4.5 Options- Debug ..................................................................................................................... 10
4.6 Options- Utilities .................................................................................................................... 11
5 Start Debugging ........................................................................................... 12
5.1 Activate the dScope-Debugger Function ............................................................................... 12
5.2 Introduction to the Debugger Environment ............................................................................ 13
5.2.1 Reset/Run/Halt/Step/Run-to-Cursor .............................................................................................. 14
5.2.2 Source-Level Debugging ................................................................................................................ 14
5.2.3 Breakpoint Setting .......................................................................................................................... 15
5.2.4 View/Edit the Contents of Peripherals’ SFRs ................................................................................. 16
5.2.5 View- Disassembly Window ........................................................................................................... 17
5.2.6 View- Watch Window ..................................................................................................................... 18
5.2.7 View- Memory Window .................................................................................................................. 19
6 Tools, Megawin ICP ..................................................................................... 20
6.1 About ICP ............................................................................................................................ 20
6.2 Use ICP ............................................................................................................................... 20
6.2.1 Update Programmer ....................................................................................................................... 21
6.2.2 Update Target ................................................................................................................................ 26
7 Special Notes ............................................................................................... 27
7.1 Register Definition Files ......................................................................................................... 27
7.2 On-chip XRAM and External Data Memory ........................................................................... 27
7.3 Code Optimization and Source-Level Debugging .................................................................. 28
7.4 “for-Loop” and Source-Level Debugging ................................................................................ 29
7.5 Hardware Option Requirements During Debugging ............................................................... 29
7.6 Error Message ....................................................................................................................... 30
7.7 Properly Connect the ICE Adapter to a Host ......................................................................... 31
Revision History ................................................................................................ 32