Using an MSO to Debug a PIC18-Based Mixed-Signal Design

Similar documents
Keysight Technologies Evaluating Oscilloscopes to Debug Mixed-Signal Designs. Application Note

Characterizing High-Speed Oscilloscope Distortion A comparison of Agilent and Tektronix high-speed, real-time oscilloscopes

6 Tips for Successful Logic Analyzer Probing

Agilent Introduction to the Fixture Simulator Function of the ENA Series RF Network Analyzers: Network De-embedding/Embedding and Balanced Measurement

Choosing an Oscilloscope with the Right Bandwidth for your Application

Picking the Optimal Oscilloscope for Serial Data Signal Integrity Validation and Debug

Agilent AN Balanced Circuit Measurement with an Impedance Analyzer/LCR Meter/Network Analyzer Application Note

A Time-Saving Method for Analyzing Signal Integrity in DDR Memory Buses

Agilent Technologies 3000 Series Oscilloscopes

Jitter Analysis Techniques Using an Agilent Infiniium Oscilloscope

Agilent E8247/E8257C PSG CW and Analog Signal Generators

Product Note E5100A-2

Agilent E8267C PSG Vector Signal Generator

Agilent E4438C ESG Vector Signal Generator Differential I/Q outputs. Product Note

Agilent Highly Accurate Amplifier ACLR and ACPR Testing with the Agilent N5182A MXG Vector Signal Generator. Application Note

Agilent E9300 Power Sensors E-Series Technical Overview

Phase Noise Measurement Personality for the Agilent ESA-E Series Spectrum Analyzers

Advanced Test Equipment Rentals ATEC (2832)

Agilent dc Electronic Loads Models N3300A-N3307A

PCI Express Receiver Design Validation Test with the Agilent 81134A Pulse Pattern Generator/ 81250A ParBERT. Product Note

Time-Domain Response of Agilent InfiniiMax Probes and Series Infiniium Oscilloscopes

Agilent N1911A/N1912A P-Series Power Meters and N1921A/N1922A Wideband Power Sensors. Data sheet

Agilent N8480 Series Thermocouple Power Sensors. Technical Overview

Flexible Signal Conditioning with the Help of the Agilent 81134A Pulse Pattern Generator

Agilent PNA Series RF Network Analyzers

Agilent 83440B/C/D High-Speed Lightwave Converters

Agilent 81150A Pulse Function Arbitrary Noise Generator Applications

Evaluating Oscilloscope Bandwidths for your Application

MIL-STD 1553 Triggering and Hardwarebased Decode (Option 553) for Agilent s InfiniiVision Series Oscilloscopes

Agilent 8703B Lightwave Component Analyzer Technical Specifications. 50 MHz to GHz modulation bandwidth

Agilent PSA Series Spectrum Analyzers Self-Guided Demonstration for Phase Noise Measurements

Agilent 8761A/B Microwave Switches

Base Station Installation and Maintenance

Agilent E8460A 256-Channel Reed Relay Multiplexer

Agilent 8491A/B, 8493A/B/C, 11581A, 11582A and 11583C Coaxial Attenuators dc to 26.5 GHz

Process Control Calibration Made Easy with Agilent U1401A

Educator s Oscilloscope Training Kit for the InfiniiVision 2000 & 3000 X-Series

Agilent 8644A-1 Phase noise test with the Agilent 8644A and 8665A Signal Generators Product Note

System Cabling Errors and DC Voltage Measurement Errors in Digital Multimeters

Agilent 86030A 50 GHz Lightwave Component Analyzer Product Overview

Agilent 8902A Measuring Receiver Product Note

Agilent Technologies 3000 Series Oscilloscopes

Agilent U2000 Series USB Power Sensors. Data Sheet

Agilent PSA Series Spectrum Analyzers Noise Figure Measurements Personality

Agilent 8766/7/8/9K Microwave Single-Pole Multi-Throw Switches

Agilent E8267C/E8257C/E8247C PSG

Obtaining Flat Test Port Power with the Agilent 8360 s User Flatness Correction Feature. Product Note

Multipurpose Lab Station by Agilent Technologies

Agilent N8973A, N8974A, N8975A NFA Series Noise Figure Analyzers. Data Sheet

