Instructions for the use of NO-ICE with the uP535 and the Dunfield Micro-C Compiler: First, add the directory containing the NOICE51.EXE executable file to your “path.” This is usually accomplished by adding “;C:\MC\NOICE” to the end of the path statement already in your autoexec.bat file. Replace “MC\NOICE” with the directory into which you installed NO-ICE. You will have to reboot your computer for the changes to autoexec.bat to take effect. Next, set up your hardware (unless you intend to use emulation only). The EPROM containing the NOICE monitor program should be installed in the ROM socket, and the uP535 board jumpers should be set such that the RAM is mapped to the upper 32k of both code and data space. Make sure your board has power. Finally, connect the uP535 COM1 serial connector to one of the COM ports on your computer. To debug assembly programs: Change to the directory where your .HEX file was created. Start NO-ICE with the command “noice51”. This will bring up the debugger in simulation mode. To interface with your uP535 hardware, click on the “Options” menu in the upper right hand corner of the window. From this menu, select “COM Port…”. A dialog box will appear. From the list of COM ports on the left of this box, select the port into which your 535 board is plugged. In the box on the right labeled “Baud Rate,” type in the number 19200. (These options may also be specified on the command line; check the NO-ICE documentation for details.) In the lower text window (the message window), the message “Target is 8051 Mapped Monitor V2.0” should appear. If not, then there is an error in the hardware setup. Make sure all chips are seated properly and the necessary cables and headers are attached. You are now ready to load your program. Type “load .hex”, replacing with the name of your file. The typed text will appear near the bottom of the window. Hit enter. In the message window, the message “Loading Address C:xxxx” should appear, with the numbers “xxxx” changing as your program is loaded. When these numbers stop changing, your program is loaded. Before you can begin debugging, you must tell the debugger where your code is. This address was set in your code by ORG assembler directives. For proper operation with NO-ICE, your code must start after address 8000h and end before address FF00h. Your data area must also conform to these limits, and must not overlap the addresses used by your code segment(s). Just below the top menu bar is a line containing the names of the 8051 Special Function Registers. Click on the Program Counter (PC) or the value directly under it. A dialog box will appear, prompting you for a new value. Type in the start address for your code, in hexadecimal, and hit enter. The value under “PC” should change to the value you typed in. Now type the command “source ”. Again, the text will appear near the bottom of the screen. Hit enter. This should set the upper text window (code window) to display your code, starting at the address specified in the “source” command. You are now ready to begin debugging your program. You may run, single-step, and set breakpoints by clicking the bottom menu bar, pressing the associated function keys, or by typing in the commands (a complete list of commands may be found in the NO-ICE documentation). Due to the 8051 architecture, NO-ICE cannot single-step near single-byte instructions (INC, DEC, and NOP for example). Where this is a problem, the debugger will display an error. To work around this, define a breakpoint at the address of the instruction after the single-byte instruction, and run the program. To debug C programs compiled with Dunfield Micro-C: NO-ICE uses the list file (.LST) generated by the Dunfield compiler to generate a NO-ICE command file (.NOI), which sets up C source-level debugging. When compiling, make sure you use the –S option on both the compiler and linker command lines. If you are using the DDSIDE integrated debugger, make sure that the compiler option “C Source Comments” is ON (it is by default). You will also need to insure that your code, when compiled, meets the same memory constraints as explained above for assembly code. This is accomplished by editing the run library file “8051RLPx.ASM” file corresponding to your memory model, found in the LIB directory of the Dunfield distribution. (Replace “x” with T, S, M, C, or L for tiny, small, medium, compact, or large model respectively.) By default, these files are properly configured, assuming you have run the batch file “535c.bat” found on the EMAC distribution disk in the 8051C directory. You will next have to generate a NO-ICE command file from the .LST file generated by the compiler. To do this, switch to the directory where your .LST file is stored, and type “mapnoi .lst”. This will generate a NO-ICE command file (.NOI). At this point you may have to do some file shuffling, due to the respective quirks of Dunfield C and MAPNOI. I strongly recommend that when writing your code, you use full paths from the root directory when including files – this will make things easier when using NO-ICE. If all of your code, hex, and list files are in the C:\MC directory (the MC root directory,) you can skip this section. The MAPNOI program uses the #include statements in your C code to determine the locations of the source file to display while debugging. In Dunfield C, these must be specified as absolute from the root directory, or relative to the MC root directory. However, MAPNOI does not add such path information when telling NO-ICE where to find the .HEX and .LST files. As such, NO-ICE will either not find the .HEX and .LST files, or not find the C-source files, depending on whether NO-ICE is run from the MC root directory, or a subdirectory containing your code, respectively. There are two ways around this. The first is to copy the .NOI file, the .HEX file, and the .LST file to the MC root directory and run NOICE from there. The second way is to edit the .NOI text file directly, removing excess path information from the lines which begin with “File”, then run NOICE from the subdirectory containing your code. Connect your hardware as specified above, and start NOICE. Set the COM port and speed as above. Next, type “play .noi” and hit enter. This will execute all of the commands in the .NOI file, setting up the C-source level debugging. The .HEX file will be automatically downloaded to the board in the same manner as it was under assembly-level debugging. The source files will then be loaded. Before you begin, you must also set the program counter and the line at which to begin display, as you did when debugging assembly language. You are now ready to begin debugging. Note that if any time during debugging, the display windows displays the text “file xxxxxxxx.c line nnnn” on every line, this means that NO-ICE could not find the file, and you should fix the path information. The “Step” and “Next” commands have different meanings than they did when debugging assembly. While the “Istep” command can still be used to execute a single assembly language statement, “Step” will execute a single C-language statement, going into subroutines where called. “Next” will also execute a single C-language statement, but unlike “Step,” “Next” will treat function and subroutine calls as single statements, not displaying their code or execution. Note that Dunfield (and most all 8051 C compilers) add assembly language routines to user code to automate many C operations. This assembly code is frequently added to the end of user code, along with initialization code at the beginning. Thus, your C code may not appear even after you set the program counter and display address to the start of your program; try stepping through several of the assembly instructions to get to your code. Also, even when using the “Next” command, the debugger may occasionally jump into and display the execution of some of these added assembly functions. The best thing to do in these cases is simply step through them until you return to your C source code. Remember that the limitation on the single-step command near single-byte assembly instructions still holds when debugging in C source level.