USB-SD MP3 Module Manual

USB-SD MP3 Module Manual

www.elechouse.com

USB-SD MP3 Module Manual

WT9501M03 www.elechouse.com

Copyright reserved by elechouse

www.elechouse.com

Features

 Can play 8 ~ 320Kbps MP3 audio files;

 Support maximum capacity of 32G Byte SD card;

 Support USB flash disk and SD;

 Support key mode and serial control mode;

 Support direct audio playback of any section;

 Power memory function can be customized (mass order);

 Optional built-in Class D amplifier (3W × 1) output;

 Size: 41mm × 39mm

 Operating voltage: DC5V

 Quiescent Current: 20mA

 Maximum operating current: 70mA

Pin Function

10

11

12

13

14

15

16

17

18

4

5

6

7

8

9

No.

1

2

3

Pin Name

GND

VCC

L

GND

R

GND

GBUF

TXD

P06

RXD

P05

EN

P04

NC

P03

NC

P02

3V3

Functional Description

GND

DC5V input

Audio left output

Power ground

Audio right output

Power ground

Audio ground

Serial data transmitter

I / O port

Serial data receiver

I / O port

Power Enable

I / O port

Vacant (Reserved)

I / O port

Vacant (Reserved)

I / O port

DC3.3V Output

19

20

21

22

23

24

25

26

www.elechouse.com

P01

/ RST

BUSY

GND

USB_D +

GND

USB_D-

USB_VDD

Difference between GBUF and GND will be explained later

I / O port

Reset pin

Busy signal, the output is low when playing

Power ground

USB_D +input

USB ground

USB_D-input

USB Power

23 to 26 pin can be used as USB flash disk data pins, also SD card data pins.

SD card format: FAT or FAT32

SD card and USB flash file

SD card connection

WT9501M03 has SD card slot.

USB flash disk connection

Connection diagram is shown below.

SD serves as USB storage media

When the SD card is inserted in WT9501M03 module, it can be connected to a computer via

USB cable, downloading or upload files.

www.elechouse.com

SD card and USB flash file storage

Mp3 files are stored in root directory of SD card or USB flash, and the file name should begin with 5 digits, such as 00001.mp3, 00002.mp3 and so on. Support maximum 10,000 segments of audio in the SD card and USB flash. However, the more the number of audio files, the longer the time from the trigger to play.

Working Mode

Key mode

In standard mode, I / O P01 ~ P06 is high while standby, negative pulse of 10ms will trigger the pins.

I/O port P01 P02

Features

Play/Pause Last

P03

Next

P04

VOL +

P05

VOL-

P06

Stop

Note: After power on or reset, the first time triggering the play/pause button will make play/stop action, and the subsequent triggering will be play/pause.

Serial mode

UART serial communication is based on 9600 baud rate. The following communication protocol is defined, including start code, data length, operating code, data bits and stop code.

Start Data Operation Ten thousands Thousands Hundreds End

Tens digit Units digit code length code digit digit digit code

7E 07 XX XX XX XX XX XX 7E

Operation code description

Type

SD Card

Description

Play (SD card)

Pause (SD card)

Play from the pause point (SD card)

Cease (SD card)

Volume

Last

Operation code Operation data

A0H xx xx xx xx xx

A1H None

A2H

A3H

A4H

A5H

None

None

XX

None

www.elechouse.com

USB

Flash

Next

Play one without cycle

Play all in cycle

Play one in cycle

Play (USB flash)

Pause (USB flash)

Play from the pause point (USB flash)

Cease (USB flash)

Volume

Last

Next

Play one without cycle

Play all in cycle

Play one in cycle

A6H

A7H

A8H

A9H

B0H

B1H

B2H

B3H

B4H

B5H

B6H

B7H

B8H

B9H

None

None

None

None xx xx xx xx xx

None

None

None

XX

None

None

None

None

None

Operation code A0 (SD card), B0 (USB flash), the volume A4 (SD card), and B4 (USB flash) need operation data, and the other commands do not need.

WT9501M03 can automatically recognize the MP3 files in SD card and USB flash. It assigns the file number according to creating time of files. File number is a 5-digit number. And this module reads file name in ASCII code. For example: 00045.mp3

 Ten thousands digit is "0", and the ASCII code is "30H"

 Thousands digit is "0", and the ASCII code is "30H"

 Hundreds digit is "0", and the ASCII code is "30H"

 Tens digit is "4", and ASCII code is "34H"

 Units digit is "5", and ASCII code is "35H"

Start code: 7E

Data Length: the total number of bytes excluding the start code and end code, but including

Data Length itself.

End code: 7E

Play Specific Track

If need to play the 45 th

track in SD card, send the data as follows:

Start Data Operation Ten thousands Thousands Hundreds code length code digit digit digit

Tens digit

34 7E 07 A0 30 30 30

If need to play the 45 th

track USB flash, send the data as follows

Start Data Operation Ten thousands Thousands Hundreds code length code digit digit digit

Tens digit

Units digit

35

End code

7E

Units digit End code

7E 07 B0 30 30 30 34 35 7E

