【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.
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
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- Solution to blind area communication of intercom
- Xunwei i.MX8MM Development Board Linux Android 9.0 Crotex-M4 Data Update
- Commonly used algorithms for drones - Kalman filter (Part 3)
- GigaDevice has also entered the wireless field and released its first GD32W515 series Wi-Fi MCU. Do you want to try it?
- Which MSP430 is right for your LCD application?
- Power supply quality resource sharing, free points download this week
- Power amplifier circuit
- [NXP Rapid IoT Review] + Mobile Synchronizer 6
- Solution to the problem that the TI 280049 LaunchPad emulator cannot connect
- Voiceprint collection system based on Pingtouge RVB2601