首页    期刊浏览 2024年11月28日 星期四
登录注册

文章基本信息

  • 标题:Testing a mixed-signal design based on a single-chip microcontroller - Product Information
  • 作者:Jerald B. Murphy
  • 期刊名称:Hewlett-Packard Journal
  • 印刷版ISSN:0018-1153
  • 出版年度:1997
  • 卷号:April 1997
  • 出版社:Hewlett-Packard Co.

Testing a mixed-signal design based on a single-chip microcontroller - Product Information

Jerald B. Murphy

The HP 54645D mixed-signal oscilloscope simplifies the testing and debugging of microcontroller-based mixed-signal designs with its integrated analog and digital channels.

This article presents an example that shows how the HP 54645D mixed-signal oscilloscope might be applied to understand the operation of a device that produces a 60-Hz reference signal that is used by other devices in a system. The reference sine wave is produced by a low-pass filtering a pulse width modulated signal generated by a PIC16C74 8-bit CMOS single-chip microcontroller (see block diagram, Fig 1,). This is a fairly typical application of these powerful, low-cost devices. The low cost and availability of single-chip microcontrollers has resulted in their application in areas that previously were nonelectronic, and in some cases even mechanical. Examples include the replacement of clockwork-driven appliance switches and motor control.

[Figure 1 ILLUSTRATION OMITTED]

In this application we have a very stable signal being produced with a simple design. An analog design with the same level of performance would have been much more complex.

The pulse width modulator (PWM) of the PIC16C74 microcontroller is controlled by an 8-bit input. This input is provided by a lookup table stored in the microcontroller's memory. In operation the microcontroller sends the first control input to the PWM from the lookup table, waits a specified time, and then sends the next value in the lookup table to the PWM. When the last value in the lookup table is sent to the PWM, the microcontroller's counter is reset to start the process again at the top of the table. The input to the pulse width modulator is available on the microcontroller's port B RBO-RB7 data lines.

In this application we can view the PWM's output and the 8-bit data that produced that output. This will enable us to verify the correct operation of the PWM. The first step in testing this design is to verify the operation of the PWM. We want to make sure that the minimum pulse width is correct and the maximum pulse width is less than a period of the system's basic timing. The minimum pulse width is found by using the HP 54645D's glitch triggering mode. We simply use one of the analog channels to probe the PWM and then select the "less than" mode of the glitch trigger to find the minimum pulse width.

The minimum pulse width should be approximately 1 [micro] s, so we set that as the search condition in the glitch trigger. Now, decreasing this value until the mixed-signal oscilloscope stops triggering (which happens immediately) isolates the minimum pulse width (Fig. 2). Applying the mixed-signal oscilloscope's automatic measurement feature gives a measurement of this pulse width as 1.02 [micro] s. The maximum pulse width can be located in the oscilloscope's deep memory by delaying the sweep by 8.3 ms (half the period of the 60-Hz signal). Here we observe a pulse that is 256 [micro] s wide with clean transitions on either side. By probing the microcontroller's port B data lines we can observe the input and output of the PWM. The deep memory of the mixed-signal oscilloscope greatly simplifies the task of observing this operation. Simply pressing the Autoscale key results in a display that contains both the analog channel displaying the PWM output and the eight logic channels displaying the PWM's input. The resulting display is not well triggered but the waveform data needed to observe the PWM operation is captured in the oscilloscope's deep memory. Simply pressing the Run/Stop key freezes the display (Fig. 3) so that the contents of the oscilloscope's deep memory can be examined by panning and zooming, using the oscilloscope's time base controls. We see that the minimum and maximum values of the pulse width are related to the 00 and FF values of the digital inputs. The display is zoomed in on a leading edge of one of the PWM pulses and the delay from the digital input to the PWM output is measured to be 8.2 [micro] s (Fig. 4). We can conclude that the PWM is operating properly.

[Figure 2-4 ILLUSTRATION OMITTED]

The next set of questions relate to the low-pass filter. One question might be, "What is the delay from the digital input of the PWM to the output of the low pass filter?" This measurement is easily accomplished with the HP mixed-signal oscilloscope. Connect a second oscilloscope probe to the output of the filter and press Autoscale. The resulting mixed-signal display contains the digital input to the PWM, the variable-width pulse output of the PWM, and the output of the low-pass filter. The oscilloscope is now triggered on the rising edge of the sine wave output of the low-pass filter. The total operation of the system under test is now displayed on one screen (Fig. 5).

[Figure 4 ILLUSTRATION OMITTED]

The delay from the digital input of the PWM to the output of the low-pass filter can be measured by first placing a cursor on a known value of the digital input lines. After selecting the hexadecimal cursor readout mode, the t1 cursor can be placed at the point where the digital lines first reach the value of FF (Fig. 6). The t2 cursor is then placed at the maximum value of the sine wave. Switching the cursor readout to time, this delay is measured to be 2.610 ms (Fig. 7). This measurement was made without having to take into consideration any additional delays that might be associated with the instrumentation. The deep memory of this product allows this measurement to be made on data that was gathered on one trigger. There was no need to be concerned about errors that might be produced by having the display made up of many cycles of system operation.

[Figure 6-7 ILLUSTRATION OMITTED]

In this example we have seen how the HP 54645D mixed-signal oscilloscope simplifies the testing and debugging of microcontroller-based mixed-signal designs with its integrated analog and digital channels. The user of the HP mixed-signal oscilloscope has the advantage of MegaZoom technology's high-speed display, instantly responding controls, and deep memory to simplify the testing phase of the project. The integrated analog and digital channels produce an easy-to-understand view of the device under test. The glitch triggering was used to isolate a point of interest. In this example there was little need to use any of the mixed-signal oscilloscope's pattern or advanced pattern triggering capabilities. These features provide even more debugging power when needed. Both cursor and automatic measurements were used to characterize the device under test.

Acknowledgments

Thanks to Art White, applications consultant for Western Regional Marketing, for developing this application based on the PICDEM-2 model DI163002 demonstration board. The PIC16C741 and PICDEM-2 are products of Microchip Technologies, Inc. 2355 West Chandler Blvd., Chandler, Arizona 85224-6166 USA. Western Regional Marketing, Inc. of Westminster, Colorado is the distributor for Microchip products serving the geographic area where the author is located. Special thanks to Mary Kerr, a former HP employee and now a consultant, for leading the effort to develop this application for Hewlett-Packard. Johnnie Hancock managed the relationship with Microchip. Additional help was received from Steve Warntjes and Bob Witte.

COPYRIGHT 1997 Hewlett Packard Company
COPYRIGHT 2004 Gale Group

联系我们|关于我们|网站声明
国家哲学社会科学文献中心版权所有