Design of Asynchronous Serial Communication between TMS320C3x DSP and PC

Publisher:沈阳阿荣Latest update time:2012-02-11 Source: elecfansKeywords:TMS320C3x Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

【Abstract】Based on a brief introduction to the TMS320C3x series chips, this paper mainly introduces the software and hardware solutions for asynchronous serial communication between DSP and host PC in digital signal processing systems.
Keywords: TMS320C3x Asynchronous serial communication MSComm control

1 Introduction
TMS320C3x DSP is one of the most widely used DSP chips in China. It provides a serial interface that can communicate with external serial devices, supports 8/16/24/32-bit data exchange, and provides great flexibility for designing A/D and D/A interface circuits. However, when the DSP system communicates with the PC, how to design a reasonable interface circuit and communication software to transmit the data processed by the DSP to the PC in real time and accurately, and at the same time enable the PC to effectively control the DSP in real time, has become an important part of the DSP system design. This paper adopts asynchronous serial communication (Universal Asychronous Receiverand Transmitter, UART) to better solve the problem of communication between DSP and PC.

2 Introduction to TMS320C3x TMS320C3x
(hereinafter referred to as C3x) is the third generation product produced by TI (Texas Instruments) and the first generation of floating-point DSP chips. It includes C30, C31, C32 and C33. It is a floating-point DSP chip with relatively high performance and price in the TMS320 series. It has 32-bit floating-point precision and a total of three buses, namely program bus, data bus and DMA bus. Instruction fetching, data reading and writing, and DMA operations can be performed in parallel, and 16M words of space can be addressed. Among them, C31 is a simplified and improved version of C30. It removes the expansion bus and a serial port, reducing the cost of the chip, and adds a very useful function in hardware, namely the program boot function (Bootloader), so that the program can be loaded from the low-speed EPROM, PROM or serial port into the system's high-speed RAM and run at full speed. C32 and C33 are further simplified and improved versions of C31. Among them, the on-chip RAM of C32 is reduced to 512 words to reduce costs. The C33 chip has 34K on-chip RAM and requires a 3.3V power supply.


3 DSP system structure block diagram
Figure 1 is the hardware block diagram of the entire DSP system. Among them, TLC32044 is a type of TLC32040 series of voice-band analog-to-digital interface chips (AICs) produced by TI. It integrates A/D and D/A, has two analog input ports and one analog output port, and has a maximum sampling frequency of 19.2kHz. MC6850 is an asynchronous serial interface chip (UART) produced by Motorola. It can send and receive 8-bit or 9-bit data, and can select three different clock modes: ÷1, ÷16, and ÷64. DSP sets the asynchronous communication protocol by initializing the control register of MC6850, and then MC6850 performs parallel-to-serial conversion on the parallel data of DSP and the serial data of PC according to the protocol. MAX232 chip performs conversion between TTL level and RS-232 level. The external signal enters DSP through A/D conversion, and after being processed by DSP, it is sent to PC through UART, and the PC processes and stores the data. At the same time, the PC sends the control signal or the data to be sent to the DSP via UART, controls the DSP or sends it to the D/A after being processed by the DSP, and restores it to an analog signal after low-pass filtering.


4 DSP system communication software
During transmission, both sending and receiving parties should initialize according to the common protocol. The communication protocol adopts a start-stop asynchronous communication protocol. The following are the source code for the DSP to MC6850 and the upper PC software to initialize the serial port.

[page]
4.1 MC6850 asynchronous serial communication program design
After power-on, 6850 is in a locked state to avoid outputting erroneous transmissions. Before use, the control register CR0 and CR1 must be set to "1" through the program to perform a master reset to release it from the locked state. Then the control register can be programmed to determine the clock division, data format, and transmission and reception control functions of 6850. The following is a program for initializing and sending data for 6850 in C language under the Code Composer integrated development environment. 4.2 PC communication program design In the VC++6.0 environment, there are two common methods for using PC for serial communication: (1) calling Windows API (Application Program Interface) functions; (2) using ActiveX's MSComm control. The first method requires declaring and calling many API functions, which is very cumbersome. Therefore, this article adopts the second method. The specific implementation process of PC communication is as follows: Step 1, start VC++6.0 and create a dialog-based application TxRx. The second step is to insert the serial port control in the dialog box, add new static text, edit box and button controls, and add corresponding variables to them. Its properties are as follows: The third step is to add relevant program code in the TxRxDlg.cpp file. First, add the global variable description in the first comment line of the file header. Secondly, the serial port parameters need to be initialized. Add the following code after the TODO statement in the OnInitiDialog() function: //Pre-read the buffer to clear the residual data Next, add the message processing function OnTransmitt() for the send button IDC-TRSMITT. The content is as follows: The following example illustrates how to send a frame of data in the Transmitt() function. UpdateData(FALSE); //Update the dialog box 5 Conclusion The above is the software and hardware solution for asynchronous serial communication between DSP and PC. At present, this solution has been applied to the data transmission system of short-wave communication intelligent terminal. It runs stably and has good communication performance, which solves the communication problem between DSP and PC well.





















Keywords:TMS320C3x Reference address:Design of Asynchronous Serial Communication between TMS320C3x DSP and PC

Previous article:Design of Interface between High-speed DSP and Serial A/D Converter TLC2558
Next article:Design of wireless LAN based on spread spectrum communication technology

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号