Design of HPI Port Communication between TMS320VC5402 and Single Chip Microcomputer

This paper introduces the HPI (Host port interface) host interface principle of DSP (Digital signal processor) chip TMS 320VC5402. A simple communication program is taken as an example to explain the 16 kB dual port RAM and AT 89 C51 inside the 5402 chip through the HPI port. The communication process of the single-chip microcomputer. It adopts the mixed programming method of C language and assembly language to realize dual-port communication.

introduction

With the development of information technology, digital signal processing has been widely used in communication, voice processing, image processing, industrial control, etc. TMS 320VC5402 is a commonly used fixed-point DSP chip designed for fast implementation of various digital signal processing algorithms. Widely used in all kinds of digital signals. The chip uses an optimized Harvard architecture, 6-stage pipeline, 16 kB zero-wait dual-port SRAM on chip, enhanced 8-bit HPI interface, frequency up to 100 MHz, 3. 3 V and 1. 8 V dual power supply [1]. As a signal acquisition and processing and control display system, the traditional method is implemented by single-chip microcomputer [2], but the real-time processing function of the single-chip microcomputer is weak. The DSP chip has powerful data processing capability. However, the control display is not as flexible as the MCU. To this end, this paper uses A T89C51 microcontroller as the host, DSP as the high-speed data processor, and parallel high-speed communication with TMS 320VC 5402 through HPI. Write TMS320 C54X program and HPI interrupt program, complete The whole process of system software and hardware design, give full play to the advantages of single-chip and DSP.

1 HPI port structure and system hardware circuit design

TMS 320VC5402 Enhanced 8-Bit HPI Pin Function:

HCS: Port enable. When = 0, the HPI port is selected to allow data transmission;

HAS: address latch signal, latched on falling edge;

HBIL: Byte order indication, = 0 indicates the 1st byte of the current transmission, = 1 is the 2nd byte;

HRW: Read or write signal, = 1 indicates that the host reads data from HPI, and = 0 writes data;

HDS1, HDS2: data latch signal;

HRDY: HPI is ready, the external device reads this information. When it is 1, it indicates that the HPI is idle, and data transmission is possible. When it is 0, HPI is busy with internal operations and the data is not ready yet.

HIN T: Host interrupt, output to the host device, controlled by DSP software;

HCN TL1, HCN TL0: control signal indicating the type of data currently transmitted;

00: access the HPI control register HPIC to read or write the register;

01 : Access the HPI data register HPID, and the address register HPIA is automatically incremented or decremented by 1;

10: Access the HPI address register HPIA to read or write the register;

11: Access HPI's data register HPID has no effect on the address register HPIA;

HD0 - HD7: Data / Address Bus.

It is worth noting that the external device does not need to use all the control pins to access the HPI, especially the latch signals HAS, HDS1 and HDS2. Generally, only one is enough. The system hardware circuit design is shown in Figure 1. The role of the 16245 is bidirectional level drive conversion, which realizes the mutual drive conversion between the 5 V signal of the microcontroller and the 3. 3 V level signal of the DSP, where P1. 2 controls the direction of data transmission.

HPI interface circuit of single chip microcomputer and DSP

Figure 1 HPI interface circuit of single chip microcomputer and DSP

2 software programming

The design of HPI communication software includes two parts: DSP terminal and host terminal (AT 89 C 51). Communication is performed by the interrupt service program of both parties. The interrupt service program of the MCU receives the transmission frame of the DSP through HPI, and the format is also The relevant data is sent to the DSP through the HPI as the receiving frame of the DSP, and the interrupt is sent to the DSP through the HPI. The DSP responds to the interrupt, processes the data in the interrupt service routine, and sends the frame transmission data according to the receiving frame setting of the MCU, and sends an interrupt signal to the host. , thus achieving two - way communication function [ 3 ] .

In the software of A T89 C51, data is transmitted through the control of port P0 and port P1, data is read from the 0X0200 address of DSP, and an HPI interrupt is generated to the DSP at the same time. The process of host programming is shown in Figure 2. The main assembly language program is as follows:

HRW EQU P1. 0

HCS EQU P1. 1

HPIDIR EQU P1. 2

HCN TL0 EQU P1. 3

HCN TL1 EQU P1. 4

HDS1 EQU P1. 5

HBIL EQU P1. 6

HRDY EQU P1. 7

MAIN : JB P3. 4 , $

; HPI initialization

MOV R2 , # 08H

; HPI control register is cleared, first high, clear interrupt

MOV R3, # 08H

LCALL WHPIC; write HPIC

MOV R2, # 00H

MOV R3, # 0FFH

LCALL WHPIA; address

MOV R2, # 00H ; write initial frame header

MOV R3 , # 0AA H

LCALL LWHPID

MOV R2, # 00H ; write frame length

MOV R3, # 01H

LCALL LWHPID

MOV R2, # 00H ; write frame type

MOV R3, # 02H

LCALL LWHPID

MOV R2, # 00H ;Write DA TA[0 ]

MOV R3, # 03H

LCALL LWHPID

MOV IE, # 81H ; host interrupt allowed

MOV R2, # 04H ;DSP HPI interrupt

MOV R3, # 04H

LCALL WHPIC; write HPIC

SJMP $ ; waiting for a host interrupt to occur

Fiber Attenuator ,generating a adjustable Loss to the fiber optic link,are used to control the power level of optical signals at the outputs of light sources and electrical-to-optical (E/O) converters. Fiber Attenuators use several methods of attenuation,including air gaps, micro-bends, acoustic-optic modulators, and electro-optic modulators.The attenuation range is from 1dB to 30dB.Meanwhile,They are high attenuation accuracy and working temperature from -40 C to +75 C.Series of Fiber Optic Attenuator include Variable Optical Attenuator,Inline Optical Attenuator and Fixed Optical Attenuator.They are compatible with the fiber optic products currently available in the international market.Foclink,a reliable supplier of fiber attenuator,is always beside u 7*24.

Fiber Attenuator

Fiber Optic Attenuator,Optical Attenuator,Fiber Attenuators

Foclink Co., Ltd , http://www.scfiberpigtail.com