Page 151 - Programming Microcontrollers in C
P. 151

136    Chapter 3  What Are Microcontrollers?

                          set memory, examine memory, examine registers, set and clear
                          registers, execute code, set and clear break points, and so forth. All
                          of the operations normally needed to debug a program can be executed
                          through this special serial port. There is no need for an on-board
                          monitor on the microcontroller, and it is not necessary to make use
                          of the chip interrupts by the debugger during the debug operation.
                          All of the programming needed for the debugger can reside in a host
                          computer. Most modern chips have this type of interface, which
                          greatly simplifies debugging of microcontrollers.
                              All of the above capabilities are available with the development
                          boards. Another level of capability is available. These devices are box
                          level, and usually have a built-in power supply. Most development
                          systems require a host computer, and usually they come with special
                          software to interface with the host computer. These systems have all of
                          the capabilities outlined above plus some significant improvements.
                          The breakpoint capability of these systems is much improved over the
                          simple address breakpoint above. Here a complicated breakpoint can
                          be employed that will break the program operation on read or write, at
                          any data or address location, on access of data or program, or access of
                          a range of data or address locations. Also, the breakpoint can occur
                          after a specified number of occurrences of the breakpoint conditions.
                              Another major difference in the development systems is the trace
                          buffer. A trace buffer is a memory that is as many as 48 or 64 bits wide.
                          Each clock cycle of the microcontroller, the condition of all address
                          bits, the data bus, the internal microcontroller control bus, and as many
                          as 16 external test point lines are captured in the trace buffer.
                              Usually, the trace buffer is 4 to 16 kilowords deep, so it can hold
                          a significant number of microcontroller clock cycles. Even if the
                          microcontroller is running slowly, one million clock cycles per second,
                          such a trace buffer represents an insignificant execution time. To help
                          make the data contained in the trace buffer, trace buffer capture can
                          be controlled by a system that is the same as the breakpoint operation.
                          Therefore, the portion of the program that is traced is under the
                          detailed control of the programmer.
                              The data in the trace buffer can be displayed in several different
                          manners. The simplest, of course, is to print to the computer screen
                          the I/O pattern of all the lines captured. This type of display is
                          extremely difficult to interpret, but it is useful in some cases. To help
                          the programmer determine where the microcontroller is operating, it
   146   147   148   149   150   151   152   153   154   155   156