Agilent Technologies 3000 Series Oscilloscopes

Agilent 81600B All-band Tunable Laser Source Technical Specifications December 2002

Agilent PNA Microwave Network Analyzers

Discovering New Techniques of Creating, Editing, and Transferring Arbitrary Waveforms

Agilent Combining Network and Spectrum Analysis and IBASIC to Improve Device Characterization and Test Time

Agilent Maximizing Measurement Speed Using P-Series Power Meters

Agilent EPM Series Power Meters

Agilent Spectrum Visualizer (ASV) Software. Data Sheet

Agilent 81662A DFB Laser Agilent 81663A DFB Laser Agilent Fabry-Perot Lasers

Advanced Test Equipment Rentals ATEC (2832)

Agilent Technologies 8114A 100 V/2 A Programmable Pulse Generator

Creating Arbitrary Waveforms in the U2300A Series and U2500A Series Data Acquisition Devices

Agilent 83711B and 83712B Synthesized CW Generators

Agilent 87415A, 87400A Microwave Amplifiers

How to Drive the Agilent Technologies Microwave Matrix and Transfer Switch via the E8483A Microwave Switch/Step Attenuator Driver.

Educator s Oscilloscope Training Kit for Agilent InfiniiVision X-Series Oscilloscopes

Techniques to Achieve Oscilloscope Bandwidths of Greater Than 16 GHz

Agilent 81980/ 81940A, Agilent 81989/ 81949A, Agilent 81944A Compact Tunable Laser Sources

Agilent U1881A and U1882A Power Measurement Application for Agilent InfiniiVision and Infiniium Oscilloscopes

Keysight Technologies Triggering on and Decoding the PSI5 Sensor Serial Bus

UWB Antenna Measurements with the 20 GHz E5071C ENA Network Analyzer

Agilent PSA Series Spectrum Analyzers Noise Figure Measurements Personality

How to capture, save, and reproduce arbitrary load current waveforms

Advanced Test Equipment Rentals ATEC (2832)

Agilent Equalization Techniques and OFDM Troubleshooting for Wireless LANs

Advanced Test Equipment Rentals ATEC (2832)

When is it Time to Transition to a Higher Bandwidth Oscilloscope?

expanding the possibilities

Agilent E6651A Mobile WiMAX Test Set

Agilent 81140A Series 81141A / 81142A Serial Pulse Data Generators 7 GHz and 13.5 GHz

8 Hints for Better Spectrum Analysis. Application Note

Agilent 8360B Series Synthesized Swept Signal Generators 8360L Series Synthesized Swept CW Generators

Agilent 34405A Multimeter 5.5 Digit Dual Display, Benchtop DMM More Capabilities at a Value Price

Keysight N8803C CAN, LIN, FlexRay, and CAN-FD Protocol Triggering and Decode Software. Data Sheet

Agilent MXG Signal Generators

Data Sheet. Agilent M9185A PXI Isolated D/A Converter. DISCOVER the Alternatives... Agilent MODULAR Products. 8/16-Channel 16-bit, ±16 V

MEMS On-wafer Evaluation in Mass Production Testing At the Earliest Stage is the Key to Lowering Costs

Agilent N5250A PNA Millimeter-Wave Network Analyzer 10 MHz to 110 GHz

Agilent 970-Series Handheld Multimeters Data Sheet

Improving TDR/TDT Measurements Using Normalization Application Note

Agilent Correlation between TDR oscilloscope and VNA generated time domain waveform

Agilent 6800 Series AC Power Source/Analyzer

Agilent CSA Spectrum Analyzer

VSA80000A Ultra-Wideband Vector Signal Analyzer

1How much bandwidth do you need?

Agilent Upgrade Guide for the 8510 Vector Network Analyzer Product Note

Agilent 8360B Series Synthesized Swept Signal Generators 8360L Series Synthesized Swept CW Generators Data Sheet

Agilent 8902A Measuring Receiver

Agilent N4000A, N4001A, N4002A SNS Series Noise Sources 10 MHz to 26.5 GHz

Agilent NFA Noise Figure Analyzer

Meet the new E4438C ESG vector signal generator...

