Electronic Design

8051 Emulator Breaks On Stack Overflows

The MetaICE 8051 emulator from MetaLink is the first device of its kind, the company claims, capable of breaking on an overflow of a user-defined stack size. Since the 8051 limits on-chip space for the stack, it's pertinent that designers maintain good stack control. This emulator helps designers recognize and debug stack problems that go unnoticed with conventional stack emulators.

According to MetaLink, the MetaICE device is distinguished by four unique features not offered by other emulators. First, the data from every direct write command to a special function register (SFR) is collected in real time and displayed in the trace memory. Since the operation of any 8051 is controlled through the manipulation of the SFRs, the status of these registers is integral to all 8051 applications.

These registers include the accumulator, B register, program status word, stack pointer, data pointer, port registers 0 through 3, interrupt priority and interrupt enable registers, time counter registers, serial channel control registers, and power control register. It's critical for designers to be aware of any alteration in the status of these SFRs. A primary feature of MetaICE is that any direct data write action performed on one of these registers is recorded in the trace frame. This information is collected from the 8051 application non-intrusively and in real time.

A second feature addresses visibility as well. The contents of the stack pointer (SP), interrupt enable (IE), and data pointer (DPTR) registers are all collected in real time and displayed in the emulation status window. This information also is displayed every eight frames in the trace memory, offering the designer a history of these key registers. The visibility of the SP, IE, and DPTR register contents in the status window and the trace memory lets users control the top of the stack to avoid overflow, decipher which of the five or more possible interrupts are enabled and which are disabled, and monitor the next read/write location from data memory. Many of the major concerns of modern programming are addressed through these actions.

The third feature ensures that the emulator breaks on a user-set DPTR limit. The emulator sets a reasonable limit for the DPTR and the program breaks on any DPTR MOVX or MOVC access, or attempt to move the contents of a register, that exceeds this user-set limit. Additionally, the engineer is alerted to the possibility of a problem regarding the DPTR value. This prevents data corruption. Also, it stops the program from attempting to write to a memory location that does not exist.

The ability to break on user-set SP overflow constitutes the final feature. Since available memory space is quite limited in large-stack situations, the stack must be closely managed to avoid overflow. With this device, engineers can set a specific breakpoint at a reasonable limit for that purpose. In this manner, the emulator breaks on an overflow of a user-defined stack size.

The complete system includes the MetaICE emulator base and a typical 8xC51RD probe card. Standard features include 2 Mbytes of emulation memory and 2 million hardware breakpoints. A five-level sequencer for break/trace triggers and 64k frames of trace memory with time-stamping also are included. The MetaICE system, shipping now, costs $5000.

MetaLink, 325 E. Elliot Rd., Ste. 23, Chandler, AZ 85225; (800) METAICE; www.metaice.com.

See associated figure

TAGS: Components
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.