PDA

View Full Version : MP3 DFPlayer Mini and PIC MCU



nomada
- 27th June 2018, 10:05
Hello to all

Does anyone in this knowledge comunnity ever used an MP3 player like "FN-M16P Embedded MP3 Audio Module" and did successfully controlled the player with a (any) PIC MCU.

Thanks in advance

Vicente

Dave
- 27th June 2018, 11:58
This is real interesting. It looks to be rather straight forward to operate.

aerostar
- 27th June 2018, 19:38
I have used this http://geekmatic.in.ua/pdf/Catalex_MP3_board.pdf

ebay

https://www.ebay.co.uk/itm/Wemos-YX5300-UART-TTL-Serial-Control-MP3-Music-Player-Module-Support-Micro-SD-SD/222922684633?hash=item33e73a38d9:g:9V0AAOSwatda0Od b

TTL 3.3-5v

Made a speaking clock with it, also used some other similar modules but not tried yours.

Just found my youtube link to it

https://www.youtube.com/watch?v=8m4U6P4KARU&feature=youtu.be

forget what account I had used !!

Ioannis
- 28th June 2018, 08:10
Are DFPlayer and FN-16 the same one?

Anyway, here are my snippets using the DFPlayer module:



'Set volume
hserout [$7e,$ff,$06,$06,$00,$00,$07,$fe,$ee,$ef] 'Volume 7/30

pause 500

'Play track 3
hserout [$7e,$ff,$06,$03,$00,$00,$03,$fe,$f5,$ef] 'Play 3rd track in folder 00. Dial tone
......
hserout [$7e,$ff,$06,$03,$00,$00,$02,$fe,$f6,$ef] 'Play error tone, 2nd track in folder 00

error:
hserout [$7e,$ff,$06,$03,$00,$00,$01,$fe,$f7,$ef] 'Play message, 1rst track in folder 00
......

start1:
hserout [$7e,$ff,$06,$11,$00,$00,$00,$fe,$ea,$ef]' Stop playing
.......


The above are part of a bigger program but you get the idea of using volume and play/stop commands.

Ioannis

nomada
- 28th June 2018, 09:24
Hello to all

Ionnis you are right, soon after I started this thread, I have found that when I ordered the FN-M16P, the module I received is identified as DFPlayer Mini SKU DFR0299 or SKU 204222 depending on the supplier.

I've tried the module and it seems to work nice (for the price), the stereo hearphones out has a very good quality not so good is the 3W powered output (mono out).

If any of you plan to use this module do not use checksum and try each module to check if returns the power-on status, if not discard the module because it will never work good.

Thank you (obrigado!) to you all for your replies and contribution - Dave Purola - aerostar - Ioannis

Vicente

CuriousOne
- 13th June 2021, 08:17
Is it possible to use it with software serial port, instead of hserout?

CuriousOne
- 13th June 2021, 08:18
And how big is delay?
These modules also support WAV file playback, so my idea is to load a bunch of samples, say 32 different wav files, and create music keyboard :)

Ioannis
- 13th June 2021, 14:31
The module does not care if you use Serout or Hserout as long the command syntax is correct.

So, the answer is yes, you can use it just fine.

Ioannis

CuriousOne
- 23rd February 2022, 05:15
https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299

Anyone implemented "query number of files" function?
I want to add this to alarm clock, as alarm tone storage, so user should get number of files, to properly choose the desired tone.

CuriousOne
- 27th February 2022, 14:59
I have it running with software serial port, but facing some issues.

Based on code above:



serout portc.5,t9600, [$7e,$ff,$06,$06,$00,$00,$07,$fe,$ee,$ef]
pause 500
serout portc.5,t9600, [$7e,$ff,$06,$03,$00,$00,$02,$fe,$f6,$ef]


This works, however, it requires at least 500ms pause between each statements, or they're ignored.
Is this normal?
also, I have read the datasheet, but can't understand, which bit, based on which logic I should change in code above, to select another track, or change volume?

for example, in this code, posted above, which selects #3, #2, #1 songs in a folder, I can clearly see



hserout [$7e,$ff,$06,$03,$00,$00,$03,$fe,$f5,$ef]
hserout [$7e,$ff,$06,$03,$00,$00,$02,$fe,$f6,$ef]
hserout [$7e,$ff,$06,$03,$00,$00,$01,$fe,$f7,$ef]



But why there are $F5, $F6, $F7 bytes also changing at the end of the code?

mark_s
- 27th February 2022, 18:06
I have read the datasheet, but can't understand, which bit, based on which logic I should change in code above, to select another track, or change volume

Looking at the data sheet page 6, in post #1.

Play a track 7E FF 06 14 00 10 FF FD D8 EF , without checksum 7E FF 06 14 00 10 FF EF 10 FF = folder 1 track 255, The upper nibble "1" specifies the folder. The lower 3 nibbles are the track number so F1 11 would be folder 15, track 273

Volume change the 1E byte from 0 to FF to set the valume

Specify volume 7E FF 06 06 00 00 1E FE D7 EF , without checksum 7E FF 06 06 00 00 1E EF Specified volume is level 30 =0X1E


But why there are $F5, $F6, $F7 bytes also changing at the end of the code?

Looking at the data sheet again

There are to two ways to send a command, one with checksum 10 bytes and the other without checksum 8 bytes.

CuriousOne
- 27th February 2022, 18:15
Thanks, to which datasheet you refer to? My module is different, sorry for confusion. I'm using this: https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299
And how to play without any folder at all? i.e. all files are just on the SD card?

mark_s
- 27th February 2022, 18:57
See the PDF file in the first post of this thread. It looks like the same module as you have. As far as folders for mp3, I have no knowledge. Maybe you can can use 0?

CuriousOne
- 27th February 2022, 19:07
Thanks! I've sorted it out and using now without checksum and it works fine.
However, the issue with slow acceptance of statements persists...