Page 1
8051 OCD ICE MEGAWIN User Manual, v3.00 MAKE YOU WIN Megawin 8051 OCD ICE User Manual This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
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 ........................
Source-level (Assembly or C-language) debugging capability Description The all new “Megawin 8051 OCD ICE” is a powerful development tool for 8051 embedded system. By adopting the Megawin proprietary OCD (On-Chip-Debug) technology, this ICE provides on-chip and in-system real-time debugging. The user has no need to prepare any development board during developing, or the socket adapter used in the traditional ICE probe.
48-pin LQFP 48-pin LQFP MG84FG516 64-pin LQFP 48-pin LQFP MG82FG5A32/5A64 64-pin LQFP 28-pin SOP MG82FG5Bxx 32-pin LQFP MG82FG5Cxx 48-pin LQFP This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Page 5
User Manual, v3.00 MAKE YOU WIN 64-pin LQFP 16-pin SOP MG82FG5Dxx 20-pin SSOP **N/A : No need to connect This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
[Database Installer] to open the Database Installer Application Program to install the Megawin Database into the Keil 8051 IDE software. Of course, you should have installed the Keil 8051 IDE software, either μVision2 or μVision3, in your PC previously. After opening the Database Installer, please follow the steps shown in the following GUI figure.
IDE. First, open the μVision project you would like to debug. Then, move cursor to “Target-..” and click the mouse’s right button to invoke the “Options for Target”, as shown below. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Select the “Megawin Device Database” and the target part number. 4.2 Options- Target Enable the “Use on-chip ROM” and the “Use on-chip XRAM”. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Disable the code optimization by selecting “Level 0: Constant folding”. Refer to Section 6.3 for more information about this setting. Note: This setting is optional. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
4.5 Options- Debug Select the “Megawin On-Chip-Debug Driver”. And, enable the “Load Application at Startup” and all the Cache Options. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
4.5. And, leave the ”Use Target Driver for Flash Programming” don’t-cared. Startup” shown in Section Note: μVision2 doesn’t have this selection item. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Now, the project code will be automatically downloaded into the target’s Flash. It will take some time. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
The user can view any of the four memory by entering the corresponding command. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
To do the source-level debugging, open the source file by clicking Files to open the Project Workspace and select the source files you want. Click Regs again to return to Register Window, as shown below. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Move the cursor to the front of the line and click the right key, then click “Enable/Disable Breakpoint” for toggling between Enable and Disable. Of course, this line should have been inserted a breakpoint previously. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Peripherals item on the main menu. A pulled-down sub-menu will be displayed, and the user can select a peripheral to view or edit its corresponding SFRs, as shown below. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
View item on the main menu. A pulled-down sub-menu will be displayed, and then select Disassembly Window, as shown below. Maximize the Disassembly Window for detailed description: This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
To check the global variables, click Watch #1 or #2, then type <F2> key to enter the variable name. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
The user can view any of the four memory by entering the corresponding command. Refer to Section 6.2 for how to display ‘xdata’ type variables. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
2. Click “Tools\Megawin ICP” from Keil’s Menu bar. Attention: To program ICP application correctly by means 2, users have to open Project and Build first. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
If users open ICP application by clicking Menu, Step 1 can be omitted. ICP application will choose MCU Part No. by Project automatically. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Page 22
If users open ICP application by clicking Menu, Step 2 can be omitted. ICP application will load Target file automatically. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Page 23
User Manual, v3.00 MAKE YOU WIN Step 3: Click “Insert ISP-Code” may choose to insert Megawin-provided ISP code or User-defined ISP code. If ISP function is not needed, Step 3 can be omitted. This document information is the intellectual property of Megawin Technology Co., Ltd.
Page 24
8051 OCD ICE MEGAWIN User Manual, v3.00 MAKE YOU WIN Step 4:H/W Option Setting This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Page 25
Step 5: Click “Update Programmer” to download programming data to the ICE adapter. “Update Programmer” function can be chosen only when connecting an ICE adapter (Only support TH065C or later versions). This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
1. click “Update Target” to program on-line update, referring to steps 1 through 4 of 6.2.1 Update Programmer, or 2. click “Downloading” of ICE adapter to program off-line update, referring to 6.2.1 Update Programmer. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
7.2 On-chip XRAM and External Data Memory Megawin 8051 devices provide on-chip XRAM (eXpanded RAM), which is accessed with the same instructions as the traditional external data memory. The size of on-chip XRAM in MPC82G516 is 1024 bytes with addresses 0x0000 to 0x03FF.
RAM an MCU has. To make this error disappear, the only way is to enable the compiler’s code optimization to let the compiler make more efficient use of the RAM. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
HWBS disabled temporarily. Note: After the application code is debugged completely, the user may use the “Megawin 8051 ICP Programmer” to restore the original hardware option. This document information is the intellectual property of Megawin Technology Co., Ltd.
(3) Cable error or improper connection between ICE adapter and the Target MCU. Once the error message pops out, click “OK”. Then, check the above possible causes to solve the problem. This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Figure 6.7.1 Directly plug into the host’s USB port Figure 6.7.2 Don’t plug into a hub and then to the host’s USB port This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Supported MG82FG5B(24/08) 2104/04/09 V2.72 Update H and INC files in H and INC folder 2014/05/15 V2.90 Supported MG82FG5C(64/32) 2015/04/15 This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Page 33
Support “ Auto Reload Code “ in IcpProgrammer V2.95 2016/09/01 Update “IcpProgrammer.exe” in Database Installer V2.96 2015/09/26 V3.00 Supported MG82FG5D(08/16) 2017/06/09 This document information is the intellectual property of Megawin Technology Co., Ltd. Megawin Technology Co., Ltd. 2014 All right reserved.
Need help?
Do you have a question about the 8051 OCD ICE and is the answer not in the manual?
Questions and answers