If WT9501M03 contains files both in SD card and USB flash, it can switch playing file from SD card to USB or the reverse. Delay might happen after the demand is sent, depending on the file numbers in the media.

Pause

Pause to play files in SD card:

Start code Data length

7E 02

Pause to play files in USB flash:

Start code Data length

7E 02 www.elechouse.com

Operation code

A1

Operation code

B1

Resume playing from the pause point

Resume playing files in SD card

Start code Data length

7E 02

Resume playing files in USB flash

Start code Data length

7E 02

Operation code

A2

Operation code

B2

End code

7E

End code

7E

End code

7E

End code

7E

Cease

Cease playing files in the SD card:

Start code Data length

7E 02

Cease playing files in USB flash:

Start code Data length

7E 02

Operation code

A3

Operation code

B3

End code

7E

End code

7E

Volume Adjustment

In the volume control command, there are 26 grades of volume from 00H to 19H. 00H is mute, and 19H is the highest.

Play SD card and adjust the volume, send the following data:

Start code Data length Operation code Volume value End code

7E 7E

Start code

07

Data length

A4

Play USB flash and adjust the volume, send the following data:

Operation code

XX

Volume value

XX

Note:

7E 07 B4

1. After powered on or reset, this command is invalid. You need to play the voice first and then send this command.

2. Sending the value greater than 19H, it will adjust the volume to maximum.

End code

7E

www.elechouse.com

Last

Play SD card content and switch to previous one, send the following data:

Start code Data length Operation code

7E 02 A5

Play USB flash content and switch to previous one, send the following data:

Start code Data length Operation code

7E 02 B5

End code

7E

End code

7E

Next

Play SD card files and switch to next one, send the following data:

Start code Data length Operation code

7E 02 A6

Play USB flash content and switch to next one, send the following data:

Start code Data length Operation code

7E 02 B6

End code

7E

End code

7E

Play one without cycle

Play SD card files, and stop playing after finishing the voice file. Send the following data:

Start code Data length Operation code End code

7E 02 A7 7E

Play USB flash files, and stop playing after finishing the voice file. Send the following data:

Start code Data length Operation code End code

7E 02 B7 7E

Play one in cycle

Play SD card files, and loop one. Send the following data:

Start code Data length Operation code

7E 02 A8

Play USB flash files, and loop one. Send the following data:

Start code Data length Operation code

7E 02 B8

Play all in loop

Play SD card files, and loop all. Send the following data:

End code

7E

End code

7E

Start code Data length www.elechouse.com

Operation code

7E 02 A9

Play USB flash files, and loop all. Send the following data:

Start code Data length Operation code

7E 02 B9

End code

7E

End code

7E

Return Code Description

Return Code is the reply after sending the command. It begins with 7E 7E. Data following the

7E 7E have meaning as follows:

Data Address

0X10

0X11

Value and function

High bit of current play address

Low bit of current play address

0X12

0x01: Play

0x02: Pause

0x03: Cease

0x04: Last

0x05: Next

0x06: Volume adjustment command (read volume value at address

0X15)

0x07: Reserved

0x08: LED display volume (V0-V25)

0x09: LED display song number

0x0a: LED display loop mode (invalid)

0x0b: Standard display (display the current song)

0x0c: Play one without loop

0x0d: Play all in circle

0x0e: Play one in circle

0x0f: LED numeric display off

0x10: LED numeric display on

0X13 0X XX LED display value (reserved)

0x01: play USB flash songs

0X14

0X15

0X16-0X1F

0x02: play SD card song

Volume, 0~25

Reserved

0X20 (return from here) High bit of current play address in USB flash

0X21

0X22

Low bit of current play address in USB flash

High bit of current play address in SD card

0X23

0X24

0X25

0X26

0X27

Low bit of current play address in SD card

0x00: No play

0x01: USB flash is playing

0x02: SD card is playing

High byte of MP3 file total numbers

Low byte of MP3 file total numbers

Reserved

www.elechouse.com

0X28

0X29

Volume, 0~25

0x02: Play all in circle

0x03: Play one without loop

0x04: Play one in circle (forced to 03 after powered on)

0X2A

0X2B

0X2C

0X2D

0X2E

0x08: LED display the volume

0x09: LED display song number

0x0a: LED display cycle model

0x0b: Standard display (display the current song)

The number LED displays, 0~99(invalid, always 0x10)

0x01: USB flash connected

0x02: No USB flash connected

0x01: SD card connected

0x02: SD card flash connected

0x01: Now Playing

0x02: Now Paused

0x03: Now Ceased

0X2F

0X30-0X4F

Reserved

The name of the currently playing music file

Note: Return code in orange-marked row might have error

Application Circuit key mode application circuit

L, R and GND connect to headphones, and audio line output requires series with 100uF capacitor.

L, R and GBUF connect to headphone:

www.elechouse.com

L, R GND connect to external amplifier (GBUF is not recommended):

MCU control mode application circuit

L, R and GND connect to headphones, and audio line output requires series with 100uF capacitor.

L, R and GBUF connect to headphone:

L, R GND connect to external amplifier (GBUF is not recommended):

Package dimensions

www.elechouse.com

Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement