An in-circuit debugger is a hardware device used to debug the software of an embedded system. This can be done at the assembly or C level. An ICD unit is connected to a target board and a PC (via serial or USB). The ICD control software allows the user to quickly program a Flash microcontroller on the target board using in-circuit serial programming. The user can then set break points in the code to step-thru the code for debugging. The user can continue to program new code and debug without having to remove a chip from the target board.
ICDs are a very inexpensive development tool for debugging software, but they are only good for Flash memory chips. If an OTP chip is the target, a user may want to consider an emulator or to choose a Flash device that is similar to the OTP device.
A Simulator is a program that runs on the PC and pretends to be a microcontroller chip. A simulator offers all the normal debug capability such as single stepping and looking at variables, however there is no interaction with real hardware. This works well if you want to test a math function, but not so good if you want to test an interface to another chip. With the availability of low cost tools, such as the ICD, there is less interest in simulators. Microchip offers a free simulator that can be downloaded from their website. Some other vendors offer simulators as a part of their development packages.
The ICD uses two I/O pins on the chip to communicate with a small debug program in the chip. This is a basic debug tool that takes up some of the chip's resources (I/O pins and memory). An Emulator replaces the chip with a special connector that connects to a unit that emulates or mimics the chip. The debugging works in a simulator manner except that the chip has all of its normal resources, the debugger runs faster and there are more debug features. For example, an emulator typically will allow any number of breakpoints. Some of the emulators can break on an external event like some signal on the target board changing. Some emulators can break on an external event like some that were executed before a breakpoint was reached. Emulators cost between $500 USD and $3000 USD, depending on the chips they cover and their features.