Hockhua Advanced Microelectronics: Designing a tape-based MP3 player based on MCU and audio decoder

With the continuous advancement of digital technology in audio editing, synthesis, effect processing, storage, transmission, etc., digital audio products have become the mainstream of the market, and traditional purely analog audio products have almost withdrawn from the market. Such as CD players,MP3″ target=”_blank”>MP3Players and other products have gradually replaced traditional music playback devices with tape-type audio tapes as the media with better sound quality, more convenient storage and transmission. However, in some areas, especially low-profile cars, audio playback systems using audio tape as the media still exist in large numbers. If these playback devices are digitally transformed, higher costs will be required. This article will systematically introduce the economical solution provided by Fuhua Advanced Microelectronics-the tape-type (outline) MP3 player mTape.

Hockhua Advanced Microelectronics: Designing a tape-based MP3 player based on MCU and audio decoder

mTape is a new generation of innovative portable music player. It has a tape-like shell (see Figure 1) and can be put into a cassette tape drive like a tape, but it plays MP3 music with a more beautiful sound quality. Because of its flexible and concise operation interface, it can also be used as a universal portable MP3 player when it is separated from the cassette tape drive.It supports SD/MMC card plug and play, users can freely expand the storage space; high speedUSB2.0The interface can not only transmit data but also charge the built-in lithium battery, which fully reflects its simplicity and convenience.

  The main components of the hardware system

The composition of mTape is mainly based on the microcontroller FS7821 and audio decoder FS2401 of Fuhua Advanced Microelectronics. Figure 2 is the block diagram of the mTape hardware system. The block diagram includes two parts: inside the virtual box is the data transmission and processing; outside the virtual box is the power supply and charging part.

FS7821 is a media controller based on the 8051 core of the RISC architecture. It has a compatible high-speed USB2.0 interface and a variety of media interface controllers, such as NAND FLASH memory, Smart Media (SM), CompactFlash (CF), Micro Drive, Secure Digital (SD), Multi Media Card (MMC), Memory Stick (MS), Memory Stick-Pro (MS-pro), xD Picture (xD) and other controllers. The data transferred from the PC via USB2.0 does not require CPU processing, and is directly transferred to the media through DMA, which greatly improves the efficiency of data transfer.

The internal commands of FS7821 are 100% compatible with the most popular industry standard 8051, so the software is fully compatible with the standard 8051, which brings great convenience to software design. Because it uses a pipelined RISC architecture 8051MPU core, its instruction processing speed is much faster than the standard 8051 processing speed. Moreover, it also uses advanced data transmission algorithms to optimize the bus architecture. These new design methods make it possible to greatly increase the speed of data transmission and storage without increasing the cost of controllers or media devices. In addition, FS7821 provides 32 GPIO pins for the control and expansion of peripheral devices of various memory cards, which also makes FS7821 particularly suitable for designing FLASH MP3, card readers and other related products.

FS2401 is a single-chip MP3 audio decoder chip, which integrates a high-performance low-power DSP processor core, high-quality variable-rate sampling stereo DAC, audio power amplifier, serial data input interface SPI, and control signal I /O and general I/O. FS2401 acts as a slave device to listen to the bit stream data transmitted through the SPI interface. After the bit stream data is decoded, it is transmitted to the over-sampling multi-bit, sigma-delta DAC through the digital volume control. The entire decoding process is only controlled through the SPI interface. In addition to basic decoding, you can also add special music effects through its internal user RAM area.

  5 main functions of the hardware part

MP3 player function: FS7821 uses 4 GPIOs to connect with the SPI interface of audio decoder FS2401, which can initialize and control FS2401 in real time, and can automatically read MP3 files from SD card or MMC card, and then transfer to FS2401 for decoding. The generated two stereo analog signals are sent to the headphone jack and the magnetic head.
Card reader function: Because FS7821 integrates high-speed USB2.0 interface, DMA and multimedia interface internally, it is easy to realize high-speed file transfer and storage in any format between PC and mTape SD/MMC card.

