Application of STC89C58RD+ MCU in MP3 Player Design (1)

Single chip microcomputer STM32L151CCU6
Mobile phone crystal 3.2*2.5mm 3225 26M (26.000MHZ) 7.5PF 10PPM 20PPM 30PPM
1206RGB (single)
Photocoupler

With the increasing demand for portable music players, MP3 players are favored by music lovers with their small size and better sound quality. At first, MP3 files were played by computers. Later, the development of the Internet promoted the generation of MP3 players. At the same time, MP3 players also undergo a series of changes, which are more compact, more humanized and more interesting. Nowadays, there are more and more MP3 styles on the market, and the functions are more and more abundant, but most of the existing MP3 players integrate the decoder and the memory. This design makes the MP3 player easy to carry, but it also brings problems: First, the storage capacity is not easy to expand; Second, it is not conducive to the application of MP3 players in other fields. Separating the player from the memory is a direction that MP3 players are currently developing [1-3]. This system uses STC89C58RD+ MCU, combined with USB interface chip CH375, decoder chip VS1011E, Nokia5110 LCD and other peripheral devices to design and implement MP3 player. The system reads the MP3 file of the U disk in USB-HOST mode and decodes it, and has the functions of reading music labels, U disk e-books and Snake games.

Overall system design

The MP3 player is an emerging digital music player that plays files in formats such as MP3 and WMA. By using the MPEG-1 Layer 3 encoding technique, a lossy music signal of approximately 12:1 compression can be obtained. Although the MP3 file is lossy, it loses the signal with weak power spectrum during the compression process, but it is not much different from the CD original sound, and does not affect the appreciation of music by ordinary music lovers. MP3 greatly reduces the length of sound files, making music transfer and storage more convenient. The structure of the MP3 player system is shown in Figure 1. After the system is started, the STC89C58RD+ MCU obtains the MP3 format file data from the U disk through the USB interface chip CH375, and stores it in the on-chip RAM for buffering. Then the MCU periodically sends the data from the buffer to the MP3 audio decoding chip VS1011E for decoding. And output audio signals to headphones or active speakers. The user can realize the functions of “start”, “stop”, “previous song”, “next song” and “volume control” through the keyboard, and display the playing status information through the Nokia 5110 liquid crystal display. The system mainly includes a data reading module, an audio decoding module and a liquid crystal display module in hardware.

STC89C58RD+单片机在MP3播放器设计中的应用 (1)0

System hardware module implementation

Data reading module

The MCU reads the MP3 data module including the STC89C58RD+ MCU, the USB interface chip CH375 and the MP3 format data storage U disk.

STC89C58RD+ microcontroller

The system adopts STC89C58RD+ single-chip microcomputer. The single-chip microcomputer is designed by American STC Company. The new generation 51 enhanced single-chip microcomputer produced by domestic Hongjing Company is compatible with 51 single-chip microcomputer. It has strong encryption, super anti-interference, ultra-low power consumption, programmable in the system, and includes MAX810 dedicated reset circuit [4].

The microcontroller uses the MCS51 core, which contains 32KB of FLASH and 16KB of EEPROM, and contains 1KB of internal SRAM storage space. Thus, it can be used in the case where audio data processing and display data processing require large data buffering. The device can work up to 33MHz clock. In this system, it works under 30MHz clock, which can meet the system's data bandwidth requirements.

CH375 interface chip

CH375 is a general-purpose USB bus interface chip with integrated PLL frequency multiplier, data buffer, master-slave USB interface SIE, passive parallel interface, asynchronous serial interface, command interpreter, protocol processor for control transmission and general purpose. Firmware program, etc. [5]. It has USB-HOST and USB-SLAVE two ways, among which USB-HOST mode supports various commonly used USB full-speed devices, external MCU, MCU, DSP can pass CH375 according to the corresponding USB protocol and USB Device communication, this is because at the local end, CH375 has four control buses and eight-bit data bus for reading, writing, chip select control lines and interrupt output, which can be conveniently hooked up to the system bus of the microcontroller and other controllers. The functions of the internal parts of the CH375 chip are as follows: 1 PLL frequency multiplier is used to multiply the external input 12MHz clock to 48MHz, which is used as the USB interface SIE clock. 2 Data buffer is used to buffer the data sent and received by the USB interface SIE. 3 master-slave USB interface SIE is used to complete physical USB data reception and transmission. 4 Passive parallel interface and asynchronous serial interface for exchanging data with external microcontroller. The 5URT serial interface is used to exchange data with an external microcontroller in place of the parallel interface. The 6 command interpreter is used to analyze and execute various commands submitted by an external microcontroller. 7 The protocol processor that controls the transmission is used to automatically process multiple stages of common control transmission, simplifying the programming of external firmware and reducing the development difficulty. 8 general firmware program to achieve the relevant protocol for USB transmission.

Data reading principle

The data read circuit is shown in Figure 2. The system uses the single-chip microcomputer to realize the audio data in the U disk to be transmitted to the internal RAM buffer of the MCU through the USB serial interface of CH375 to wait for decoding. On the hardware, only one CH375 chip is added in the single-chip system, the overall cost is lower. This is because the CH375 has built-in USB communication protocol, which saves the understanding of the USB communication protocol. The MCU can directly call the API library to read and write the U disk. File data. When the CH375 chip is working, it needs to provide 12MHz clock signal externally. It supports the full-speed USB-HOST host interface. The peripheral components only need a small amount of crystals and capacitors to support the 5V and 3.3V supply voltages.

VS1011E decoder chip

The system uses the VS1011E chip to decode MP3 audio. The VS1011E audio decoder chip is the third generation of the VS10XX series. It is a single-chip MP3/WMA/MIDI audio decoder chip produced by VLSI Solution Oy of Finland. Its internal structure is shown in Figure 3. It includes a high performance, low power DSP processing core (VSDSP), 5KB of instruction RAM, 0.5KB of data RAM, serial control and data input interface, four general purpose I/O ports, one UART port, one Variable sampling rate ADC, a stereo DAC and an audio headphone amplifier. The chip can work at 12.288~14MHz or 24.576~28MHz clock. Can be used to decode MPEG1 & 2 Layer 1, 2, 3 and MPEG2.5 Layer 3 format, and WAV format files [6].

VS1011E chip workflow

When the VS1011E chip works, the MP3 or WAV format audio file is first sent to the chip through the SDI bus and decoded. After decoding, if SCL_AIADDR!=0, the application area code is executed (the code address is provided by the corresponding address register), and then the data is sent to the bass and treble optimizer according to the settings of the SCL_BASS register (SB_AMPLITUDE bit and ST_AMPLITUDE bit). The audio is processed, and then the data is backed up to the audio FIFO through the volume control unit. The audio FIFO is used to hold the data and use the data as input to the sample rate converter and DAC. The sample rate converter converts all the different sample rates into CLKI/512 signals to the DAC, which in turn generates stereo analog signals in bits, which are then sent by the system to the headphone amplifier. The workflow of VS1011E is shown in Figure 4. STC89C58RD+单片机在MP3播放器设计中的应用 (1)1

[1] [2] STC89C58RD+单片机在MP3播放器设计中的应用 (1)2

Ningbo Autrends International Trade Co.,Ltd. , https://www.ecigarettevapepods.com