STC12C5A60S2 realizes U disk audio player

U disk, or flash disk, is a medium that uses flash memory for data storage, usually using a USB plug. The USB flash drive is extremely small, light, hot-swappable and can be rewritten. Most of the data stored in U disk is still extracted and processed by computer, which also limits the development scope of U disk.

The author believes that for a specific function, stripping the dependence of the corresponding data on the computer, on the one hand, can make full use of the U disk data, on the other hand, it also exerts the versatility of the USB protocol, enabling the U disk to achieve the portable features of what you get. Based on this, the U disk MP3 player circuit is designed, which mainly completes the data extraction and function operation tasks of the audio files stored in the U disk. This player is equivalent to the audio processing module of a personal computer. It can not only recognize and extract files in MP3, WMA or MIDI format stored in the U disk, but also complete data processing tasks such as audio decoding, and finally send it to speakers or headphones for playback. .

1 The block diagram of the player composition

The composition principle of the player is shown in Figure 1, which is composed of three main modules: the single-chip processing module, which is composed of the STC12C4A60S52 single-chip computer and its peripheral circuits; the U disk reading and writing module, which is composed of CH375 and its peripheral circuits; is the audio decoding module, It is composed of VS1003 chip and its peripheral circuits.

The working process of the player is: MCU reads the data from the USB storage device through CH375, and sends the relevant data of the USB storage device to the audio decoding module according to the control commands of the function keys. After decoding in VS1003, it is sent to the speaker or headphones . Set 6 personal computer interactive function buttons to realize basic operation functions such as play, pause, previous song, next song, increase volume, decrease volume and so on.

2 Hardware circuit design

As shown in Figure 1, it mainly completes the circuit design of three modules: U disk reading and writing, single-chip processing and audio decoding.

Figure 1 Principle block diagram

Figure 1 Principle block diagram

2. 1 U disk reading and writing module

The U disk reading and writing module is composed of CH375 and its peripheral circuits, and its composition is shown in Figure 2.

Figure 2 CH375 peripheral hardware circuit

Figure 2 CH375 peripheral hardware circuit

CH375 is a USB bus universal interface chip, supporting USB host and slave devices. On the local side, CH375 has an 8-bit data bus and read, write, chip select control lines and interrupt output, which can be easily connected to the system bus of microcontrollers / DSP / MCU / MPU and other controllers. In the USB host mode, CH375 also provides a serial communication mode, which is connected to the microcontroller / DSP / MCU / MPU through serial input, output and interrupt output.

The USB host mode of CH375 supports commonly used USB full-speed devices. External MCUs can communicate with USB devices via CH375 according to the corresponding USB protocol. CH375 also has built-in firmware to handle Mass-Storage mass storage device special communication protocol. External MCU can directly read and write commonly used USB storage devices with sectors as the basic unit.

In the design, CH375 adopts the host mode, J1 in the picture is a USB socket, which can be connected to storage devices such as U disk, D1 is an indicator LED, and the light is on when a USB device connection is detected. When the TXD pin is connected to ground, CH375 works in parallel port mode. At this time, the JP1 interface D0 ~ D7 in the figure is a bidirectional data bus, which is connected to the microcontroller.

The single chip microcomputer is connected to the JP2 interface in the figure, and the CH375 is controlled through the program. Its functions and characteristics are shown in Table 1.

Table 1 JP2 functions and features

Table 1 JP2 functions and features

The MCU controls the CH375 by writing commands and data, and obtains the U disk data through the CH375. CH375 has built-in related firmware programs, which automatically handles USB and other protocols. The single chip microcomputer can directly obtain the data of the U disk sector through CH375, so it only needs to deal with the FAT file system layer to realize the operation of the U disk file.

2. 2 MCU module

The MCU module is composed of STC12C4A60S52 single chip microcomputer and its peripheral circuits. STC12C5A60S2 is a single clock / machine cycle single chip microcomputer produced by Hongjing Technology. The instruction code is fully compatible with the traditional 8051, but the speed is 8 to 12 times faster. It provides Flash program memory 60 kByte, 1 kByte EEPROM, on-chip integrated 1 280 Byte RAM. Voltage 5. 5 ~ 3. 5 V, internally integrated MAX810 dedicated reset circuit, 4 timers, 2 serial ports, 2 PWM, 8 high-speed 10-bit A / D conversion, ISP / IAP, built-in watchdog circuit, External power-down detection circuit, etc.

Figure 3 is the hardware circuit schematic diagram of the MCU module of the player. Among them, JP4 is the power input interface, D1 is the power indicator, and the exclusion Rp1 is the pull-up resistor of the P0 port. JP2 and JP3 are connected to the corresponding interface of the U disk read-write module. Because the single chip microcomputer works under 5 V power supply, and VS1003 works under 3.3 V power supply, the working P1 port should connect the current limiting resistor to JP1 and then to the corresponding interface of the audio decoding module. The circuit sets 5 function buttons, "UP" is to increase the volume, "DOWN" is to decrease the volume, "LEFT" is to select the previous song, "DOWN" is to select the next song, and "PLAY" is the play / pause button .

MCU module hardware circuit

Figure 3 MCU module hardware circuit

Floor-Stand IR Touch Display

smart infrared Touch Screen for Advertising Display monitor,floor stand,multiple sizes,android system;The Flat Panel Displays LCD advertising message information Activpanel release system is prepared by the company`s store owners in advance. Digital Signage Media Player digital signage for chromecast,digital signage for schools,digital signage media player,The Digital Signage Displays audience does not need to increase personal investment and consumption costs, but only needs to "focus on" resources. Flat Panel Displays media player for digital signage This is easy to accept for everyone. At this point, the popularization of advertising words on LCD screens is a kind of work that is profitable and has the characteristics of Interactive Flat Panel social development and Digital Signage Displays public welfare.

floor stand touch screen monitor,floor stand infrared touch screen display monitor,advertising media player indoor and outdoor

Jumei Video(Shenzhen)Co.,Ltd , https://www.jmsxdisplay.com

Posted on