Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Computer-based logic analyzer. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Computers

Comments on the article Comments on the article

Public literature on computer topics is mainly devoted to the traditional use of a personal computer (PC) - for calculations, creating and editing documents, searching and storing information, and entertainment. Less common are articles and books about designing various electronic devices using a PC. There are almost no materials about how a PC can help a radio amateur in setting up and debugging the devices he creates. It is believed that for this the PC must be equipped with rather complex and expensive additional boards and set-top boxes. However, often a number of functions that are very useful to a radio amateur can be implemented using standard devices available in each PC, such as communication ports. This will be discussed in the proposed article.

Each IBM-compatible PC has two serial communication ports, referred to as COM ports or RS-232C interfaces. A mouse manipulator is usually connected to one of them, without which it is difficult to imagine effective work today, the second one often remains free or is used from time to time to connect an external modem and other peripheral devices that do not work all the time.

The set of RS-232C interface signals and their purpose are described in detail in [1]. All of them are listed in Table. 1 together with RI (Ring Indicator, circuit 125) not mentioned in the same article. As you can see, the user has three output and five input circuits. A program that generates signals of the required shape at the outputs of a COM port and simultaneously analyzes the state of its inputs can turn a PC into a memory multichannel logic analyzer with a wide range of analysis periods and rich synchronization, processing and displaying capabilities. It can be useful when debugging a wide variety of digital devices.

Computer Based Logic Analyzer

The main difficulty in developing an analyzer program is that the standard hardware and software configuration of an IBM-compatible PC, even in the presence of a fast processor and RAM, does not allow any accurate formation of intervals less than a few hundred milliseconds using DOS processor interrupts due to system timer overflow. , and on Windows, timer messages. Since these events occur with a period of approximately 55 ms, this is how the “quantum” of the time count turns out. Attempts to reprogram the timer lead to unpredictable consequences for all running programs and the operating system itself.

You can measure time by counting the number of cycles a program has run, and by making sure that this process is not interrupted by external events. But even such a task in modern operating systems is not solved correctly, in addition, shutter speed adjustment is required in relation to each PC hardware configuration. In MS DOS, such problems are solved more easily, but the development of a program becomes too laborious if a graphical interface and auxiliary actions are required: calculations, printing graphs.

However, using any operating system, you can get a signal of a strictly specified frequency and shape at the TXD output of the serial port. As you know, the bit rate of the transmitted data is equal to the division of the reference frequency stabilized by the quartz resonator (115 200 Hz) by the coefficient M. The system software selects and sets this coefficient based on the standard information transfer rates. However, nothing prevents an application program from assigning the M factor any value between 1 and 216 -1 (0FFFFH). Thus, pulses with a frequency from 57,6 kHz to fractions of a hertz can be obtained at the TXD output, and an arbitrary frequency below 12 kHz can be set with an error of no more than +10, and below 1,2 kHz - +1%.

The serial port is controlled through ten eight-bit registers of its controller, called a universal asynchronous transceiver (UART, UART). In table. 2 shows the addresses of these registers in the PC input-output space and their functional purpose. It is easy to see that some of them have the same addresses. Access to others is additionally controlled by the most significant bit (D7) of the line control register. If it has a logical 1, they access the speed divider registers (high and low bytes of the number M), if 0 - data of the transmitter and receiver, enable interrupts.

Computer Based Logic Analyzer

The TXD output signal format depends on the code written to the line control register. Bits D1 and D0 of this code set the number of information bits in a word transmitted (or received) by the UART. There can be from five (in the mentioned digits - code 00) to eight (code 11). The number of stop bits depends on the state of the D2 bit: 0 - one; 1 - two. With five information instead of two stop bits, one is transmitted, but one and a half duration, which is done for compatibility with old mechanical teletypes.

Bits D3-D5 of the line control register control the parity bit. If D3=1, during transmission it is "inserted" between the last information and the first stop bits, otherwise it is absent. The transmitter automatically selects the value of this bit so that the total number of ones in the information and control bits becomes even (with D4=1) or odd (with D4=0). This logic can be disabled by setting D5=1. The control bit will become the inverse of the value of the D4 bit, regardless of the number of ones in the information bits.

Logic 1 in bit D6 enable the simulated disconnection mode. At the TXD output, regardless of the state of all other bits and registers, a constant logic level of 0 is set. The purpose of bit D7 was described above. In table. 3 shows some examples of the formation of signals of various frequencies and duty cycles in the TXD circuit, far from exhausting all the possibilities. The waveform shown in the corresponding column of the table can be observed directly at the TXD output of the UART. On the external connector of the port, it is inverted. However, the interface device described below will invert the signal again and its shape will again coincide with the table.

Computer Based Logic Analyzer

Recall that the transmission of a byte written to the transmitter data register starts with the least significant bit. Since a byte is transferred only once, in order to obtain a strictly periodic output signal, it is necessary to repeat the loading of the specified register immediately after it is freed. The readiness to write a new byte is indicated by D5=1 in the line status register.

If you do not want to spend time constantly polling the status register, you can use interrupts. Typically, the port controller COM1 generates an IRQ4 request, and COM2 generates an IRQ3 request. The generation of interrupt requests when the transmitter is ready must be enabled by writing a logical 1 to bit D1 of the interrupt enable register. When requests are simultaneously allowed for other reasons, when processing them, you should first of all read the interrupt identification register and, only after making sure that there is a binary code 2 in its bits D1 and D10, write a new byte to the transmitter data register.

