A Brief Note on W78C438B-based 8051 In-Circuit-Debugger with NoICE for 8051
by Chin-Shiuh Shieh on
Introduction
- This note refers to W78C438B-based 8051 In-Circuit-Debugger V1.1 and NoICE v5.0 for Windows.
- The firmware "MON8051-W78C438B.HEX" is revised by Chin-Shiuh Shieh according to:
- Monitor Code Space: 0000h-3FFFh
- User Code/Data Space: 4000h-BF7Fh
- Monitor Data Space: BF80h-BFFFh
- RD, WR are used to access external ROM/RAM.
- Stack pointer SP is initialized to 70h.
- Hand-coded UART on P8.0 and P8.7.
- Baud Rate: 9600bps
Limitations and Precautions
- NoICE for 8051 v5.0 has an inherent limitation that breakpoints must be at least 3 bytes apart from each other. So does single-step branching.
- RD, WR are used to access external ROM/RAM, therefore can not be used for general I/O.
- The EA/VPP,XTAL1, and XTAL2 of the target circuit must be left opened if a 40-pin cable is used in debugging.
Installation and Configuration
- Download and execute NoICE v5.0 for Windows to unzip it to the directory you preferred. You may create a short-cut for the main program "C:\Program Files\NoICE\bin\NoICE51.exe" for easy access.
- Each time you turn on the power of ICD or reset it, the red LED should flash for once. It keeps flashing while having communication with NoICE51.
- For the first time of execution, the port number and the baud rate for the NoICE serial protocol must be correctly set. The port number should be set according to your PC configuration. The baud rate must be set to 9600 bps. These setting can be changed by selecting "Options|Target Communications..." from NoICE51.
- noice51-01.gif noice51-02.gif noice51-03.gif noice51-04.gif
User Program Loading and Viewing
- "File|Load...": Load user program in HEX-format from PC to ICD.
- "File|Play...": Load symbol table in NOI-format from PC to ICD. Symbol table will ease your program debugging. "ASEMSYM.EXE" is a small utility by Chin-Shiuh Shieh which accepts list file from ASEM-51 and produce symbol definition file for NoICE51.
- "View|Disassemble at...": Disassemble machine code at specified address. Notice that NoICE51 does not refresh your newly loaded programs automatically.
- "Memory|Assemble...": Invoke a simple online assembler.
User Program Debugging
- "Run|Go (F5)": Run user program at full speed and stop at breakpoints if there is any. If there is no breakpoint encountered, NoICE51 can only regain the control by pressing the reset button on ICD.
- "Breakpoint|List/Delete (F6)": Breakpoint management.
- "Run|Step Into (F7)": Single-step execution. Step into subroutines.
- "Run|Step Over (F8)": Single-step execution. Step over subroutines. Treat a subroutine as a single machine instruction.
Commands in Code Panel
- Double-click the address field to toggle on/off a breakpoint.
- Right-click|"Set PC to line": Set the program counter PC to the address of the current line.
Commands in Register Panel
- Click the register panel to change register value.
Internal Data Memory
- 8051 has 128 bytes of internal data memory. NoICE preserves bytes 70h-7Fh for stack space, and treats R0-R7 in a different ways.
- Internal data memory not used for stack space or R0-R7 can be inspected and changed by the following commands:
- "Memory|Dump...": Dump memory content within specified range.
- "Memory|Fill...": Fill memory with specified value.
- "Memory|Edit...": Edit specified memory location.
Special Function Registers
- Special function registers not listed in the register panel can be (I suppose!) inspected, changed by the following commands:
- "Processor|In...": Read SFR value.
- "Processor|out...": Set SFR value.