Transcription:

Using an MSO to Debug a PIC18-Based Mixed-Signal Design Application Note 1564 Introduction Design engineers have traditionally used both oscilloscopes and logic analyzers to test and debug mixed-signal embedded designs based on microcontrollers (MCUs). But a new class of measurement tools called Mixed Signal Oscilloscopes (MSOs) offers many advantages for debugging your embedded designs. To illustrate the unique advantages of an MSO, this paper shows a typical turn-on and debugging methodology for a mixed-signal embedded design based on a Microchip PIC18 microcontroller. The MSO is used to verify proper signal quality of a pulsed analog chirp output signal generated by the MCU and its associated peripheral hardware based on a variety of analog, digital, and serial I/O (I 2 C) input conditions. But before exploring this particular embedded design and explaining how it was turned-on and debugged with an MSO, let s define what we mean by MSO. Table of Contents Introduction....................... 1 What is an MSO?.................. 2 The PIC microcontroller-based chirp design..................... 3 Turning on and debugging an embedded chirp design with an MSO........................... 4 Summary.......................... 7 Glossary........................... 7 Support, Services, and Assistance... 9

What is an MSO? An MSO is a hybrid test instrument that combines all of the measurement capabilities of a Digital Storage Oscilloscope (DSO) with some of the measurement capabilities of a logic analyzer into a single, synergistic instrument. With an MSO, you are able to see multiple time-aligned analog and digital waveforms on the same display, as shown in Figure 1. MSOs typically lack the advanced digital measurement capabilities and the large number of digital acquisition channels of full-fledged logic analyzers; the relative simplicity of MSOs allows them to avoid the complex use model associated with operating full-fledged logic analyzers. In fact, one of the primary advantages of an MSO is its use model. You use an MSO in much the same way you use an oscilloscope. And because MSOs are highly integrated, they are much easier to use than loosely tethered two-box mixed-signal measurement solutions. A good MSO should be user-friendly, provide fast waveform update rates, and operate much like an oscilloscope not like a logic analyzer. Figure 1. Agilent s 6000 Series Mixed Signal Oscilloscope (MSO) 2

The PIC microcontroller-based chirp design Figure 2 shows a block diagram of an embedded chirp product developed by Solutions Cubed of Chico, California, USA, for an embedded industrial application. At the core of this mixed-signal embedded product is a Microchip PIC18F452-I/PT microcontroller that operates on an internal 16-bit instruction set. Since this particular MCU has an internal bus structure and includes an embedded Analog-to-Digital Converter (ADC), this mixed-signal device and its associated external circuitry is a perfect candidate for turning on and then debugging with an MSO. Although understanding the operation of this specific design may not be very relevant to your particular design applications, we will provide an overview of this system s operation so that you can see how an MSO is used for this type of mixed-signal measurement application. The ultimate goal of this design was to generate analog chirp output signals with various lengths, shapes, and amplitudes that are based on a variety of analog, digital, and serial I/O input conditions. (A chirp is an RF-pulsed analog signal consisting of a specific number of cycles often found in aerospace/defense and automotive applications.) The MCU simultaneously monitors the following three analog and digital inputs to determine the analog characteristics of the output chirp signal that it needs to generate: 1. The status of the user control panel is monitored with one of the PIC microcontroller s available parallel digital I/O ports to determine the shape of the output-generated chirp signal (sine, triangular, or square wave). 2. The output level of an acceleration analog input sensor is monitored via one of the PIC microcontroller s available ADC inputs to determine the amplitude of the output-generated chirp signal. 3. The status of the serial I 2 C communication link is monitored with the MCU s dedicated I 2 C serial I/O port to determine the number of pulses to be generated in the output chirp. This I 2 C communication input signal is generated from another intelligent sub-system component from within this embedded design. Depending on the status of these three analog, digital, and serial inputs, the PIC MCU generates a series of parallel output signals to an external 8-bit DAC to create an analog chirp signal of various amplitudes, shapes, and lengths. The unfiltered stair-step output of the DAC is then fed through an analog low-pass filter to smooth the output signal and reduce noise. This analog filter also induces a predetermined amount of phase shift to the output signal. Finally, the MCU generates a parallel digital output via another available digital I/O port to drive an LCD display that provides system status information. Figure 2. Mixed-signal embedded design that generates analog chirp outputs based on analog, digital, and serial I/O 3