The signal levels at the RTS and DTR outputs depend on the state of the D1 and D0 bits of the modem control register. It is recommended that bits D2 and D3 of this register be written to logic 0. But in some PCs, a zero value of bit D3 disables the UART from the interrupt controller. If you enter a logical 1 in bit D4, the TXD and RXD circuits will be interconnected inside the UART (the so-called "internal loop"), which can be used for debugging and diagnostic purposes.

Bits D4, D5, D6 and D7 of the modem status register display the current signal levels at four inputs - respectively CTS, DTS, RI and DCD. A very useful property of the UART is to fix the facts of the change in the state of the named circuits in units in the bits D0-D3 in the intervals between program calls to this register. Interrupts are also provided for changing the state of the modem. They correspond to bit D3 of the interrupt enable register and code 11 in bits D2 and D1 of their identification register. Unfortunately, the main RXD input circuit when using the serial port for its intended purpose is not of great interest for the task under consideration.

More details about the purpose and use of UART registers can be found, for example, in [2].

The logic levels of the signals at the inputs and outputs of the serial port must be within -3...-15 V (logical 1) and +3...+15 V (logical 0). To debug devices based on TTL and CMOS chips, these levels must be converted accordingly. This can be done using the interface node, the diagram of which is shown in Fig. 1. The elements of the DD1 chip convert the output signals of the port to the required levels, and the switches on transistors VT1-VT4 will perform the reverse conversion. Switch SA1 can connect one of the port inputs directly to the TXD output. This may be necessary to clock the analysis process.

Computer Based Logic Analyzer

The XS1 plug is connected to the PC serial port socket with a cable up to several meters long, the device being debugged is connected to the XS2-XS11 sockets. It is best to power the interface node and the device being debugged from a common source. Often in the device being debugged there is no negative voltage necessary to power the collector circuits of transistors VT1-VT4. In this case, they are fed by the "rectified" diodes VD1-VD3 with the negative voltage of the output signals of the port, which are in the state of logical 1.

The signal generator and logic analyzer program developed by the author works in a 32-bit Windows environment. Its main window "Analyzer", shown in Fig. 2 is a screen of a virtual four-channel (by the number of port input circuits) storage oscilloscope. To the left of the screen are indicators ("light-emitting diodes") that make it easier to observe slow processes. After starting the program, you must select the communication port with which it will work in the "Port" menu.

Computer Based Logic Analyzer

The oscilloscope sweep can be continuous with a specified period or single (start by pressing the corresponding button). The "Stop" button can be used to "freeze" the image. Having opened the "Synchronization" window (Fig. 3), select any of the input or output signals as the synchronizing one.

Computer Based Logic Analyzer

In the "Sweep" window (Fig. 4) set the clock frequency of the analysis and its duration.

Computer Based Logic Analyzer

The "Output line modes" dialog box, in which the frequency and shape of the generated signals are set, is shown in fig. 5. The clock division ratio is changed with a decade switch. The program calculates and displays in the window the frequency and repetition period values ​​corresponding to the given coefficient and the selected signal shape at the TXD output. Generation can be continuous, single or bursts of a given number of pulses.

Computer Based Logic Analyzer

The DTR and RTS signal levels are set using the "0" and "1" buttons. In addition, these outputs can receive a "square" or arbitrary waveform.

The author's program of the signal generator and logic analyzer

Literature

  1. Karmyzov A. Interfaces of IBM PC. - Radio, 1996, No. 10 p. 24, 25; No. 11 p. 24-26.
  2. Frolov A. V., Frolov G. V. Programming of modems. - M.: Dialogue-MEPhI, 1993.

Author: A. Schreiber, Moscow

See other articles Section Computers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Nanorobot Generator 12.06.2007

US scientists have made a device that can power a nanorobot.

About a year ago, professor at the Georgia Institute of Technology (USA) Tsong Ling Wang proposed creating electricity generators for nanorobots using zinc oxide nanowires. This year, scientists under his leadership managed to realize the idea and make a prototype of a generator capable of delivering direct electric current. According to calculations, one cubic centimeter of such a generator can produce a huge voltage for a nanorobot - up to 4 V.

The generator is set up like this. Thousands of zinc oxide nanowires half a micron long have been grown on a gallium arsenide substrate. Between the wires and the substrate is a layer of zinc oxide - it collects electricity. And the second electrode consists of silicon oxide, on which thousands of bumps are grown, forming zigzag lines.

These tubercles are covered with platinum and are capable of conducting current. Under the action of vibration, the nanowires, firstly, generate electricity due to the piezoelectric effect, and secondly, their tips oscillate and close to the tubercles of the second electrode. This creates an electric current in the circuit.

According to the authors of the work, the generator will be useful for powering medical sensors implanted in the human body, and for autonomous sensors that monitor the state of the environment, and for hypothetical nanorobots, as well as for strengthening US defense.

Other interesting news:

▪ MSI G322CQP Concave WQHD Gaming Monitor

▪ Solar storm threatens 2012 Olympics

▪ Space water engine

▪ Capturing methane from the air with zeolites

▪ Environmentally friendly cooling agent

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Household electrical appliances. Selection of articles

▪ article Courage, courage and more courage. Popular expression

▪ article Why did people need astronomy? Detailed answer

▪ article Prickly hawthorn. Legends, cultivation, methods of application

▪ Zephyr article. Simple recipes and tips

▪ Article Curious coincidence. Focus secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024