1 Design Idea
This system is a platform for teaching, course experiments and technology development, mainly used in experimental teaching of DSP principles and applications, digital signal processing and other related courses. It is an expansion of the system with DSP56311EVM as the core, including software and hardware. The software part uses C++Builder to create the platform environment of "DSP56311 Experimental Platform", and the DSP hardware driver written in assembly language can be called by C language; the hardware part effectively utilizes the resources of the chip, enhances the functions used in teaching, and leaves an interface for further expansion.
2 System Structure
2.1 Hardware Part
The core of the hardware platform is the DSP56311 evaluation board provided by Motorola. The DSP56311EVM can be connected to 24 data lines, 18 address lines and 4 address characteristic status lines, providing an interface for expandable resources; but these interfaces cannot be directly connected to external devices and need to be expanded accordingly. The external circuit of the hardware platform includes: ±5V, ±15V, +6V DC power supply, sine wave, triangle wave, square wave waveform generation circuit module, MIC signal amplification circuit, LCD display module, etc.
Figure 1 shows the internal structure of the system hardware platform. The left side of the figure shows the external circuit module and the right side shows the DSP563llEVM evaluation board. These circuit modules can generate the signals required for experimental testing and reflect the program execution status, providing a convenient hardware environment for DSP program development and debugging.
Problems solved by the hardware part:
① The port of DSP can be used as a general input/output port (GPI0) or a dedicated port through register settings. There are multiple implementation schemes when connecting external circuits to DSP. In the case of tight resources, resources can be allocated to achieve the best.
② Timing problem. The processing speed of DSP563ll is as high as 150 MIPS, and 1 instruction cycle is about 7ns. Solve the timing problem and speed up the working speed of the peripheral interface chip. Compared with DSP, LCD is an external device with very slow "response". This project uses a timer module (time interrupt) to control the refresh frequency of LCD dynamic graphics display. For example, if the refresh frequency of LCD is set to 2 frames/s, the data of 1 screen of graphics is transmitted to LCD every 0.5s. In addition, the implementation of the communication interface between DSP and LCD is to program the GPIO of DSP so that the signal of GPIO pin meets the timing requirements of LCD data transmission. Since the working frequency of DSP is very high, the data transmission between DSP and LCD should not only pay attention to the level and sequence of the control pin, but also insert the necessary waiting time to maintain the level on the signal line so that LCD can reliably read the signal on the control pin.
Figure 2 is a block diagram of the system hardware.
2.2 Software
The software is divided into two parts: DSP56311 software experimental platform made with C++Builder; DSP hardware driver written in assembly language.
2.2.1 DSP56311 experimental platform
Figure 3 shows the interface of DSP56311 experimental platform. The packaged platform can be installed on a personal computer at will. The platform includes experimental instructions, program compilation, program compilation, reference results, experience experiments, etc. This platform can be used as experimental guidance software, or as development software to directly write programs, compile and simulate on the platform. [page]
2.2.2 Mixed programming of C language and assembly language
This design uses assembly language to write drivers for DSP peripherals and some subroutines for digital signal processing algorithms. The main control program is written in C language, and the subroutines written in assembly language are called to complete hardware operations and signal processing.
(1) Insertion-type mixed programming of C and assembly
The mixed programming method of inserting assembly instructions into C language programs using the __asm() instruction is mainly used in the following situations: there are fewer assembly program codes to be inserted (such as some simple direct hardware operation instructions); in the C language environment, assembly subroutines written in insert mode can avoid problems such as memory allocation, register use and protection, and parameter passing and returning.
The basic statement format of the keyword _ _asm() is:
① "asm_instrution" refers to the instruction name of the assembly language, such as move, mpy, etc.
② "=" is used to distinguish whether it is an input or output parameter, indicating that the value of operand Oper0 will be transferred to the C language variable CptrO; without "=", it means that the operand is an input operand, that is, the value of operand Operl comes from the C language variable Cptrl.
③ "M" (operande modifier) is used to specify the type of operand, for example, %e is used to specify that the operand is the MSB of the accumulator, that is, a1 or bl.
④ Oper0 and Operl are used to specify that the operand is a register or memory, such as "A" indicates that the operand is limited to address registers r0~r7, that is, the compiler is required to specify a free address register for the operand.
(2) Mixed programming of C program and assembly program
Mixed programming of C program and assembly program is to edit and compile the source programs written in C language and assembly language separately, generate their own target files, and then link them together. Among them, the main program is written in the C language environment, and the subroutine written in assembly language can be called. Mixed programming of C program and assembly program is completed by C program compiler g563c.
The command format of C compiler g563c is:
When mixed programming, the following points should be noted:
① The characteristic of mixed programming of C program and assembly program is that the assembly statement is written in the assembly language environment; and the mixed programming method of inserting assembly instructions in C language program using _asm() instruction requires the compilation of assembly program to follow the rules of C language.
② In order to ensure that the assembly subroutine written in the assembly environment can be reliably called and executed in the C language environment, the assembly program needs to do the following processing: the leading part, save the program return address to the stack, accept the transfer of program entry parameters; save the value of the register to be used by the assembly program; the main body of the assembly program; restore the value of the register saved in the second step, take the value of the register saved in the stack from the stack in sequence and assign it to the original register, so that these registers are restored to the state before the assembly subroutine is called; the ending part, process the return value and return address of the program, the C language subroutine call can use the return command to return a value, and the mixed programming assembly program can also return a value after being called in the C environment. In the assembly source program, the value to be returned is finally stored in the accumulator a, and then the assembly instruction tst is used to pass the parameter to the C environment.
③C language calls the assembly subroutine in the assembly source file. First, write an assembly subroutine in an assembly source file (such as source, asm). Generally, the subroutine is written as follows in the assembly environment:
If you call the assembly subroutine Ftest in a C language source file (such as proj.c), you can redefine the label of the assembly subroutine in C language. That is, define it in the header of the C language file (or before calling the C function of the assembly subroutine):
extern void ReName()__asm("FTest");
then call the ReName() subroutine in the C language environment. [page]
If you add a capital "F" before the name of the subroutine when writing an assembly subroutine, you can omit the step of redefining the assembly subroutine label in the C environment. In this way, the default assembly subroutine name in the C language is the program name after removing the "F". As in the above example, calling the test() subroutine in the C environment means calling the Ftest subroutine in source.asm.
④ How to write an interrupt program in C language. To write an interrupt program in C language, you must first modify the interrupt vector table in crt0.asm, that is, find the location of a certain interrupt vector in the interrupt vector table, and call the interrupt response program written by the programmer here.
If the enhanced synchronous serial port 0 (ESSI0) is set to work in interrupt mode, data reception and transmission are both executed by interrupts. The enhanced serial port data reception interrupt service subroutine written by the programmer is Fssi_rx_isr. The address of the interrupt vector for enhanced serial port O data reception is p: $30 (p represents the program storage area), so the interrupt vector table in crt0.asm is modified as follows:
⑤C language uses variables defined in the assembly source file
Since variables defined in C language are mapped to the Y area of memory, the variables defined in the assembly source program that can be read and written by C language must also be defined in the Y area. For example, define memory in the assembly program source.asm:
Then the C variable c_var and the assembly variable test_var are mapped to the same physical memory address. This is an effective way to transfer data between C language and assembly language.
The limitation of g563c is that users who are not very familiar with the g563c compilation rules will often encounter abnormal errors due to the conflict between the assembly language and C language programs in using DSP resources, resulting in the C language program being unable to run reliably. The purpose of this project is also to reduce the need for users to use a large amount of assembly language in the C language environment, thereby enhancing the reliability of the system.
3 Main Experimental Projects
This embedded system is currently mainly used as an experimental platform for undergraduates and postgraduates. The design includes two parts: hardware basic experiments and software algorithm experiments.
The hardware experiment part includes:
①Serial communication experiment.
②Data storage experiment. Programming control port A to access external SRAM memory and specific areas of peripheral Flash memory.
③Voice acquisition and storage experiment. Set appropriate sampling rate and program to realize voice signal acquisition.
④Voice recording and playback experiment.
⑤A/D experiment (simple display).
⑥D/A experiment (function signal generator).
The software experiment part includes:
①Basic mathematical operation experiment.
②FFT fast Fourier transform.
③FIR finite impulse response filter.
Operate on a given time domain signal and analyze and compare with Matlab operation results.
The following is a brief description of the experiment using the serial communication experiment as an example:
Experimental content DSP communicates with the PC through the serial interface (RS232). ①Send the characters input from the keyboard to the PC through the serial port, and receive the characters sent by the PC. LCD works in text display mode; phase-locked loop clock divider and serial communication controller set the baud rate of serial communication. ② PC transmits a black and white picture to DSP through serial port and displays it through LCD. LCD works in graphic display mode.
Experimental principle Utilize programming of 56311's SCI (Serial Communication Interface) to realize serial communication with host computer at multiple baud rates.
The external devices used in the experiment are standard 102 keyboard and LCD.
The internal modules of DSP used in the experiment are phase-locked loop clock divider and serial communication interface (SCI). Experimental content: DSP communicates with PC in two directions through serial interface (RS232). DSP sends characters input from keyboard to PC through serial port and can receive characters sent by PC.
Experimental results Figure 4 shows the LCD display result of sending pictures.
4 Conclusion
This project has realized the development of a teaching experiment platform based on DSP563llEVM. A DSP hardware driver library file system supporting C language was written, and the signal generation circuit necessary for DSP development and experiments and the LCD display interface circuit for convenient result display were designed; a main program architecture capable of handling multiple tasks was established. The independently running signal processing program was modularized into a C language subroutine, which can be called and executed at any time in the system, fully demonstrating the powerful computing power of DSP and the flexibility of software programming.
Previous article:Research and Implementation of Embedded Simulation System Based on SX52
Next article:Research on Fingerprint Collection System Based on DSP
- Popular Resources
- Popular amplifiers
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
- MicroPython Hands-on (15) - AB Buttons on the Control Panel
- TMS320F28335---External key interrupt
- UCD9090A-How to use TI power sequencer in 5G MIMO applications
- Is FPGA acceleration of CNN an option? What board should I use?
- Security Tools Bombercat
- The solid state drive doesn't seem to be as good as I thought
- [NXP Rapid IoT Review] Local compilation of online generated projects
- EEWORLD University ---- Practical Guide to Motor Application Development - Based on STM32
- Simulation Help Post
- Based in Chengdu, job position: Reliability Engineer