Turning on and debugging an embedded chirp design with an MSO The first step in designing/programming the MCU in this design was to configure the MCU s I/O for the appropriate number of analog and digital I/O ports. You can trade-off the number of analog I/O ports for digital I/O ports and vice versa in this particular microcontroller from Microchip. Before attempting to code the MCU to monitor various inputs and generate the final specified output signals, we decided to first develop test code to turn on one section/function of this embedded design at a time and verify proper operation and signal integrity before adding interactive complexity. The first section/function we turned on and debugged was the external output DAC and analog filter. To verify proper operation of this circuitry and internal firmware, we initially coded the PIC MCU to generate a continuous/repetitive sine wave of fixed amplitude, regardless of the input control/status signal conditions. Figure 3 shows a screen-image from an MSO that captured the continuous digital outputs of the MCU s digital I/O port (blue/bottom traces) that drives the digital inputs of the external DAC. In addition, we can see the time-aligned stair-step output of the converter (yellow/top trace) and the analog-filtered output signal (green/middle trace). Since this particular signal was a relatively low-level output signal utilizing just 16 levels of the 8-bit DAC (256 levels max), we can easily view the unfiltered/stair-step output characteristics of this converter on the oscilloscope s display. We set up this particular acquisition to trigger when the DAC s output reached its highest output level (center-screen). Triggering at this particular point using conventional oscilloscope triggering would be impossible, since scope triggering requires edge transitions it is impossible to trigger at the top of a signal with a conventional oscilloscope. To trigger at this point/phase of the output signal, we established a simple one-level pattern trigger condition based on the digital input signals of the DAC (outputs of the PIC MCU I/O port) that were coincident with the highest output analog level of the external converter. To trigger at this precise point in the waveform, we entered a parallel binary pattern of HHHL LHHL for triggering. Since this MSO employs qualified pattern triggering, the scope always triggered at the beginning of the specified pattern and never triggered on unstable/transitional conditions because this scope requires that the logic levels be stable for a minimum of 2 ns, and then triggers only when a stable pattern is entered. Note that some mixed-signal measurement solutions/options will trigger whenever a specified pattern trigger condition is present. This means that they might trigger during the middle of a pattern, or possibly during a transitional/switching state. Without qualified pattern triggering, the result will be unstable triggering. Figure 3. The MSO captures parallel digital input and analog output of a PIC MCU controlled DAC. 4

Turning on and debugging an embedded chirp design with an MSO (continued) Figure 4 shows a trigger set up condition of the MSO that provided triggering precisely at the DAC s 50% output level. We achieved this by using pattern triggering on the parallel digital input signals in addition to an analog trigger condition. Keep in mind that not all MSOs/mixed-signal measurement solutions permit combined mixed-signal triggering on both analog and digital conditions. But with two analog output conditions at the same level (50% rising level and 50% falling level), triggering coincident with either the rising or falling point required more than just pattern triggering on the 8-bit input pattern. With the addition of qualifying on a low level on analog channel 2, the scope was able to trigger at the desired phase using a combination of analog and digital pattern triggering. (Note that analog signals are considered high when they are above the analog trigger level, and low when they are below the trigger level.) After turning on and verifying proper operation of the external DAC and analog filtering circuitry, the next step in this design/turn-on process was to generate a specific number of non-repetitive sine wave pulses (chirps) based on a serial I 2 C Figure 4. The MSO triggers at the 50% crossing point using a combination of analog and digital pattern triggering. input. Figure 5 shows an overlay (infinite-persistence) of various length chirps using standard oscilloscope edge triggering. With conventional oscilloscope edge triggering, it is impossible to qualify triggering on specific-length chirps. Also shown in Figure 4 are automatic parametric measurements including amplitude, frequency, as well as the phase shift of the filtered output signal relative to the stair-step output of the DAC. Figure 5. Conventional oscilloscope edge triggering fails to synchronize on specific-length chirps. 5

