Design of MP3 player based on C51 single chip microcomputer

Publisher:VelvetDreamerLatest update time:2011-05-20 Source: 电子科技 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
Portable MP3 players are a digital product that integrates audio playback and data storage. Their functional structure is highly discussed by electronic designers. MP3 is the abbreviation of MPEG-1 Audio III (1ayerIII). MPEG-1 Audio (ISO/IECll 172-3) is the most commonly used audio compression standard. The algorithm of layer III is the most complex, but it has the highest compression ratio and the best effect. It can basically achieve the sound quality of CD under low bit rate conditions. The MP3 standard uses the lowest possible bit rate to achieve CD-quality sound without data loss. If a piece of sound is not compressed, 1.4Mbit must be used for each second of stereo CD-quality music stored, which is a very large cost. By using the compression technology of the MPEG audio standard, we can compress the storage space to 1/12 of the original without reducing the sound quality. Even if a compression factor of 1/24 is used, the sound quality is still better than simply reducing the sampling rate. The advantages of low data volume and high playback quality make it the main way of music storage, digital broadcasting, and online music transmission. People can not only use computer software, but also enjoy music through digital walkman. This design takes C51 core microcontroller as the core and designs an MP3 player.


1 MP3 Hardware Design
In the design of this hardware system, AT89C51SND1C produced by Atme 1 is used as the main control MCU. AT89C51SND1C is a multimedia 8-bit microprocessor designed by ATMEL specifically for the needs of MP3. It uses the general C51 core and integrates a variety of peripherals on the chip, providing a convenient solution for MP3 products. The high integration of the circuit of this chip greatly reduces the power consumption and heat generation of the system, improves the stability and speed of the system, and significantly enhances the anti-interference ability. AT89C51SND1C has the following peripherals integrated, which greatly simplifies the circuit design: a. MP3 hardware decoder; b. Programmable audio output interface DAC; c. 8-bit MCU C51: d. USB1.1 controller; e. Built-in phase-locked loop PLL; f. Multimedia card interface adapter; g. SPI interface adapter; h. IDE/ATAPI interface; i. Two 10-bit ADC, 8kHz; j. 44 general I/O; k. Two 16-bit timers/counters; 1. Hardware watchdog timer; m. Standard full-duplex UART; n. Two-wire active and passive mode controller; o. SPI active and passive mode controller; p. Power management module.
The structural block diagram of the entire player is shown in Figure 1. The PC uses the USB interface to store data information such as MP3 songs and documents in the USB disk. After the system is started, the MCU controls the code stream information stored in the Flash to be sent to the MP3 decoding chip for decoding and generates a decoded output. After the DAC module of the system converts the decoded output into analog audio sound through the CS4340 chip, it is amplified by the first-level audio amplifier circuit and drives the headphones to play MP3 songs. The system hardware includes the main control MCU, decoder, Flash storage system, power supply system, buttons and D/A converter.

1.1 Decoding part
This is the core component of the MP3 player. This design uses hardware decoding technology. In this system, the author uses the AT89C51SNDlC chip. This chip is a 51-core single-chip microcomputer with built-in MPEG I/II-Layer hardware decoder and Human Interface. It can support the decoding of 8-320kbps basic data streams and supports a sampling frequency range of 16-48kHz. It is very suitable for MPEG audio decoding and has an MPEG playback module for digital voice recording. It has a high cost performance. The decoded signal is a stereo, mono or dual-channel digital signal that can be directly output to the DAC. The interface between SP-CA751A and DAC is programmable. As long as the universal serial I/0 port and control interface can be used to perform I/0 and playback control on the MPEG bit stream, the system controller can easily decode the MPEG audio signal. Through a universal programmable I2S interface, the decoded audio PCM data can be output to the external DAC. Therefore, most commonly used audio DACs are compatible with this chip. This design uses the CS4340 chip.
1.2 Storage Part
Now a 1GB FLASH memory is used, which can store 19 hours of music at 128kbps (reaching CD quality). The system uses the 1GB FLASH memory chip K9F5608UOB of SAMSUNG.
1.3 Interface Part
Generally, MP3 files are downloaded through the USB interface of the PC, with a transmission rate of 12Mbps. Since the AT89C5lSNDlC chip produced by Atmel only supports USBl. 1 technical specifications, the interface speed is slightly slower. But for MP3 playback, it can meet the needs.
1.4 Power Management
Portable MP3s are small in size and can be powered by two No. 7 batteries (3VDC). At the same time, they can also be powered by the USB interface. Therefore, it is very necessary to use low voltage and perform effective power management.