Hockhua Advanced Microelectronics: Designing a tape-based MP3 player based on MCU and audio decoder

Cassette tape player playback function: mTape can be put into a cassette tape player like general cassette tapes for synchronous playback, fast forward, rewind, pause and other functions. The reason why these operations can be achieved is that it can determine the speed and direction of the rotation speed of the guide pulley of the cassette tape drive. In mTape, there are two small gears, one big and three gears that mesh with each other. One of the small gears can rotate with the tape guide shaft in the cassette tape drive, and the big gear can drive the other small gear to rotate in the same direction. Two reflective optocouplers are installed on the PCB board directly above the big gear, and the angle between the axis of the two optocouplers is 45 with the center of the big gear as the intersection point. , When the white part of the large gear is located under the reflective optocoupler, the circuit composed of the reflective optocoupler will produce a low level; on the contrary, when the black part of the large gear is located under the reflective optocoupler, the reflective optocoupler The composed circuit will produce a high level. In this way, when the big gear rotates at a constant speed, the circuit composed of two reflective optocouplers will generate two square waves A and B. Among them, the square wave of Channel A is sent to the general-purpose GPIO of FS7821, and the signal of Channel B is sent to the external interrupt 0 pin of FS7821. The total phase difference between A and B square waves is 90. . When the falling edge of the B square wave touches the external interrupt 0, if it is judged that the level of the A square wave is high, it is a forward rotation; if the A square wave is low, it is a backward rotation. The rotation speed can be judged by calculating the waveform data per unit time.

USB charging: Since mTape has a built-in large-capacity lithium battery, a high-efficiency lithium battery charging chip is used to charge the lithium battery by changing the +5V power supply from the USB port to a constant voltage of 4.2V.

Automatic power-on/power-off function: when mTape is inserted into the cassette tape drive and the PLAY button is pressed, the head on the mTape will be pressed down by the head of the tape drive, and the small stick under the bracket of the mTape head will be inserted under it. In the gap of the transmissive optocoupler, the circuit composed of the transmissive optocoupler will activate the power management chip to supply power to the mTape. FS7821 is powered on, and detects the system status, and then controls the status of the power management chip through a GPIO to maintain the stability of the power supply. When the cassette tape drive is paused or stopped, the head of mTape will bounce up, and the small rod under the head bracket will be drawn out from the gap of the transmissive optical coupler. The optocoupler circuit will send out a standby signal. If this signal lasts for more than 5 minutes, FS7821 will turn off the power and power off the mTape.

  Software Architecture

From the software point of view, mTape has two main functions, one is music playback function (including portable MP3 mode and cassette player playback mode), and the other is card reader function. The MMI management program can freely switch these two functions according to the mTape button, the signal from the cassette player, and the USB connection/disconnection. The specific software architecture is shown in Figure 3.

Music program flow: The main task of the music function part is that FS7821 reads an audio file from the SD/MMC card and then sends it to the decoder FS2401 for decoding. After all the music files have been played, mTape returns to playing the first song, so this is a loop playback mode.

Card reader function: The card reader program can be divided into two parts: the USB connection detection part and the physical part of the card reader. When the USB interface of the PC is connected to the mTape, the system enters the USB mode and executes the physical program of the card reader.

MMI part: The MMI (Man-Machine Interface) management part processes the commands issued by the user. Users can issue commands to mTape through the buttons on the mTape, the buttons on the cassette tape drive, and the disconnection/connection of the USB cable. These commands are divided into two types: one is a USB command, and the other is a music playback command. Because MMI does not have strict real-time requirements, and the program is not very complicated, it is not necessary to use a real-time operating system in mTape. When FS2401 has no audio data transmission request, FS7821 is in idle state. This free time is sufficient to process the commands issued by the user.

The Links:   MG15Q6ES42 LC171W03-C4

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *