Abstract: This paper designs a single-chip MP3 player, using the open source software project EFSL, taking advantage of its small memory requirements, simple porting, and completely free. By designing the underlying driver, the FAT file system based on the SD card is ported on the LPC2148, and the CrossWorks for ARM 1.6 software is used to configure the EFSL file system and compile the functional modules. The correctness of the design is verified through software debugging. This design provides a new way to expand the function of single-chip applications.
introduction
In recent years, with the development of digital technology, people's requirements for MP3 players have become more and more diversified. Manufacturers have made a lot of efforts and designed a variety of solutions in the selection, design, development, additional functions and application fields of MP3 players. With the trend of faster and faster processors and larger storage capacities, the storage organization form and memory settings of data in products need to be managed efficiently and reasonably, which is exactly the function of the file system.
The open source software project Embedded File System Library (EFSL) is very suitable for solving the problems of storage space management and function expansion of small microcontrollers as an embedded file system due to its advantages such as small memory requirements, simple porting, and being completely free. This paper designs a new embedded MP3 player based on the EFSL file system and the ARM platform, which has certain practical value. At the same time, it provides a feasible reference solution for the microcontroller to break free from the constraints of the operating system and realize the multimedia application of the microcontroller.
1 Hardware Design
The block diagram of the system hardware structure is shown in Figure 1. The entire hardware system uses the LPC2148 with PHILIPS ARM7-TMDI core as the core processor, which controls the VS1003 decoding module, SD card interface module, USB interface module and human-computer interaction function module respectively.
Figure 1 Hardware block diagram of MP3 player
1.1 Main control chip
LPC2148 is a 16/32-bit ARM7TDMI-S microcontroller that supports real-time simulation and embedded tracing. It has an embedded 512 KB high-speed FLASH memory. Its powerful functions facilitate future system upgrades.
In this system, only USB, SPI, SSP interface functions and ADC functions are used temporarily, and the use of other functions is subject to expansion. The decoding module VS1003 integrates VS_DSP processor, stereo audio DAC and stereo headphone amplifier driver. Since the decoding and control chips are separated, the sound quality is good and the control is relatively simple. LPC2148 controls VS1003 through its SPI interface.
1.2 Display Module
The display module uses VGS12864E, which is a 128×64 line dot matrix OLED monochrome, character, and graphic display module. The module has a built-in 64×64 display data RAM, in which each bit of data corresponds to the light and dark state of a point on the OLED screen; its instruction system is compatible with the LCD display driver controller HD61202. This system uses an 8-bit I/O port to connect to the 8-bit data bus D0~D7 of the OLED module through analog timing, and then controls the OLED module by connecting to the instruction control or data operation bit RS, read and write control bit R/W and enable control bit E of the LCD through a 3-bit I/O port.
1.3 Storage Module
The SD card is used as the storage medium, which has the advantages of large capacity, small size and vibration resistance. All songs are stored in the SD card, which works in SPI mode. The SSP of LPC2148 is connected to the SD card by setting it to SPI function. At the same time, the other two I/O ports of the chip are set to the detection pins for whether the card is fully inserted into the card holder and whether the card is write-protected.
2 Software Design
The player uses a four-layer structure to implement its functions. The software hierarchy is shown in Figure 2. The main purpose of using modularization is to facilitate module portability.
Figure 2 Playback software hierarchy
2.1 Development Environment Construction
The development environment is mainly based on The Rowley Cross StudioIDE for EFSL compilation. CrossWorks for ARM1.6 uses the GCC 4.1 compiler. Install CrossWorks forARM 1.6 software and import the MP3Player.hzp project file. The project file already contains the files in the motherboard and the device configuration file.
After Rowley Cross Studio IDE automatically loads all files, all major folders will be displayed: Audio Render Driver folder (contains DAC audio processing related code), Demo Player folder (main module, which can be configured and modified as needed), EFSL folder (stores the EFSL embedded file system, through which the player software can read and write MP3 files in the MMC storage card), EFSL Driver folder (stores the basic read and write operation driver of the storage device), Libmad folder (main encoding file, the relevant code can be changed as needed to meet the Libmad configuration requirements).
2.2 File system configuration and compilation function module
The file system configuration and compilation function module performs software configuration and file system compilation.
2.2.1 Set the project file path
Use the command line tool to find the project file and include files. The path is:
Add the MP3Player project to the Preprocessing tab configuration file in the ARM Flash Release and ARM Flash Debug options windows.
2.2.2 Compiler Configuration
Since the fixed-point digital calculation requirements are very high and the extended digital instruction set can only run on 32 bits, the code compilation also needs to be compiled in a 32-bit environment, and the USB memory RAM and its stack allocation need to be used [5]. USB RAM generally does not run in the LPC214X environment, but the Rowley Cross Studio IDE has provided the initialization of this hardware device. Philips_LPC2148_startup.s is created and placed in the MP3 player project directory to support the USB RAM device. It is also necessary to add stack allocation code to the memory part of the USB DMARAM in the code.
2.2.3 Libmad file configuration
Libmad can run a library on different platforms and provide better optimization for ARM7. Its compiler also needs to set the system running environment variables.
2.2.4 Configuring EFS Files
The debug.h file in the .\MP3Player\efsl\inc directory supports semihost debugging. All debug messages can be set and displayed through the I/O terminal window of the JTAG debugger. The RAM memory usage level and buffer size can be set through the config.h configuration file in .\MP3Player\efsl\conf.
2.2.5 Configuring system files
Since the file initialization requires a good LPC2148 operating environment, it is necessary to increase the LPC2148 to its maximum performance (60Hz), and at the same time, it is necessary to enable the PLL function, set the IRQ interrupt management timer to 0 and the VPB divider to 1. At the same time, Philips_LPC2148_Startup.s must include relevant preprocessor compilation instructions. To set the compiler instructions in the IDE, just select the Philips_LPC2148_Startup.s file in the project browser window, then select the Preprocessor tab, and fill in the Preprocessor Definition property.
2.2.6 Compiling batch files
To compile batch files, you need two files, one is the project file MP3Player, and the other is the RowleyCross Studio file Rowley Associates Limited for ARM. The Cross-Works for ARM 1.6 file can batch process files by itself:
build_all_debug.bat,build_all_release.bat.
3 System Process
After the system starts, the hardware module is initialized first. LPC2148 reads some basic information of the SD card, such as capacity, sector size, FAT table and the starting sector where the root directory is located. After obtaining this information, it is possible to find out whether the SD card has music files that can be played. If there are music files, the microprocessor will read the audio information of the file through the SPI bus, and send the code stream information of the song to the VS1003 chip. Through the decoding of the VS1003 chip and its high-quality stereo DAC and headphone driver circuit, the MP3 song playback function is realized. The software system flow chart is shown in Figure 3.
Figure 3 Software system flow chart
4 Debugging
The Main.c file (source code omitted) shows the working process of the MP3 player. The init_IO() function initializes the LPC2148 timer 0, generates periodic interrupts, and starts some data structures. The periodic interrupt rate should be the same as the decoder data stream, and then efs_init (&efs, ″\″) calls the MP3 file. If the file cannot be found, the "Could not open filesystem" parameter will be passed to the CrossStudio IDE through the JTAG interface, otherwise the file information will be displayed normally. The file processing result is shown in Figure 4. Through debugging and displaying information, it can be seen that the file information can be displayed normally. In addition, after physical production and testing, this MP3 player can smoothly play MP3 files in the SD card, which verifies that this design is correct and feasible.
Figure 4 Debug terminal display information
5 Conclusion
This paper designs an MP3 player based on the open source software project EFSL, introduces the hardware and software architecture of the player system, and the porting and modification of EFSL related code sources. The feasibility of the design is verified through CrossWorks forARM 1.6 software debugging. The entire design reflects the advantages of simple porting and convenient configuration of EFSL code sources.
Previous article:In-depth discussion of high-definition audio IC design challenges
Next article:Set-top Box_Digital/Internet TV Set-top Box
Recommended ReadingLatest update time:2024-11-16 20:23
- Popular Resources
- Popular amplifiers
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- arm_embedded_machine_learning_design_dummies_guide
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- 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
- R8-5 Attribute Introduction
- [2022 Digi-Key Innovation Design Competition] Build a blockchain browser service
- Cheer for the college entrance examination
- Mathematical formula solving
- TI millimeter wave radar evaluation report summary
- MSP430 communication resources IIC communication
- Share experience [RK3399] Type-C to normal USB
- [TI recommended course] #Live replay: TI's new generation C2000? microcontroller#
- IAR burning program shows error
- Application of state machine principle in control program design.pdf