Abstract: High-speed data communication between DSP and PC is an important application of DSP. This article analyzes the principle of high-speed data exchange between the parallel port in EPP mode and ADSP21060, and discusses in detail the structure diagram of its hardware design and its corresponding parallel port programming.
Keywords: computer parallel port EPP DSP FIFO
With the advancement of technology and the increase of a large number of peripherals, the computer parallel port is not only required to connect to the printer, but also to other peripherals, and is required to be able to transmit data in both directions. High-speed peripherals also require high-speed data transmission, such as DPS. Today, with the rapid development of science and technology, the processing power and speed of DSP are also rapidly improving, and it is widely used in electronic fields such as scientific research, military and communications. In these applications, high-speed data transmission with the PC is inevitable. The traditional transmission mode of computer parallel port is SPP (standard parallel port). The data transmission direction is from the computer to the peripheral device. Data can only be output, not input. This limits the application of parallel port high-speed data communication. So we designed a solution to realize high-speed data transmission between DSP and PC in EPP mode.
Implement data transmission in EPP mode
The EPP protocol is a protocol that is compatible with the standard parallel port and can complete two-way data transmission. The parallel port defined by this protocol is more like an open bus, providing users with powerful functions and flexible design means.
It has four data transmission cycles: data write cycle; data read cycle; address write cycle; address read cycle. The data cycle is used to transmit data between the host and peripherals, and the address cycle is generally used to transmit address, channel, command and control signals. This causes the cycle to be viewed as two different data cycles.
One of the most important features of the EPP mode is that the entire data transfer process occurs within an ISAI/O cycle. In other words, using the EPP protocol to transmit data, the system can obtain a transmission rate of 500K-2M bytes/second, that is, the parallel port peripherals have performance close to that of the ISA bus plug-in board. Using an interlocked handshake signal, data transmission is determined by the slowest device in the interface, which can be either a host or a peripheral. This "rate adaptability" is transparent to both the host and the peripheral. All parallel port transmission methods utilize interlocking handshake signals. In this way, the peripheral device can control the settling time required for its own operation. At the same time, because the process of data transmission in EPP mode is simple and easy to implement, we decided to use the bidirectional parallel port EPP transmission mode to achieve high-speed data transmission.
When the parallel port transmits data to the DSP chip ADSP21060 of Analog Devices, a byte of data is latched through the data latch, and then an interrupt signal is given to the ADSP21060 to read the data; similarly, when the ADSP21060 transmits data to the parallel port, it first Let the latch lock the data, and then give the parallel port an interrupt to read the data. This completes the two-way communication of data. However, using this method, no matter which direction the data is transmitted, only one byte can be transmitted and an interrupt will be caused, which will then be read by the PC or ADSP21060, and then the next byte will be transmitted, which takes up a lot of CPU time. time, reducing the efficiency of the CPU. For this reason, we use two FIFOs to improve the efficiency of the CPU.
High-speed data transmission based on FIFO in EPP mode
The principle block diagram of high-speed data communication based on FIFO in EPP mode is shown in Figure 1.
Its communication process is: when the parallel port transmits data to ADSP21060, the parallel port first resets the output FIFO, then writes the data to be transmitted in batches to this FIFO and then gives an interrupt signal to ADSP21060 to notify it to read data from the output FIFO. ;
When the ADSP21060 transmits data to the parallel port, it first resets the input FIFO, and then writes the data to be transmitted into the FIFO in batches and then gives an interrupt signal to the computer parallel port to notify it to read the data from the input FIFO, thus completing the data processing. Two-way communication.
This design has the advantage of transmitting data in blocks, and at the same time, it takes up very little time on the parallel port and ADSP21060 when transmitting large amounts of data.
The main logical relationships in the figure are as follows:
Output FIFO read (AR) = RD and A0 and A1 and MS01;
Output FIFO write (PW) = nWrite or nDstrb;
Input FIFO read (PR) = not (nWrite) or nDstrb;
Input FIFO write (AW) = WR and A0 and A1 and MS01.
In this circuit design, there are two issues worth noting:
(1) The nWait signal needs to be generated through the logical relationship between nDstrb and nAstrb. The logical relationship is: nWait=not (nDstrb and nAstrb).
(2) Since EPP and SPP are compatible, in EPP mode, the bits corresponding to nWrite and nDstrb format nAstrb in the parallel port command word need to be set to invalid.
Computer EPP parallel port programming
The electrically programmable logic device (EPLD) we chose is Altera's EPM7128. For a detailed introduction, please refer to Altera's device manual. Here we only give the control program written in AHDL language as follows:
FIFO memory clearing subroutine, send a clearing pulse to FIFO: void fifo_rst(void); set command word subroutine: void command(void); write data to FIFO subroutine: void data_out (void); read data from FIFO Subroutine: void data_in(void);
Before accessing the EPP register, the software must write zeros to bits 0, 1, and 3 of the control register; when writing data, write the number of data in the pointer ptr into the output FIFO memory through the data port, and then cause the ADSP21060 interrupt; when reading data Read number from the input FIFO memory through the data terminal and then read the data into the pointer ptr.
#define BASE_ADDR 0X378
#define ADDR_PORT 3
#define DATA_PORT 4
#define CONTROL_PORT 2
#define CONTROL_ININT 2
#define SET_BIT(x,b) ((x)=(1<<(b)))
#define CLEAR_BIT(x,b) ((x)&=~(1<<(b)))
void fifo_rst()
{
char control;
vontrol=inportb(BASE_ADDR+CONTROL_PORT);
CLEAR_BIT(control,CONTROL_ININT);
outportb (BASE_ADDR+CONTROL_PORT,control);
SET_BIT(control,CONTROL_ININT);
outportb (BASE_ADDR+CONTROL_PORT,control);
}
void command(void)
{
int com;
com=0;
control=inportb(BASE_ADDR+CONTROL_PORT);
control=control & oxf4;
outportb(BASE_ADDR+CONTROL_PORT,control);
}
void data_out(int number,char *ptr)
{
int i;
fifo_rst();
for(i=0;i outportb(BASE_ADDR+ADDR_PORT,0); } void data_in(int number,char *ptr) { int i; for(i=0;i } in conclusion This article gives an implementation plan for high-speed data communication using FIFO and ADSP21060 in EPP mode. This circuit can complete high-speed data transmission between the ADSP21060 and the computer parallel port, and takes up very little time on the ADSP21060 and the computer. In addition, the subroutines compiled in this article have reference value for other circuits that perform high-speed data communication with PCs. Debugging proves that this solution is feasible.
Previous article:Development of ARINC429 communication board based on DSP
Next article:Application of DSP in mobile communications
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Raspberry Pi Foundation Launches $4 Raspberry Pi Pico with MicroPython Support
- EEWORLD University ---- Overcurrent Sensing Technology
- [Zero-knowledge ESP8266 tutorial] Quick Start 23 Applying OLED
- SIMterix-Simplies~3~ Verilog-A
- C2000 Power-on Boot Mode Analysis
- DSP28335—CMD file interpretation
- Recommended introductory video tutorials and books on microcontroller programming, teaching you to learn microcontrollers from scratch.
- DSP timer and interrupt system realizes variable frequency flashing of LED lights
- STM32F103VE DAC+DMA+TIM, channel 1, no signal output
- Show off the Jingdong E-card exchanged with E-coin