Configuring a PSoC as a DIY oscilliscope/logic analyzer - Part 1Commercially available lab equipment like oscilloscopes, logic analyzers, and function generators are bulky and expensive, making them difficult to use for hobbyists and budding electronic engineers. The analog bandwidth of oscilloscopes ranges from 1MHz to 33GHz with sampling rates from 500MS/s to 10TS/s and record length ranges from 2.5Kpoint to 500Mpoint. Depending on included features and capabilities, the cost can range from $790 to over $55,000.
The above numbers are fine for companies who can utilize all the features from their investment. However, an entry-level engineering student or a hobbyist who is interested in determining the unknown outputs of the circuit does not require such high-end performance from their oscilloscope. For such a usage there is a requirement of designing a simple oscilloscope which can be both cost-effective and portable.
Integration of analog and digital components in commercially available mixed-signal PSoCs (programmable systems on chip) plus low-cost touch screens provide an affordable opportunity to build a touch screen-based electronic lab kit. The functionality of this PSoc-based system not only includes the features of a normal oscilloscope, but also includes features like a logic analyzer and signal generator that can be of great utility for debugging designs.
Oscilloscope functionality is implemented by sampling and scaling the input signal to be displayed on a graphic LCD. With the availability of sampled values, statistics of the signal like amplitude and frequency are derived. The implementation of a logic analyzer in the device can be used to verify the functionality of digital circuits. This lab kit incorporates a function generator to generate fundamental test signals like sine, square and triangular waves. The user also has the option to obtain the FFT (fast Fourier transform) of the input signal.
This article discusses how a PSoC can be used to build an integrated handheld solution kit with an oscilloscope, a signal generator, and a logic analyzer, the schematics of which are shown in Figure 1 and Figure 2 below.
Figure 1: Schematic of the project in PSoC Creator (a)
Figure 2: Schematic of the project in PSoC Creator (b)
The programmable embedded system-on-chip (PSoC) from Cypress Semiconductors integrates configurable analog peripherals, configurable digital peripherals, memory, and a microcontroller on a single chip. The PSoC family that is used in this article for depicting the implementation is PSoC 5LP (Figure 3 below).
Figure 3: Block diagram of PSoC-based handheld electronic lab kit
The PSoC 5LP device is a mixed signal SoC that forms the heart of the kit. It generates the necessary control signals to the graphic LCD controller for display of appropriate pixels on the graphic LCD.
The four-wire resistive touch screen user interface for the kit is realized by suitably mapping the touch positions to planar coordinates. The controller does this critical function by switching the planes for supply, meanwhile obtaining the ADC output at the other plane to obtain a unique set of values for each position on the screen. The analog front end consists of a voltage follower and SAR ADC to sample the input signal and store the data in a buffer for further processing.
Analysis of digital circuits imposes huge bandwidth requirements whose display is limited by the ADCs maximum sampling rate. This limitation can be overcome by treating the signals of the logic circuitry as two-level signals and analyzing these directly through GPIOs (general purpose input/outputs). Now the bandwidth is improved to that of the system’s maximum clocking speed. The PSoC thus generates the necessary test signals to the logic circuit – combinational or sequential, analyzes the output of the same, and displays on the LCD.
There is also a requirement for generating test signals to obtain the responses of several electronic systems. Adding a function generator to the kit would make it a complete lab kit. The function generator block is responsible for generating sine, triangle, and square waves of user-defined frequencies. The user interfaces for these modalities are shown in Figure 4.
Figure 4: User interfaces of the electronic lab kit
The oscilloscope is an essential tool to design or repair electronic equipment. Energy, vibrating particles, and other invisible forces are everywhere in our physical universe. Sensors can convert these forces into electrical signals that we can observe and study with an oscilloscope. Oscilloscopes let us “see” events that occur in a split second.
The oscilloscope is basically a graph-displaying device – it draws a graph of an electrical signal. In most applications, the graph shows how signals change over time: the vertical (Y) axis represents amplitude and the horizontal (X) axis represents time. The intensity or brightness of the display is sometimes called the Z axis.
With the help of oscilloscope we will be able to:
- Determine the time and amplitude values of a signal
- Calculate the frequency of an oscillating signal
- See the “moving parts” of a circuit represented by the signal
- See how often a particular portion of the signal is occurring relative to other portions
- See if a malfunctioning component is distorting the signal
- Find out how much of a signal direct current (DC) or alternating current (AC) is
- See how much of the signal is noise and whether the noise is changing with time and more
Apart from checking the input signals, having test signals to check the functionality of the circuits is essential. Incorporating a function generator that can generate basic test signals will come in handy when testing the functionality of circuits. To check the functionality of digital circuits, integration of logic analyzer functionality along with the above features makes a complete troubleshooting tool.
Analog front end for the oscilloscope
The analog front end consists of the voltage scaling circuitry, involving simple resistor division and voltage level shift, to convert input signal to the range of the PSoC, i.e. between 0V to 5V. The attenuated input signal for oscilloscope is fed to op amp configured in voltage follower mode, whose output is connected to 12 bit SAR ADC (successive approximation register ADC). The maximum analog bandwidth obtainable with the PSoC 5LP SAR ADC is 70 KHz.
Page 1 of 2Next >