An in-circuit emulator (ICE) provides a window into the embedded system. The programmer uses the emulator to load programs into the embedded system, run them,
step through them slowly, and view and change data used by the system's software. An
emulator gets its name because it emulates (imitates) the
central processing unit (CPU) of the embedded system's computer. Traditionally it had a plug that inserts into the socket where the CPU
integrated circuit chip would normally be placed. Most modern systems use the target system's CPU directly, with special JTAG-based debug access. Emulating the processor, or direct JTAG access to it, lets the ICE do anything that the processor can do, but under the control of a software developer. ICEs attach a
computer terminal or
personal computer (PC) to the embedded system. The terminal or PC provides an interactive
user interface for the programmer to investigate and control the embedded system. For example, it is routine to have a source code level
debugger with a graphical windowing interface that communicates through a JTAG adapter (emulator) to an embedded target system which has no graphical user interface. Notably, when their program fails, most embedded systems simply become
bricked. Embedded systems often lack basic functions to detect signs of
software failure, such as a
memory management unit (MMU) to catch memory access errors. Without an ICE, the development of embedded systems can be extremely difficult, because there is usually no way to tell what went wrong. With an ICE, the programmer can usually test pieces of code, then isolate the fault to a particular section of code, and then inspect the failing code and rewrite it to solve the problem. In usage, an ICE provides the programmer with execution
breakpoints, memory display and monitoring, and input/output control. Beyond this, the ICE can be programmed to look for any range of matching criteria to pause at, in an attempt to identify the origin of a failure. Most modern
microcontrollers use resources provided on the manufactured version of the microcontroller for device programming, emulating, and debugging features, instead of needing another special emulation-version (that is, bond-out) of the target microcontroller. Even though it is a cost-effective method, since the ICE unit only manages the emulation instead of actually emulating the target microcontroller, trade-offs must be made to keep prices low at manufacture time, yet provide enough emulation features for the (relatively few) emulation applications. ==Advantages==