Turning on and debugging an embedded chirp design with an MSO (continued) Using the MSO s I 2 C triggering capability, the scope was able to synchronize acquisitions on specific serial input conditions that instructed the PIC MCU to generate specific-length (number of pulses) output chirps. This is shown in Figures 6 and 7. Figure 6 shows the MSO s ability to trigger on a 3-cycle chirp with I 2 C triggering on specific serial address and data content, and Figure 7 shows the scope s ability to trigger on a 1-cycle chirp. Digital channels D14 and D15 (top two blue digital traces) were defined as the I 2 C clock and data input triggering signals respectively. Actually, we could have defined any of the sixteen digital or 2 to 4 analog scope channels to serially trigger on these two serial input signals. While monitoring the serial input and analog output signals, D0 through D7 were set up to monitor the DAC input (MCU output) signals (bottom eight blue and read digital traces) as shown in Figures 6 and 7. Although not shown, we could have set up another analog channel of the oscilloscope to simultaneously probe, acquire, and trigger the MSO based on the additional analog input signal from the input analog acceleration sensor, which determines the output signal amplitude. In addition, we could have utilized unused MSO digital channels to monitor and/or further qualify triggering on the digital control panel inputs or the LCD output driver signals. Figure 6. Triggering on a 3-cycle chirp with I 2 C triggering in an MSO. Figure 7. Triggering on a 1-cycle chirp with I 2 C triggering in an MSO. 6

Summary This paper showed how a mixed signal oscilloscope (MSO) can be used to more effectively and efficiently turn on and debug embedded mixed-signal designs based on a Microchip PIC18 microcontroller. The next time you need to turn on and debug your PIC MCU-based mixed-signal design, you might consider using an MSO in place of your current DSO and/or logic analyzer measurement solution. For more detailed information on debugging embedded designs, download Agilent s Application Note 1562, Debugging Embedded Mixed-Signal Designs Using Mixed Signal Oscilloscopes at http://cp.literature.agilent.com/ litweb/pdf/5989-3702en.pdf. Glossary ADC Analog-to-digital converter, sometimes referred to as an A-to-D Analog I/O Real-time analog input and output signals of a microcontroller (MCU) or digital signal processor (DSP) Chirp An RF-pulsed analog signal consisting of a specific number of pulses DAC Digital-to-analog converter, sometimes referred to as a D-to-A Digital I/O Latched input and output signals of a microcontroller (MCU) or digital signal processor (DSP) DSO Digital storage oscilloscope that acquires and displays analog characteristics of input signals using either real-time or equivalent-time sampling techniques I 2 C Inter-integrated circuit bus, which is a common 2-wire serial bus that utilizes a self-arbitration protocol LCD Liquid crystal display MSO Mixed signal oscilloscope that synergistically combines all of the measurement capabilities of an oscilloscope with some of the measurement capabilities of a logic analyzer and includes a time-correlated display of both analog and digital waveforms MCU Microcontroller unit Qualified pattern triggering Triggering at a specific location within a digital parallel pattern (usually entry or exit points) and ensuring that an input pattern has stabilized with a minimum time qualification (present for >x time) before generating a trigger event so that the scope or logic analyzer does not trigger on unstable/transitional input switching conditions RF Radio Frequency 7

