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

75inch Live Display Screen

Open the smart live streaming screen,use our remote control,choose your connect method,wired and wireless,if you are using a android mobile,chose android wireless projection menu,find the screen projection tools in your mobile,and then search the nearby device,you will find an ID and a pin number,click connect.wired connect,use a usb line to connect the screen,you need to download an screen projection apps called flybytemirror,following the instructions,finish the downloading and install,after all these being done,the connection between your mobile and screen finishes.an iPhone can directly connect the screen with its internal tools airplay.after done all these,start your live streaming,you just to pay attentions on the screen,put your mobile away,enjoy your live streaming.

Lcd Touch Screen For Live Broadcast,Mobile Live Broadcast Touch Screen,Lcd Touch Screen Live Streaming Display,Smart Digital Live Streaming Screen

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