2. EQA Assessment Device Configuration
The Faculty of Electrical Engineering of the Maritime University in Gdynia has been conducting research for many years on the development of new methods and systems for assessing EQA. One of the components of this research was the development, production, testing and adaptation to measurement needs, as part of the project [
5,
6,
7], of a device called “estimator/analyzer” (E/A). Its measurement functions focus on determining, indicating and recording electrical energy parameters (voltage, current, power and frequency values) and EQA indicators [
8]. It also enables the recording of raw signal samples from the electrical network for further processing in an external system, e.g., a reference system using a PC (Personal Computer).
The main functional blocks of the developed device are shown in
Figure 2. Voltages from the electrical network (3- or 4-wire) and phase currents from generating sets (up to three) are fed to the input terminals of the signal conditioning circuits, from where they are transmitted to the inputs of the ADC converters. Digital words from the ADC are sent to the DSP processor, where the EQA indicator values are determined. The input circuits of voltage signals from the electrical network supply the input lines of the ADC converters. The AD7656 (Analog Devices) [
9] circuits were used as ADC converters. Data from the ADC converters can be sent via a three-line SPI (Serial Peripheral Interface) interface, synchronized with a single clock signal from the FPGA system. The FPGA system acts as an intermediary device between interface ports in different standards: ADC converters and DSP and GPP processors. The device uses a Spartan-3 XC3S1000 (Xilinx) FPGA [
10], placed together with a DSP processor in the DSM STSL start-up module (
Figure 3) [
11]. The DSP functions are implemented by the TS201 TigerSHARC (Analog Devices) [
12] system. It does not have SPI interface ports, available in both ADCs and GPPs, but can communicate via any of the four Link Ports using the LVDS (Low Voltage Differential Signaling) interface [
13,
14]. The LPC3250 processor (ARM9 family) [
15] on the phyCORE-LPC3250 (NXP) base board is used as the GPP. This processor has standard ports for peripheral devices such as an SD (Secure Digital) card reader, LCD (Liquid-Crystal Display) and interfaces: UART (Universal Asynchronous Receiver/Transmitter), SPI and I
2C (Inter-Integrated Circuit), USB (Universal Serial Bus) and Ethernet. GPP together with peripheral systems is the main element of the user interface (UI).
The configuration of the DAQ signal conditioning circuits used in the voltage channels is shown in
Figure 4. Voltage dividers (VD), which divide input voltages with the
KU factor, adjust the mains voltage level to an acceptable value in subsequent measurement channel blocks. The galvanic separation block (GS) ensures safe operation of the remaining E/A circuits. The eighth-order low-pass filter (LPF) is switched in the device between 10 and 100 kHz, depending on the current measurement function. The voltage follower (VF) provides the appropriate output resistance for this part of the measurement channel. The output signal is fed to the input of the ADC. Mains current measurements are performed with LFR 1/15 current probes (Power Electronic Measurements Ltd., Nottingham, UK) using Rogowski coils. The configuration of the DAQ circuits conditioning signals in the current channels is similar to the DAQ circuits used in the voltage channels, with the difference that there are no VD and GS blocks in the current channels. The signals from the current probes are fed directly to the inputs of the LPF blocks.
Since the amplification of signals in the GS, LFP and VF blocks is 1, the voltage at the ADC input can be described by the relationship:
where:
UIN - voltage at the device input terminals (nominal effective values 230 V or 400 V);
KU - voltage divider ratio (
KU = 0.00383 V/V for
UIN = 230 V and
KU = 0.00221 V/V for
UIN = 400 V).
The output code of the n-bit converter in the two’s complement numerical system, for the
UADC input voltage, is described by the equations:
where in the used ADC [
9]:
n = 16;
Uref = 2.5 V.
The values of the
UIN signal samples are determined in the DSP processor (
Figure 2 and
Figure 3) based on digital data sent from the ADC and using the relationships obtained from the transformation (3), (4) and (5):
The EQA indicator values, determined in the DSP according to the selected measurement function, are sent to the GPP (
Figure 2), where the user specifies how they are to be used in the form of visualization on the graphic display, recording or sending to other users. Optionally, it is also possible to send raw samples of network signals. The implementation of complex algorithms performed in real time requires the use of signal processors with appropriate properties. Signal processors are characterized by, among others, simultaneous access to instructions and data, hardware execution of signal processing operations and pipelined execution of program instructions. The ADSP TS-201 TigerSHARC processor used in the device as a DSP is a 128-bit processor, designed to perform operations on floating-point and fixed-point numbers, having, among others, dual sets of arithmetic logic units (ALU) for both types of operations, 24 Mb of internal DRAM (Distributed RAM) memory, integrated I/O systems, 14 DMA (Direct Memory Access) channels, 4 internal buses ensuring fast data exchange between memory and peripherals and other processor systems. It has four full-duplex Link Port systems that can work in parallel. These ports use LVDS interface lines in the physical layer [
13,
14], in which information (in 128-bit frames) is transmitted using a low-voltage differential signal in symmetrical lines using copper cables in a current loop configuration. The LVDS protocol in the DSP enables data transmission at up to 4 Gb/s in each port with very low power consumption. The Link Port can be configured to exchange data on one or four LVDS lines.
Figure 5 shows signals on the LVDS interface lines.
The systems with which the DSP processor communicates in the developed device are equipped with interface ports in a different standard. Both the ADC converters in the device and the GPP processor used have SPI interface ports. Additionally, communication with each of these systems is possible via parallel interface ports, however, the possibility of using this interface was omitted in the research due to the high complexity of printed circuits in the bus connections between the device systems. It was decided to use serial communication due to the fulfillment of time regimes during data exchange via them, with lower complexity of connections [
16]. SPI is a serial interface, fully bidirectional [
17,
18]. One of the devices connected by asymmetric interface lines acts as the Master system (
Figure 6), outputs the SCK (Serial Clock) clock signal and manages the SS_N (Slave Select) lines used to activate one of the Slave systems. The SPI signal lines include: SCK, MOSI (Master Out Slave In), MISO (Master In Slave Out) and SS_N lines. According to the SPI standard, data is sent simultaneously in both directions in 8-bit frames (
Figure 6), from the oldest to the youngest bit. Data transfer is synchronized with the rising or falling edge of the clock (depending on the configuration), and their setting is performed on the edge opposite to the one sending the data.
The transmission speed in SPI depends on the systems using this interface. In the case of both the ADC converter and the GPP processor in the developed device, the maximum communication speed was set at a level of several Mb/s. Communication errors occurred at higher speeds. As can be seen, this is in a large disproportion to the transmission speed via the Link Port interface in the DSP.
For data exchange between ports of different communication interfaces, the necessary conversion includes different amplitude and time parameters of the interface signals and the frame formats used in the respective interfaces. It should be noted that in communication interfaces, measurement data is not subject to any conversions in terms of their information value. The interface does not shape the course of the information processing characteristics in the measurement path, but is only a necessary technical means of ensuring the flow of information [
19,
20].
Figure 7 shows a configuration illustrating the use of FPGA systems to ensure the flow of information in the developed device [
21,
22,
23]. In the FPGA, LUT RAM (Look-Up Table RAM), DRAM (Distributed RAM) and BRAM (Block RAM) buffers are used to store data. Continuous lines indicate the directions of flow of measurement information and configuration data, while dashed lines indicate auxiliary signals ensuring the coordination of operations performed in the device.
2.1. Test Studies
During the work on the constructed device, tests were carried out using alternative sources of data transferred between SPI and Link Port interface ports. Their aim was to verify the configuration of circuits coupling interface ports in different standards and to develop a method for data conversion between the data formats used in the frames of both interfaces. The course and results of preliminary tests of data conversion in FPGA between the SPI standard and Link Port are presented in [
16,
21] and in [
24,
25,
26]. In the tests, data exchange was carried out between the Link Port of the ADSP TS-201 TigerSHARC signal processor and the SPI port of the Texas Instruments MSP430F149 microcontroller [
17], acting as a general-purpose processor GPP in the system. The ADSP TS-201 EZ-KIT Lite development kit (Analog Devices, Norwood, MA, USA) [
27], which contains two TigerSHARC signal processors, was used in the tests. The conversion between Link Port and SPI protocols was implemented in hardware, using the Xilinx Spartan 3 XCS200 FPGA [
10] in the ZL10PLD [
28] development module.
CLBs (Configurable Logic Blocks) are the basic FPGA logic configurator that can perform additional tasks, such as regular-length shift register and memory functions [
10]. IOBs (Input/Output Blocks) enable bidirectional data exchange between CLB cells and I/O lines [
10]. Each IOB block is equipped with pull-up and pull-down resistors that can be activated at will. This allows the use of different signal standards, e.g., LVDCI_15, LVDCI_25, GTP_DCI, HSTL_I_DCI, LVDS_25_DCI or SSTL18_I_DCI [
16]. The idea of data conversion between interface standards implemented in the FPGA in the test system is shown in
Figure 8. A single Link Port frame consists of 16 SPI frames. The example data contained in one Link Port frame (128 b) and the same data distributed in SPI frames (8 b) are symbolically presented.
The design and simulation of the operations of the designed circuits were carried out in the Xilinx ISE WebPack programming environment, which allows the creation of an FPGA configuration program, among others, in the VHDL language.
Figure 9 shows a schematic configuration of the FPGA circuit implementing data conversion between the TigerSHARC Link Port and the SPI port of the GPP processor (MSP430F149 Texas Instruments). With clock signal frequencies differing by several orders of magnitude and different frame lengths in both standards, the conversion circuit is “transparent” for data, i.e., data transfer between ports takes place without interfering with their content [
16]. The transmission between TigerSHARC and GPP is initiated after the FPGA sets the signal on the ACK line, after which TigerSHARC issues the
rx_clk clock (125 MHz) and sends the
rx_data data. The data is sent on both edges of the clock signal, from the least to the most significant bit in the frame (0 to 127). In the SPI interface, the GPP processor is configured as Master, so it issues the
clk_spi clock (800 kHz) and initiates transmission in both directions. Data is received and sent at the same time in both devices. In both GPP and FPGA, data is set on the rising edge of the
clk_spi clock, and is read on the falling edge. Data is transmitted in 8-bit frames from the oldest to the youngest bit (from 7 to 0). Data sent on the
rx_data line from the Link Port is written to the BRAM at the
rx_clk clock. This signal is also controlled by the address counter, which controls the order of data writing. Data on the MISO line is output from BRAM to GPP under the control of the
clk_spi clock and with the participation of the address counter. The next Link Port frame can be received after data is output from BRAM to the GPP SPI port (
ACK ready signal from FPGA to Link Port)).
Communication between the GPP microcontroller and the TigerSHARC microprocessor begins with sending data to the MOSI line from the GPP SPI port to BRAM at the clk_spi clock. This data is written to BRAM in a similar way to communication in the reverse direction, under the control of the appropriate address counter. Sending tx_data data from BRAM to Link Port is synchronized with the tx_clk and tx_clk270 (100 MHz) clock signals. They are generated in the DCM (Digital Clock Manager) block by multiplying the frequency and appropriately shifting the phase of the 50 MHz clock signal clk generated in the FPGA. Transmission is started after the frame is completed, on the ACK signal from the Link Port.
The problem of a different order of data sent by the Link Port (from the least to the most significant bit in 128-bit frames) than the order of sending data from the SPI port (from the most to the least significant bit in 8-bit frames) was solved by changing the order of their reading from the BRAM. In both communication directions, data is read in the reverse order to the order of their writing.
In addition to tests of basic functional components consisting in observing internal signals output to the FPGA output lines, the following were carried out:
testing the correctness of duplicating the frequency of clock signals and shifting them in phase in the DCM block,
testing the correctness of BRAM addressing for both directions of transmission controlled by the clk, rx_clk and clk_spi clocks,
checking the correctness of data sent to BRAM from TigerSHARC and from the SPI port,
testing the transfer of data emulated in BRAM to TigerSHARC and to the SPI port.
The results of the tests were used in the configuration of the developed device for testing EQA. It should be noted that the operations performed in the interfaces using FPGA in the developed device differ fundamentally from the operations in the test system.
2.2. Data Transfer in the Developed Device
The developed device uses the AD7656 circuits from Analog Devices [
9] as ADC converters. Their inputs are supplied with signals from voltage followers (
Figure 4). A single AD7656 circuit (
Figure 10) contains six 16-bit ADC converters, controlled by pairs (CONVST A-B-C) and storing the processing results in three registers assigned to each pair. Digital data can be output from the system via a 16-bit parallel port DATA/CONTROL LINES (under the control of additional lines and ) or via three serial interface lines, modeled on the SPI standard (DOUT A-B-C), controlled by an external clock signal SCLK. The conversion time of the analog signal sample to digital form in each converter is constant and equal to 3 µs. The end of the processing cycle is signaled on the BUSY line and then it is possible to start outputting ready data. In the measurements of the line voltages, when the antialiasing filter frequency is set to
fLPF = 100 kHz, the ADC channels V1, V3 and V5 are used. The set of data in the output buffers is shown in
Figure 11. With this selection of the ADC channels of the AD7656, only 16 SCLK cycles are necessary to output the buffer contents using three SPI lines, which takes about 0.94 µs (
Figure 11). This solution allows processing of instantaneous values of ADC input signals at a speed of up to about 250 kS/s in each of the three channels.
From the point of view of ADC processing, the device realizes two operating options:
sampling of line voltages at a speed of 210 kS/s in three voltage channels,
sampling of three voltages and six currents at a speed of 25 kS/s in nine ADC channels.
In the second case, six channels of the second AD7656 circuit are additionally used.
Figure 12 shows the operations performed during the recording of raw voltage samples from the power system. The ADC converters’ work cycle (start: signal from FPGA on CONVST A-B-C lines) includes parallel processing of three voltage samples, placing the results in output buffers and sending them via SPI to the FPGA. ADC-FPGA communication is performed on slightly different principles than in the previously shown test system. The serial interface used in the ADC system is a modified version of the original standard. The Master system functions are performed by an external system and only the MISO lines are used, three interface lines controlled by a common clock signal. The SCLK clock signal is generated in the FPGA. The next ADC work cycle starts according to the set processing frequency (only voltage measurements with speed
fADC = 210 kS/s or voltage and current measurements with speed
fADC = 25 kS/s), asynchronously to further operations on digital representations of the processed signals and sent to buffers in the FPGA and then to the DSP.
The Spartan-3 XC3S1000 (Xilinx) [
10] FPGA plays an important role in the measurement chain of the device, enabling connections between the main functional blocks. The IOB lines between the ADC and the FPGA are configured as single-ended 3.3 V SPI lines. Data from the ADC is delivered to the DSP via a 4-line Link Port (LVDS) interface between the FPGA and the DSP, where the IOB lines are configured as symmetrical lines (
Figure 5). For data exchange between the DSP and the GPP, the 1-wire Link Port lines connecting the DSP to the FPGA are also configured as symmetrical lines. The lines connecting the FPGA to the GPP were configured as unbalanced in the 2.5 V voltage standard.
To maintain data flow between different interfaces, the FPGA must convert between the functions (protocols) implemented in their data link layers and change the formats of frames transmitted on these interfaces [
29,
30,
31,
32,
33,
34].
Inside each configurable logical CLB in the FPGA there is a LUT (Look-Up Table) element. It is usually used to implement logical functions, but it can be reconfigured as a random access memory RAM cell that can store 16 bits of data. These elements can be combined into a larger RAM, called distributed RAM - DRAM. Another type of memory available in FPGA is BRAM. It is a dedicated dual-port memory containing several kilobytes of RAM. A typical FPGA contains at least several such blocks. Both single-port and dual-port BRAM modules can be used. In two-port BRAM modules, both ports can be controlled by clocks with different frequencies. In the case of using selected ADC, DSP and GPP circuits as the main functional blocks, the FPGA implementation was crucial for the successful implementation of the developed measuring device [
19].
The LPC3250 circuit, as a GPP processor, normally supervises the operation of peripherals in the user interface circuit and enables data exchange with the DSP via FPGA, using the SPI interface, the port of which in GPP acts as the Master device.
The following section presents the operations carried out in FPGA for the option of measuring three voltages in the power network at a speed of fADC = 210 kS/s (ADC processing cycle every tADC = 4.76 µs) due to the critical time relations between the operations for this option in relation to the option of measurements in nine ADC channels (ADC cycle every tADC = 40 µs). For both options, data from the current cycle is processed in the DSP in real time, during the next ADC processing cycle.
For each ADC cycle, data is transferred via three SPI lines to three LUT RAM buffers in the FPGA. In the next step, data is rewritten from the LUT RAM to the DRAM memory in the FPGA, and then to the DSP processor using 4 lines in the LVDS standard (
Figure 13). Data sent to the DSP is contained in 128-bit frames, so the data from the LUT RAM must be reformatted and placed in another part of the FPGA.
The operation of transferring data from the LUT RAM to the DRAM memory is controlled by two synchronized clocks (
Figure 13). The first one,
clkL, controls the output of data from the LUT RAM memory, while the second one,
clkD, manages the writing of individual bits to the DRAM P and DRAM N memory blocks. The
clkL frequency is twice as high as the
clkD frequency. The input to DRAM P is controlled by the rising edge of
clkD, while the write to DRAM N is performed on the falling edge of
clkD. The capacity of each DRAM is 64 bits. Each digital representation of the set of analog samples is sent separately to the DSP processor, so the contents of the LUT RAM are transferred to the set of DRAM blocks while changing the data layout. Data is output from the registers in the following sequence: first from LUT A, then from LUT C, and finally from LUT B. The order of bits in the ADC and LUT RAM buffers is shown in
Figure 14.
Figure 15 shows the layout of data bits in the DRAM registers. The data representing the samples from the ADC cycle, with a volume of 2x24 bits, is sorted so that it is ready for transmission to the DSP via a 4-wire LVDS interface.
The IOB elements at the multiplexer output form a 4-line LVDS port. Each line consists of two differential lines (marked in
Figure 15 as “+” and “-”), the first of which transmits a signal corresponding to the value of a given bit, and the second to the negated value of this bit. In the DSP processor memory, data is collected in the form of 4 kB blocks, of which 3.06 kB is occupied by sample data. In addition to the data from ADC processing, additional information data is recorded there. After collecting 510 frames containing data sets from subsequent ADC cycles in the DSP memory, a 4 kB data block is sent to the GPP processor (
Figure 12). In the first phase, the 4 kB data block is sent to the FPGA using a single-line LVDS interface, and then from the FPGA to the GPP, data is sent via a standard SPI interface, managed by GPP with the Linux operating system. Data reception begins after detecting an edge on the SYNC line, which signals the end of data buffering from the DSP. This line ensures coordination of communication via the SPI port between the FPGA and GPP. In the original concept of the device, this coordination was performed by software: reading data from the FPGA via SPI to the GPP was initiated by a timer in the GPP. Following an interrupt, generated in the GPP approximately every 200 ms, a 4 kB data block was initiated from the FPGA to the GPP via SPI. However, transmission operations from the DSP to the FPGA and further from the FPGA to the GPP are mutually asynchronous processes. As a result, during data reading from the FPGA to the GPP, the data in the FPGA could be overwritten by data contained in subsequent frames from the DSP. The introduction of hardware coordination (SYNC line) and abandoning software coordination in the GPP eliminated the possibility of such an event occurring. Data received in GPP are then saved in the flash drive memory via USB port, under the control of software included in the Linux kernel [
21].
Figure 16 shows the sequence of data output from buffers in the ADC to LUT RAM buffers in the FPGA and their conversion in the FPGA and transmission to the DSP [
19,
21,
24,
25,
26]. It illustrates the time relations between the processes carried out in the developed device, starting from analog signal conversion to digital form in the ADC converter (at a speed of 210 kS/s) to data recording in 4 kB frames in the SRAM memory of the DSP processor. As mentioned earlier, the time of analog signal conversion to digital form in the ADC converter is constant and equal to
tCONV = 3 μs. The
ttr time, i.e., the time of data transfer to buffers in the FPGA via SPI from three ADC channels, depends on the clock frequency synchronizing the data reading from the ADC via SPI. In the device conditions, it is 943 ns. The
tACQ data acquisition time in FPGA consists of processing the instantaneous signal values into digital form and sending the processing results to FPGA [
19,
21]:
During the next processing cycle in the ADC converter (
tCONV = 3 µs), data is rewritten from the LUT RAM buffers in the FPGA to a pair of DRAM buffers in this system. Transferring 46 bits of data (data from one ADC cycle) requires a
tRAM time of less than 300 ns. The data from a single ADC cycle (total: 16-bit data from three ADC channels (48 b)), which make up the content of the Link Port frame, is placed in a pair of DRAM buffers. The data block is sent from the DRAM memory using the LVDS protocol to the DSP processor. In this operation, data in a 128-bit frame, divided between four LVDS interface lines, is transmitted at a rate of 200 Mb/s. The
tRAM-DSP time required to transfer one frame is:
where:
lp – number of bits transmitted in a single LVDS line (
lp =32 b),
vs – bit transfer rate in a frame from FPGA to DSP (
vs =200 Mb/s). In the DSP processor memory, 510 data frames from LVDS are collected, where each 128-bit frame contains 48 b of 16-bit data from three ADC channels. In the DSP, a block of 3.06 kB of data from the ADC is created from the received frames, and with additional information - a block of 4 kB of data. These frames are collected in the DSP processor memory during
tBUF (10):
where:
nr – number of frames recorded in the DSP processor (
nr = 510),
tADC – time step of sampling (corresponds to the ADC processing frequency
fADC=210 kS/s)).
Figure 17 shows the time relations between the operations of transferring a block of data stored in the DSP processor memory to the flash drive portable memory. Data transmission begins after buffering 4 kB of data in the DSP and proceeds in the buffering cycle of subsequent 4 kB blocks of data in the DSP.
Through the 1-line Link Port interface, controlled by the clock signal from the FPGA (clock from the DSP,
f = 125 MHz), 4 kB data are sent from the DSP processor to the FPGA in frames containing
lp=128 bits at a speed of
vs = 250 Mb/s. A single frame is sent in time
tD-F1:
To send a 4 kB block in 250 128-bit frames, the following time is necessary:
where:
nr – number of frames sent from the DSP to the FPGA (
nr=250).
After receiving a 4 kB data block in the FPGA, a signal is set on the SYNC line, which is used to synchronize data reception in GPP. Data transfer is performed under the supervision of the software in GPP, which initiates the clock signal
fSPI = 16 MHz, controlling the transmission to GPP via a standard bidirectional SPI port. The transmission time of a single 8-bit frame can be expressed by the Formula (13):
where:
lb – number of bits in the frame (8 b),
vb – transmission speed (16 Mb/s).
The time of sending a block of 4 kB of data in
nr=500 frames is:
The block of received data is buffered in the GPP memory and then written to the flash drive portable memory using USB port drivers in the Linux environment. The results of the study of writing to the USB port medium indicated the need to buffer larger memory blocks in GPP before writing them to the USB, especially for raw data, delivered in 4 kB blocks every approx. 2.43 ms (
tBUF). This allows for increasing the time interval between writing sessions. The time interval when sending EQA indicator values is approx. 200 ms.
Table 1 shows the percentage of erroneous frames saved in the flash drive memory, in relation to all frames sent from the DSP, for different time intervals between transmission from the DSP to the GPP of successive 4 kB frames. It follows that the recording sessions should take place no more often than every
tUSB=18 ms. This corresponds to a block of data stored in the GPP with a volume of approx. 30 kB.
The transfer of EQA values determined in the DSP to GPP is performed using the same FPGA configurations and data transfer algorithms used to transfer the raw data to GPP. EQA indicators are determined for 200-millisecond time windows, and in such a cycle the data is sent by FPGA to GPP [
19,
21].
2.3. Coordination of Operations in the Device
In order to clearly present the issues discussed in this part of the self-report, in relation to the coordination/synchronization operation in the functioning of the device, the conceptual apparatus was adopted in accordance with the definition [
35], where the concept of coordination means “the efficient course or functioning of something”, and synchronization is “coordination in time of at least two phenomena”. Therefore, synchronization is a special case of coordination of operations.
In measurement and control systems, the transmission of digital data between devices, as well as between functional blocks of a digital device, is usually carried out using standard digital interfaces. Unlike analog interfaces, in digital interfaces, data can be saved before sending and thus restored in the event of their loss during transmission to the receiver. Currently, serial interfaces are of particular importance, and this technology is developing dynamically.
Electrical signals propagate in a copper cable at a speed of about 2∙108 m/s, which means that the signal sent from the transmitter appears in the receiver 100 m away after a time of about 0.5 µs. Signals carrying data in a digital interface are subject to distortion due to the limited bandwidth of the communication channel, as well as attenuation, also dependent on distance. Additionally, the operation of interface ports is controlled by local clock signal generators with limited stability of their frequency. These factors mean that in digital interfaces, special attention is paid to synchronization in data exchange processes. This applies to both interfaces operating in asynchronous and synchronous modes. The basic difference between them is that in asynchronous mode, the receiver clock is synchronized once on the edge of the signal carrying the data frame and then autonomously controls the decoding of subsequent bits in the frame, while in synchronous mode, the receiver clock is synchronized with the transmitted transmitter clock throughout the transmission of the data frame.
The process of synchronizing digital data transmission usually takes place in several stages [
19]:
bit synchronization (implemented in the physical layer of the interface),
frame synchronization (data link layer),
information synchronization (application layer).
Bit synchronization enables correct decoding of subsequent bits of the frame by identifying them in the signal at the correct time. In asynchronous interfaces, receiver clock synchronization is achieved on the edge of the received signal carrying the start bit. The receiver clock is previously set to the same frequency as the transmitter clock. In the receiver, after detecting the edge, the receiver clock phase is appropriately adjusted, and then the receiver clock signal becomes a reference for determining the time moments at which decoding of subsequent bits from the signal carrying them takes place, in relatively short frames transmitted asynchronously. The limited frame length results from the limited stability of the receiver clock frequency in relation to the transmitter clock frequency.
The receiver clock in the synchronous interface is continuously synchronized with the transmitter clock. Although the source of transmission synchronization is usually the transmitter’s clock, in short-range interfaces (when the signal delays in the interface lines are negligible in relation to the clock signal period), e.g., in SPI, synchronization can be performed using any of the clocks of the communicating devices. In long-range interfaces, the source of the synchronization signal is usually the transmitter’s clock (the delay in the data lines is similar to the delay of the clock signal). The clock signal can be transmitted on a line independent of the data lines or on a common line together with the data, using a selected so-called self-synchronizing code. A data sequence encoded in this way contains information that allows the extraction of a clock signal (from the transmitter) for synchronization of the receiver’s clock.
Frame synchronization is necessary to correctly recognize the beginning, end and remaining fields of the frame based on a continuous sequence of bits transmitted on a clock-synchronized signal and is performed after bit synchronization and error-free decoding of individual bits (a bit synchronization error, including e.g., loss of a data bit, causes a frame synchronization error). Frame synchronization for a given communication standard is performed by referring the stream of reconstructed bits to a reference frame, which allows for the identification of the preamble contained in the introductory part (a characteristic sequence of characters that will most likely not appear in the rest of the frame) in synchronous transmission or only the start bit in an asynchronous transmission frame and subsequent fields of the frame, including the user data field.
Information synchronization is based on time coordination and purposeful and proper use of user data transmitted in subsequent frames, in a manner corresponding to the functions performed in the system. This involves combining data sent in multiple frames and, in some cases, the need to organize their order.
The problem of coordinating operations in the measurement chain does not, however, apply exclusively to the interfaces used. Transferring data between functional blocks is one of the operations in the measurement chain. Another problem is the mutual cooperation of blocks and operations that create the measurement channel.
Figure 18.a shows a measurement chain in which individual operations (or part of them) are coordinated by a dedicated, central control unit CCU (Central Control Unit). This unit, based on information about the status of individual operations, manages the work of individual blocks of the measurement chain and coordinates their cooperation.
Figure 18.b illustrates the case of measurement paths with distributed coordination, in which the interaction between different functional blocks is based on the mutual coordination of independently performed operations and coordination of directly exchanged information between blocks. There is no superior unit coordinating the exchange of data between cascaded functional blocks. This type of process coordination is most commonly used in measurement paths, where the continuity and smoothness of information stream processing and its recording are important. After processing data in a selected functional block of the device, the start of data transfer to the next functional block must be coordinated between these blocks. Coordination can be carried out programmatically, using software running in the selected block (often under the control of time systems), or hardware, based on the state of operations or systems. Coordination of operations in the exchange of information between the functional blocks of the developed device consists in ensuring smooth data transmission between ADC and GPP and managing them in the UI data recording and indication system (
Figure 7).
Figure 19 shows the basic blocks of the device along with the times of execution of individual operations [
19].
The coordination of operations in individual blocks of the measurement chain consists in the fact that in order to maintain the smoothness and consistency of the information flow, the condition relating to the relationship between the times of execution of the relevant operations must be met: the time of execution of specific operations is critical and cannot exceed the time of execution of other operations.
The first limitation concerns the time interval
tADC between analog signal samples at the ADC input in relation to the minimum acquisition time
tACQ (8), i.e.,
tADC ≥
tACQ, which can be written as:
Fulfilling this condition enables correct transfer of digital data from the ADC to the LUT RAM buffer in the FPGA. Before the next processing cycle is completed, i.e., in the next
tADC time segment, the data must be transferred from the LUT RAM input buffers to the DRAM in the FPGA and then transferred to the DSP using 4-line LVDS before the next portion of data from the LUT RAM, so the following condition must be met:
The data is buffered in the DSP during
tBUF. They must then be sent to BRAM (buf-RAM 2) in the FPGA via 1-line LVDS before the DSP collects another 4kB buffer of data provided by 4-line LVDS and then sends from buf-RAM2 to GPP via SPI:
However, this requires the use of two independent 4kB buffers in the DSP to avoid overwriting subsequent data transferred from the ADC at tADC=4.76 µs before sending it to the GPP. Data in GPP is collected, as it arrives via SPI, in blocks of at least 30 kB, ensuring their error-free recording via the USB port, with an appropriate time interval between subsequent recording sessions. This does not interfere with the smoothness of other operations in the device.