2 MP3 software design
Hardware is the foundation of design, and software is the soul of design. The MP3 program consists of two parts: MP3 playback function module and USB communication function module. In addition, for the convenience of debugging, there is also a debugging function module. This module is used in system software debugging and is removed when the MP3 system is working normally. [page]

The work of the MP3 playback function module is divided into two parts:
the first part is to play MP3 songs in a loop. This function needs to do some initialization work first. Once the MP3 decoder starts working, it will keep requesting data from the CPU until the song ends. Only keyboard operation can end this function early. Because the data volume of MP3 files is large, they are stored in the flash memory in pages. Therefore, the initialization of the MP3 playback program is to read the first address and page number of the file into the CPU first, and then the CPU can fetch data according to the above data.
The second part is waiting for an interrupt to occur. This program is combined with the keyboard and is mainly used for the user to control the playback process. The keyboard operation also controls the MP3 playback process, including back, forward, jump to the next song, volume control, etc. Because the keyboard control function of the entire playback process is relatively simple and there is no compound operation of the key, the program is easy to implement. When the MP3 player is inserted into the USB interface, the system executes the USB communication function module, which is mainly used to manage the file data in the flash memory. The firmware program is the main work of the module development. Since AT89C51SND1C has no external interrupt pin and USB interrupt has no interrupt vector address entry, the framework of the firmware program adopts the query working mode.


3 FAT file format
Because the system also has the function of a USB flash drive, the files in the storage must be able to be read, written and recognized by the computer, that is, all files must strictly meet the requirements of the computer file system format. Among all computer file systems, FAT is a more commonly used one.
A FAT file system volume consists of 4 parts: reserved area, FAT area, root directory area, file and directory data area. The first partition in the reserved area must be BPB, also known as the "boot sector", because it contains key information for identifying the file system. The computer will use this information to identify the storage file format, so it is very important. The
FAT area stores the file allocation table. The storage space of the operating system is allocated by cluster. The cluster is the smallest storage unit allocated by the operating system. Each cluster occupies a 16-bit position in the FAT table, which is called a table entry. The data of the same file is not necessarily stored in a continuous area of ​​the storage area. It is often divided into several segments and stored like a chain. This storage method is called chain storage of files. In order to realize the chain storage of files, it is necessary to accurately record which clusters have been occupied, and it is also necessary to indicate the cluster number of the next cluster of the subsequent content for each occupied cluster. For the last cluster of a file, it is necessary to indicate that this cluster has no subsequent cluster. These are stored by the FAT table.
The root directory area stores directory entries. Each directory entry is 32 bytes and records the information of a file or directory. The space occupied by the directory entry is related to the number of directory entries.
The file and directory data area is the location where the file data is actually stored. All data is allocated and stored according to the above information.


4 Conclusion
MP3 uses relatively complex technology to achieve better compression effect, and the sampling rate of broadband audio signals is also high (generally above 44.1kHz), so the amount of calculation and data for MP3 encoding and decoding is quite large. The MPEGLayer III decoding algorithm has been verified on AT89C51SNDlC and achieved good results. After optimization, it can be played smoothly. Due to the performance limitations of the 51 core microcontroller, there may be pauses during buffering. The above content describes the structure of the minimum system composed of AT89C51SNDlC, which has the basic functions of a portable MP3 player. In fact, AT89C51SNDlC also supports LCD display and IDE interface, and can also be expanded by the above interface modules to form a larger and more complex system.

Reference address:Design of MP3 player based on C51 single chip microcomputer

Previous article:Direct Utilization of Dual Data Pointers in Keil C51
Next article:Design of label printer interface based on C8051F series single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号