Embedded platform based on LPC2214 and uC/OS-II
Currently popular ARM chip cores include ARM7TDMI, ARM720T, ARM9TDMI, ARM992T, ARM940T, ARM946T, ARM966T and ARM10TDMI. Philips LPC2214 is a high-performance 32-bit RISC microcontroller based on ARM7TDMI-S. It integrates Thumb extended instruction set, 256KB on-chip Flash programmable in the system and 16KB programmable in the application. RAM, vector interrupt controller, external bus controller, 2 UARTs, I2C serial interface, 2 SPI serial interfaces, 2 timers (7 capture/compare channels), a PWM unit with up to 6 PWM outputs, 8-channel 10-bit ADC, real-time clock, watchdog timer and 112 general-purpose I/O pins. The LPC2214 can achieve a CPU clock frequency of up to 60MHz through a programmable on-chip phase-locked loop (PLL). Compared with many ARM series products, the LPC2214 produced by Philips is a cost-effective ARM7 chip.
Embedded real-time operating systems help improve system reliability and development efficiency, and can give full play to the multi-tasking capabilities of 32-bit CPUs. Common embedded operating systems include Linux, Windows CE, VxWorks, Nucleus, uC/OS-II, etc. Among them, uC/OS-II is a portable, curable, and customizable preemptive real-time operating system. Its peripheral supporting products are also relatively complete, such as uC/FS, uC/GUI and other products have enhanced the applicability of its application. Compared with other operating systems, uC/OS-II only needs a dozen or dozens of KB of Flash space and SRAM space for normal operation, and the licensing fee required is relatively low. Combined with the hardware platform with LPC2214 as the core, uC/OS-II is used here as the embedded operating system of the device.
From the above analysis, it can be seen that choosing an embedded platform that combines LPC2214 and uC/OS-II is a more economical and practical method.
2. Selection of audio decoding chip
The platform combining LPC2214 and uC/OS-II has relatively powerful processing capabilities, but it is still insufficient in many applications. In the application introduced in this article, the system needs to have audio codec functions. The audio codec methods include software codec and hardware codec. If software codec is used, the processing speed requirement for the processor is generally above 50MIPS, while the processing speed of LPC2214 is only about 70MIPS. Obviously, if this method is used, the processing capacity of LPC2214 will be greatly limited. Therefore, using a dedicated audio processing chip to process audio data is a correct choice for this platform. Here, a high-performance audio decoding chip--VS1003 is selected.
The VS1003 audio decoding chip is the third generation product of the VS10XX series. It is a single-chip MP3/WMA/MIDI decoding and ADPCM encoding chip produced by VLSI Solution Oy of Finland. It contains a high-performance, low-power DSP processing core (VSDSP), a working memory, a 5.5KB RAM for user programs, a serial SPI bus interface, a high-quality oversampling DAC with adjustable sampling frequency, and a 16-bit sampling ADC. The internal structure of VS1003 is shown in Figure 1.
[page]
3 Implementation of VS1003 Control Protocol
VS1003 communicates data and control information with the host through an SPI serial bus working in slave mode. Audio data is transmitted through the serial data interface (SDI) and control data is transmitted through the serial control interface (SCI). The control data is always 16 bits and the control of VS1003 is achieved by reading/writing different registers.
The SPI interface of VS1003 has two working modes: VS1002 new mode and VS1001 compatible mode. Set SM_SDINEW to 1 to put VS1003 in VS1002 new mode. When SMSDISHARED is 0, the transmission of control signals and data signals uses xCS and xDCS as synchronization signals respectively, and when SMSDISHARED is 1, xCS is shared as the synchronization signal. Set SM_SDINEW to 0 to put VS1003 in VS1001 compatible mode, in which only xCS is used as the synchronization signal.
As a slave working mode, VS1003 indicates whether the host is allowed to transmit data through a signal line DREQ. When DREQ is high, VS1003 can accept at least 32KB of SDI data or SCI control commands.
Here, we take the new mode of VS1002 and SMSDISHARED set to 0 as an example to introduce the implementation of VS1003 communication protocol. Figure 2 describes the SDI working sequence, which uses xDCS as the synchronization signal. As the clock signal DCLK changes, the data is sent out from the high or low position in turn according to the setting of SCL_MODE.
The SCI protocol includes 1 control instruction byte, 1 address byte and 1 16-bit data word. Each read and write control can operate one register. The read command and write command are 0x03 and 0x02 respectively. The working timing of these two control commands are shown in Figure 3 and Figure 4 respectively.
4 Circuit Design
The ultimate goal of this design is to create an industrial control handheld device with a human-machine interface and data storage functions. Control commands are sent through the human-machine dialogue interface to manipulate VS1003 to achieve recording and playback functions.
4.1 Hardware Circuit Design
All data and control commands of VS1003 are implemented through the SPI bus interface, so the interface with LPC2214 is relatively simple, including 3 SPI data lines and 4 control lines, as shown in Figure 5.
[page]
4.2 Software Design
The control software design of VS1003 is carried out under the condition that the system has successfully transplanted the uC/OS-II operating system and the ZLGFS file system. In the specific software design, firstly, several functional pins of the LPC2214 and VS1003 control interface are configured accordingly, and then SPI is enabled and its working mode is set. After that, a special task is established to realize the recording and playback function of the system by using the characteristics of uC/OS-II multi-tasking. After the task is created, the initialization of VS1003 is completed first, and then the task enters the waiting loop, waiting for the system to issue the corresponding control instruction. When the task receives the recording instruction, the corresponding recording function function is called to start the recording function and write the recording data to the specified file. When the playback function instruction is received, the playback function function is called to play the specified audio file. When the interrupt instruction is received, the recording and playback function will be exited and the task will return to the loop waiting. The specific implementation function of the task is as follows:
5 Conclusion
VS1003 is used to implement the audio codec function of the embedded platform based on LPC2214 and uC/OS-II. The interface circuit is simple, the control program is easy to write, and the final audio playback is clear and natural. Of course, some problems that need attention have been encountered in the specific design. For example, to successfully initialize VS1003, it is necessary to understand the configuration timing requirements of VS1003 in detail. In particular, it should be noted that the waiting processing cycle for different register configurations is different. If the waiting cycle is not enough, the configuration will not be completed normally.
Previous article:Ultrasonic motor drive control system based on LPC2124
Next article:Design of Real-time Clock Control Based on LPC2131
Recommended ReadingLatest update time:2024-11-17 03:45
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- How to locate the coordinate origin when AD is imported into CAD
- Gaoxin is recruiting: Embedded Software Engineer, welcome outstanding graduates to apply
- Closing down the factory during the pandemic holiday? Kunshan Daxin Electronics announced its dissolution
- Is there a solution for making a base station battery protection board?
- The technology blocked by TSMC and the USA is indeed a bit high-end - let's take a look
- About the layout and wiring principles of RF board PCB
- Getting Started with the MSP432P401R Clock
- INA282 Applications
- Example programs for 10 software filtering methods
- Where can I find this symbol in proteus? The oscilloscope does not have this one...