This blog demonstrates the working of Logic Analyzer instrument available in PSLab Android app. It also includes a detailed description of the features available in the Logic Analyzer instrument along with a step by step guide on how to work with it which will be beneficial to first-time users of the PSLab application.
The functionality of the Logic Analyzer available in PSLab Android app is same as that in PSLab Desktop App. So, it would be easy for a user of PSLab Desktop Application to get acquainted with this Logic Analyzer. The only difference in this instrument is the changed and attractive UI which makes working with it very easy.
Why use Logic Analyzer?
The Logic Analyzer instrument provides the functionality of capturing and plotting the digital waves on the screen so that it would be easy for a user to determine the time relationship between different waves. So, this instrument would be very useful while working with timing diagrams, protocol decodes, state machines traces, assembly language, or with source-level software.
How to generate different digital pulses in the PSLab app?
Logic Analyzer needs to be provided with some input of digital pulses among whom time relationship is to be found out. Digital pulses generated from different systems can be directly provided as input to the Logic Analyzer for analyzing. But PSLab provides a functionality to generate digital pulses up to some constrained frequency.
Following are the steps to generate different digital waves in PSLab Android application :
- Open PSLab Android application and click on the Wave Generator tile as shown in figure 1. After opening the instrument, the screen will look as shown in figure 2.
Figure 1. Wave Generator instrument tile available in PSLab Android app
Figure 2. The main screen of the Wave Generator instrument
- Click on the MODE button to change the mode to PWM. The screen will look as shown in figure 3.
Figure 3. PWM mode in Wave Generator
- PSLab device provides generation of maximum four digital waves at once. In this example, I will proceed by utilizing only two pins i.e. SQR1and SQR2 (where SQR = Acronym of square wave generator and the number next to it is the pin ID available on the PSLab device) to demonstrate the working of Two Channel Mode in Logic Analyzer. Set the duty cycles and frequency for the selected pins as desired (try to keep all the duty cycles different from each other to understand the process of measurement easily).
NOTE: User can also set phase angle for different waves but I will proceed with defaults.
How to analyze the generated waves in Logic Analyzer?
- Now go back and select the Logic Analyzer tile as shown in figure 4 from the list of available instruments. A screen as shown in figure 5 should open.
Figure 4. Tile of Logic Analyzer instrument available in the PSLab app
Figure 5. The main screen of the Logic Analyzer instrument
On the right-hand side, you can see a slider whose initial value is SELECT which shows the information on how to use the slider below it. Below the Channel Selection area is the Analyze button used to fetch and plot the data which is generated or provided to the respective Logic Analyzer pins i.e. ID1, ID2, ID3, and ID4.
The blank area on the left is where the graph will be plotted after fetching data points. Below it is the Axis Indicator used to indicate the position of the highlighter so that time measurement can be done easily. To the right of the Axis Indicator is a small light which indicates the status of the device. It turns GREEN if the device is connected else it remains in RED.
- In this blog, I will demonstrate the Two Channel Mode. But all the other available modes need the same implementation by only varying the number of pins in use. So, slide to 2 in the Carousel View and a screen as shown in figure 6 will pop up.
Figure 6. Two Channel Mode in Logic Analyzer
- Connect the wires on the PSLab device as shown in Figure 7.
Figure 7. Connecting wires on PSLab
NOTE: The Logic Analyzer pins used in this demonstration are ID1 and ID2. But any IDx pin can be chosen for analysis. But try to maintain the selected choice throughout the implementation.
- Now from the Channel Selection area, select the channel for the first card to ID1 (default) and that for the second card to ID2. For Edges Selection, maintain the defaults.
NOTE: There are several options available for plotting the digital waves besides the default selected i.e.
- Every Edge – Plot every edge of the signal
- Falling Edges – Plot only falling edges of the signal (When a signal comes from 1 to 0 state)
- Rising Edges Only – Plot only rising edges of the signal (When a signal comes from 0 to 1 state)
- Disabled – Don’t plot the selected wave
- After Channel Selection, press the Analyze button to plot the data. On pressing the Analyze button, a circular loading sign will appear showing that the data is being fetched and converted to data that can be plotted. As soon as the data is ready to be plotted, the loading sign vanishes and the graph appears as shown in figure 8.
Figure 8. GIF showing the loading and analyzing processes
- The time relationship between the plotted data can be found out by clicking over the rising/falling edges and noting the time shown in the Axis Indicator as shown in figure 8.
- An example of Edge Selection is shown in figure 9.
Figure 9. Example of Edge Selection option
Here, EVERY FALLING EDGE option is selected for the ID1 channel and EVERY RISING EDGE option is selected for the ID2 channel.
So in this way, the Logic Analyzer instrument available in PSLab Android application can be used to ease out the process of calculating the time interval between different edges for different/same digital pulse/s.
- PSLab Android Application – https://github.com/fossasia/pslab-android (Link to repo)
- PSLab device pins sticker – https://github.com/fossasia/pslab-artwork/blob/master/Sticker/pslabdesign.png