Solutions Cubed, LLC Agilent Technologies would like to thank Solutions Cubed, LLC of Chico, California, for providing the block diagram and measurement example of the mixed-signal MCU-based chirp design discussed in this paper. Agilent Technologies has worked closely with Solutions Cubed on various mixed-signal embedded design projects. Agilent currently offers an MSO training board based on the embedded chirp design developed by Solutions Cubed and documented in this application note. The MSO training board (N2918A), which can be purchased directly from Agilent Technologies, not only provides signals to train you on how to use an MSO, but also includes a variety of signals that demonstrate other important characteristics of oscilloscopes including glitch capture, waveform update, and display quality. Using this new MSO training board along with the easy-to-follow user s guide, you can quickly become familiar with how to effectively use an MSO in about one to two hours. Solutions Cubed can provide mixed-signal hardware and software embedded design services/consulting according to your specified requirements. Contact Solutions-Cubed directly: Solutions Cubed 256 East 1 st Street Chico, CA 95928 USA +1 (530) 891-1643 www.solutions-cubed.com Related Literature Publication Title Publication Type Publication Number Agilent 6000 Series Oscilloscopes Data sheet 5989-2000EN/ENUS Agilent 6000 Series Oscilloscope Probes Data sheet 5968-8153EN/EUS and Accessories Agilent 54830 Series Infiniium Oscilloscopes Data sheet 5988-3788EN/ENUS Agilent 54830 Series Infiniium Oscilloscopes Data sheet 5968-7141EN/EUS Probes and Accessories Debugging Embedded Mixed-Signal Designs Application Note 5989-3702EN Using Mixed Signal Oscilloscopes Why Oscilloscope Waveform Update Rates Application note 5989-2002EN are Important Oscilloscope Display Quality Impacts Ability to Application note 5989-2003EN Uncover Signal Anomalies - Agilent 6000 Series Scope versus Tek TDS3000B Series Scope Oscilloscope Display Quality Impacts Ability to Application note 5989-2004EN Uncover Signal Anomalies - Agilent 6000 Series Scope versus LeCroy WaveSurfer 400 Series Scope Deep Memory Oscilloscopes: The New Tools Application note 5988-9106EN of Choice Evaluating Oscilloscope Vertical Application note 5989-3020EN Noise Characteristics Ten Things to Considers When Selecting Application note 5989-0552EN Your Next Oscilloscope 8

www.agilent.com Agilent Technologies Test and Measurement Support, Services, and Assistance Agilent Technologies aims to maximize the value you receive, while minimizing your risk and problems. We strive to ensure that you get the test and measurement capabilities you paid for and obtain the support you need. Our extensive support resources and services can help you choose the right Agilent products for your applications and apply them successfully. Every instrument and system we sell has a global warranty. Two concepts underlie Agilent s overall support policy: Our Promise and Your Advantage. Our Promise Our Promise means your Agilent test and measurement equipment will meet its advertised performance and functionality. When you are choosing new equipment, we will help you with product information, including realistic performance specifications and practical recommendations from experienced test engineers. When you receive your new Agilent equipment, we can help verify that it works properly and help with initial product operation. Your Advantage Your Advantage means that Agilent offers a wide range of additional expert test and measurement services, which you can purchase according to your unique technical and business needs. Solve problems efficiently and gain a competitive edge by contracting with us for calibration, extra-cost upgrades, out-of-warranty repairs, and on-site education and training, as well as design, system integration, project management, and other professional engineering services. Experienced Agilent engineers and technicians worldwide can help you maximize your productivity, optimize the return on investment of your Agilent instruments and systems, and obtain dependable measurement accuracy for the life of those products. Agilent Open www.agilent.com/find/open Agilent Open simplifies the process of connecting and programming test systems to help engineers design, validate and manufacture electronic products. Agilent offers open connectivity for a broad range of system-ready instruments, open industry software, PC-standard I/O and global support, which are combined to more easily integrate test system development. Agilent Email Updates www.agilent.com/find/emailupdates Get the latest information on the products and applications you select. Agilent Direct www.agilent.com/find/agilentdirect Quickly choose and use your test equipment solutions with confidence. For more information on Agilent Technologies products, applications or services, please contact your local Agilent office. The complete list is available at: www.agilent.com/find/contactus Phone or Fax United States: (tel) 800 829 4444 (fax) 800 829 4433 Canada: (tel) 877 894 4414 (fax) 800 746 4866 China: (tel) 800 810 0189 (fax) 800 820 2816 Europe: (tel) 31 20 547 2111 Japan: (tel) (81) 426 56 7832 (fax) (81) 426 56 7840 Korea: (tel) (080) 769 0800 (fax) (080) 769 0900 Latin America: (tel) (305) 269 7500 Taiwan: (tel) 0800 047 866 (fax) 0800 286 331 Other Asia Pacific Countries: (tel) (65) 6375 8100 (fax) (65) 6755 0042 Email: tm_ap@agilent.com Contacts revised: 05/27/05 Product specifications and descriptions in this document subject to change without notice. Agilent Technologies, Inc. 2005 Printed in USA, October 3, 2005 5989-3843EN