DF Player Mini mp3 how drove it by pic16f88 by UART APPEND
DF Player Mini mp3 how drove it by pic16f88 by UART APPEND
Hello to MikroElectronic People
I rewrote together XmaxPako the WTV020-sd ad4 player module library in basic code in Lib Stock..........
Now I bought a DF Player Mini mp3 module but i have more problems to rewrite the pic basic driver code for this new Mp3 audio module.
There's a Arduino C Code in a web yet but not in Microbasic or MikroC code.
My Idea is Connect this module to the 16f88 pic using RB5 and RB2 as Pin UART Communication and Rewrite the Cod Basic and C Pic.
In Attacment there's DF Player Mini mp3 module documentation and some example about Arduino Code library, if someone read this post could me reply and help me?
Thank you so much.
my code is this but not work:
' ****************************************************************************
' UART pins is RB5 and RB2
'--> RB5/SS/TX/CK
'--> RB2/SDO/RX/DT
'-------------------------- SOME COMMAND EXAMPLES ----------------------------
'example 7E FF 06 03 00 00 01 FF D5 EF --> Play First song 001.mp3
'Send_Buffer[3]=0x03 Send_Buffer[6]=0x01
'example 7E FF 06 06 00 00 0F FF D5 EF --> set Volume to 15
'
' For example, select the first song played, serial transmission section: 7E FF 06 03 00 00 01 FF E6 EF(last FF and E6 isn't correct, some people suppose !!!! i don't know)
become >>> 7E FF 06 03 00 00 01 FE F7 EF
' 7E --- START command
' FF --- Version Information
' 06 --- Data length (not including parity)
' 03 --- Representative No.
' 00 --- If need to acknowledge [0x01: need answering, 0x00: do not need to return the response]
' 00 --- Tracks high byte [DH]
' 01 --- Tracks low byte [DL], represented here is the first song played
' FF --- Checksum high byte
' E6 --- Checksum low byte
' EF --- End Command
'
' For selections, if choose the 100th song, first convert 100 to hexadecimal, the default is double-byte, it is
' 0x0064.
' DH = 0x00; DL = 0x64 ----Command----> 7E FF 06 03 00 00 64 FF D5 EF
' If you choose to play the 1000th, first convert 1000 to hexadecimal, the default is double-byte, it is 0x03E8
' DH = 0x03; DL = 0xE8 ----Command----> 7E FF 06 03 00 03 E8 FF D5 EF
'
' For example, specify the volume to 15, serial port to send commands: ----- Command ------> 7E FF 06 06 00 00 0F FF D5 EF
' DH = 0x00; DL = 0x0F, 15 is converted to hexadecimal 0x000F, can refer to the instructions of playing, track section.
'
' Specify playback device –TF Card -----Command----> 7E FF 06 09 00 00 02 xx xx EF
' Specify folder 01 of 001.mp3 -----Command----> 7E FF 06 0F 00 01 01 xx xx EF
' Specify folder 11 of 100.mp3 -----Command----> 7E FF 06 0F 00 0B 64 xx xx EF
'
'*****************************************************************************
program DFPlayerMiniMp3Serial
' Declarations section
dim Send_Buffer as byte[10]
'=============================================================================
sub procedure Select_Ts_Source
dim i as byte
' ARRAY COMMAND to Set source from TF memory
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x09
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x02
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
UART1_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
sub procedure Play_first_song()
dim i as byte
' ARRAY COMMAND to set the first Song.mp3
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x03
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x01
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xD5
Send_Buffer[9] = 0xEF
delay_ms(5000) ' wait some second before send the command
for i=0 to 9
UART1_Write(Send_Buffer)
next i
end sub
main:
' Main program
delay_ms(500)
UART1_Init(9200) ' Initialize USART
Select_Ts_Source
Play_first_song
end.
===================================================================================
====================== ALTERNATIVE PROGRAM =============================================
===================================================================================
***************** The program don't work *******************
program DFPlayerMiniMp3Serial
' Declarations section
dim Send_Buffer as byte[10]
sub procedure Select_Ts_Source
dim i as byte
' ARRAY COMMAND Select TS card
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x09
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x02
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
Soft_UART_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
sub procedure Play_first_song()
dim i as byte
' ARRAY COMMAND to play first Song
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x03
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x01
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
Soft_UART_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
main:
' Main program
delay_ms(500) ' wait some second before send the command
Soft_UART_Init(PORTB, 2, 5, 9600, 1) ' using this istruction i can decide what pin will be Tx and RX, the speed and signal level trasmition
Select_Ts_Source
Play_first_song
end.
I rewrote together XmaxPako the WTV020-sd ad4 player module library in basic code in Lib Stock..........
Now I bought a DF Player Mini mp3 module but i have more problems to rewrite the pic basic driver code for this new Mp3 audio module.
There's a Arduino C Code in a web yet but not in Microbasic or MikroC code.
My Idea is Connect this module to the 16f88 pic using RB5 and RB2 as Pin UART Communication and Rewrite the Cod Basic and C Pic.
In Attacment there's DF Player Mini mp3 module documentation and some example about Arduino Code library, if someone read this post could me reply and help me?
Thank you so much.
my code is this but not work:
' ****************************************************************************
' UART pins is RB5 and RB2
'--> RB5/SS/TX/CK
'--> RB2/SDO/RX/DT
'-------------------------- SOME COMMAND EXAMPLES ----------------------------
'example 7E FF 06 03 00 00 01 FF D5 EF --> Play First song 001.mp3
'Send_Buffer[3]=0x03 Send_Buffer[6]=0x01
'example 7E FF 06 06 00 00 0F FF D5 EF --> set Volume to 15
'
' For example, select the first song played, serial transmission section: 7E FF 06 03 00 00 01 FF E6 EF(last FF and E6 isn't correct, some people suppose !!!! i don't know)
become >>> 7E FF 06 03 00 00 01 FE F7 EF
' 7E --- START command
' FF --- Version Information
' 06 --- Data length (not including parity)
' 03 --- Representative No.
' 00 --- If need to acknowledge [0x01: need answering, 0x00: do not need to return the response]
' 00 --- Tracks high byte [DH]
' 01 --- Tracks low byte [DL], represented here is the first song played
' FF --- Checksum high byte
' E6 --- Checksum low byte
' EF --- End Command
'
' For selections, if choose the 100th song, first convert 100 to hexadecimal, the default is double-byte, it is
' 0x0064.
' DH = 0x00; DL = 0x64 ----Command----> 7E FF 06 03 00 00 64 FF D5 EF
' If you choose to play the 1000th, first convert 1000 to hexadecimal, the default is double-byte, it is 0x03E8
' DH = 0x03; DL = 0xE8 ----Command----> 7E FF 06 03 00 03 E8 FF D5 EF
'
' For example, specify the volume to 15, serial port to send commands: ----- Command ------> 7E FF 06 06 00 00 0F FF D5 EF
' DH = 0x00; DL = 0x0F, 15 is converted to hexadecimal 0x000F, can refer to the instructions of playing, track section.
'
' Specify playback device –TF Card -----Command----> 7E FF 06 09 00 00 02 xx xx EF
' Specify folder 01 of 001.mp3 -----Command----> 7E FF 06 0F 00 01 01 xx xx EF
' Specify folder 11 of 100.mp3 -----Command----> 7E FF 06 0F 00 0B 64 xx xx EF
'
'*****************************************************************************
program DFPlayerMiniMp3Serial
' Declarations section
dim Send_Buffer as byte[10]
'=============================================================================
sub procedure Select_Ts_Source
dim i as byte
' ARRAY COMMAND to Set source from TF memory
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x09
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x02
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
UART1_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
sub procedure Play_first_song()
dim i as byte
' ARRAY COMMAND to set the first Song.mp3
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x03
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x01
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xD5
Send_Buffer[9] = 0xEF
delay_ms(5000) ' wait some second before send the command
for i=0 to 9
UART1_Write(Send_Buffer)
next i
end sub
main:
' Main program
delay_ms(500)
UART1_Init(9200) ' Initialize USART
Select_Ts_Source
Play_first_song
end.
===================================================================================
====================== ALTERNATIVE PROGRAM =============================================
===================================================================================
***************** The program don't work *******************
program DFPlayerMiniMp3Serial
' Declarations section
dim Send_Buffer as byte[10]
sub procedure Select_Ts_Source
dim i as byte
' ARRAY COMMAND Select TS card
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x09
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x02
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
Soft_UART_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
sub procedure Play_first_song()
dim i as byte
' ARRAY COMMAND to play first Song
Send_Buffer[0] = 0x7E
Send_Buffer[1] = 0xFF
Send_Buffer[2] = 0x06
Send_Buffer[3] = 0x03
Send_Buffer[4] = 0x00
Send_Buffer[5] = 0x00
Send_Buffer[6] = 0x01
Send_Buffer[7] = 0xFF
Send_Buffer[8] = 0xE6
Send_Buffer[9] = 0xEF
for i=0 to 9
Soft_UART_Write(Send_Buffer)
next i
delay_ms(500) ' wait some second before send the command
end sub
main:
' Main program
delay_ms(500) ' wait some second before send the command
Soft_UART_Init(PORTB, 2, 5, 9600, 1) ' using this istruction i can decide what pin will be Tx and RX, the speed and signal level trasmition
Select_Ts_Source
Play_first_song
end.
- Attachments
-
- Schema Elettrico sistema df Player e 16f88.jpg (123.53 KiB) Viewed 13960 times
-
- DFPlayer_Mini_Mp3 Documents.zip
- (2.71 MiB) Downloaded 783 times
Last edited by leo73 on 08 Nov 2016 12:13, edited 2 times in total.
-
- Posts: 15
- Joined: 21 Aug 2015 14:43
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
Yes it work, search the code in libstok site too.
-
- Posts: 15
- Joined: 21 Aug 2015 14:43
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
ı cant find libstock about df mını player can you send me link?
-
- Posts: 15
- Joined: 21 Aug 2015 14:43
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
by the way ı was find but it is not df mını player
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
Haaa no no , i'm sorry the code not work, i'm seaching to write a right code for this device !!!!
did you have some idea about this ??
It's passed many time about this problem, if you want i could search some arduino code and traslate it with you !!!
did you have some idea about this ??
It's passed many time about this problem, if you want i could search some arduino code and traslate it with you !!!
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
Or if you not need HI-FI application you can take this library:
https://libstock.mikroe.com/projects/vi ... 7-feb-2016
This is a drive for wtv020-sd device , you can play .ad4 audio file, it used for robots.
https://libstock.mikroe.com/projects/vi ... 7-feb-2016
This is a drive for wtv020-sd device , you can play .ad4 audio file, it used for robots.
-
- Posts: 15
- Joined: 21 Aug 2015 14:43
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
thanks a lot but ı cant to again have ı use max232? ıf honestly ı want to write library for df mini player on micro c . but ı cant change arduıno library to micro c
can you guide for me ?
can you guide for me ?
Re: DF Player Mini mp3 how drove it by pic16f88 by UART Help
Hi craftsman42
I''m tryed to traslate code another time (from arduino c) but the code don't work, we need some-one else us in this forum.
I put in attachment My code and Arduino so some-one can compare and understand were is the problem.
For a moment you can print the code below and compare, after see me your thinking !!!!!
I''m tryed to traslate code another time (from arduino c) but the code don't work, we need some-one else us in this forum.
I put in attachment My code and Arduino so some-one can compare and understand were is the problem.
For a moment you can print the code below and compare, after see me your thinking !!!!!
- Attachments
-
- DF Player Mini mp3 Commands.pdf
- DF Player Mini mp3 Commands
- (920.8 KiB) Downloaded 851 times
-
- DFPlayer-Mini-mp3 CPP.pdf
- Arduino df-player library C language
- (457.84 KiB) Downloaded 573 times
-
- DFPlayer_Mini_Mp3Ver1.zip
- Mikro C code DF-Player audio mp3 device.
- (30.03 KiB) Downloaded 552 times
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
The pdf manual contains a lot of errors and things missing.
I'm writting a solution for PIC18F46K22, and when I finish, I`m gonna post here.
I'm writting a solution for PIC18F46K22, and when I finish, I`m gonna post here.
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
I'm using DFPlayer with a PIC18F46K22.
The first thing that I discovered was that its manual has a lot of errors.
Second is that the application circuit in the manual has some problems like potential difference (on GND).
I'll post some tips and tricks using this audio module later.
The first thing that I discovered was that its manual has a lot of errors.
Second is that the application circuit in the manual has some problems like potential difference (on GND).
I'll post some tips and tricks using this audio module later.
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
Ok Xvinny we'll wait
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
Hello Xvinny,
What about the manuals i understood the problem, because today the manuals is wrote quickly and there's a lot of mistakes and no examples. This is one of reason because is hard to understand how program or use the electronic chips.
What about the manuals i understood the problem, because today the manuals is wrote quickly and there's a lot of mistakes and no examples. This is one of reason because is hard to understand how program or use the electronic chips.
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
viewtopic.php?f=88&t=70332leo73 wrote:Hello Xvinny,
What about the manuals i understood the problem, because today the manuals is wrote quickly and there's a lot of mistakes and no examples. This is one of reason because is hard to understand how program or use the electronic chips.
Re: DF Player Mini mp3 how drove it by pic16f88 by UART APPE
Thanks to everyone for the useful info. I'm also running a PIC16F88 controlling a DFPlyer mini.