Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

DFPLAYER Mini Adafruit

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
mansur

Bascom Member



Joined: 21 Feb 2013
Posts: 37
Location: Jakarta

indonesia.gif
PostPosted: Sat Oct 06, 2018 11:21 pm    Post subject: DFPLAYER Mini Adafruit Reply with quote

Please use 10K resistor from microcontroller to module (series), if not, your module will be noised.
Please read the pdf tutorial as attached carefully.
this is the sample code:

Code:

$regfile=\"m328pdef.dat\"
$crystal=16000000
$baud=9600

$hwstack = 32
$swstack = 32
$framesize = 32

Declare sub dfPlayer(byval command as byte, byval feedback as byte, byval para1 as byte, byval para2  as byte)

\'IO Button Configuration
config pinb.0 =input
playButton alias portb.0


\'Config Software UART for DFPlayer
wait 2
Open \"comd.7:9600,8,n,1\" For Output As #1

\'DFPlayer COMMAND
const NextCommand=&H01
const prevCommand=&H02
const specTracking=&H03
const volUp=&H04
const volDown=&H05
const specVol=&H06
const specEqu=&H07
const playMode=&H08
const specPlayback=&H09
const stbdyMode=&H0A
const Normal=&H0B
const ResetModule=&H0C
const playBack=&H0D
const pause=&H0E
const specFolderPlay=&H0f
const volAdjust=&H10
const repeatPlay=&H11

dfplayer specVol,0,0,30 \'adjust volume
waitms 200
dfplayer specEqu,0,0,0  \'adjust equalizer  normal
waitms 200

do
   if playButton=0 then
      dfplayer specFolderplay , 0,1,1     \'play folder 01  and 001.mp3
   end if
loop

sub dfPlayer(byval command as byte, byval feedback as byte, byval para1 as byte, byval para2  as byte)
   \'Format command in Hex ($S        Ver        Len        Cmd        Feedback        para1        para2        Checksum     $O)
   local _$S as byte, _ver as byte, _len as byte, _$O as byte
   local checksum_ as integer  , checksum1 as byte, checksum2 as byte
   _ver=&HFF
   _len=&H06
   _$O=&HEF
   _$S=&H7E
   checksum_=_ver+_len
   checksum_=checksum_+command
   checksum_=checksum_+feedback
   checksum_=checksum_+para1
   checksum_=checksum_+para2
   checksum_=0-checksum_
   checksum1=high(checksum_)
   checksum2=low(checksum_)
   print #1, chr(_$S);chr(_VER);chr(_LEN);chr(command);chr(feedback);chr(para1);chr(para2);chr(checksum1);chr(checksum2);chr(_$O); \'send command to dfplayer
end sub
 

_________________
Mansur. H
Automation & Instrument Engineer
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 827
Location: France

france.gif
PostPosted: Sun Oct 07, 2018 9:30 am    Post subject: Reply with quote

Hi,
Seems very interesting, did you do a video ?
Wink
JP

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
mansur

Bascom Member



Joined: 21 Feb 2013
Posts: 37
Location: Jakarta

indonesia.gif
PostPosted: Sun Oct 07, 2018 10:21 am    Post subject: Reply with quote

Hi,
i will post the video as soon. please take me time for make video.😁

_________________
Mansur. H
Automation & Instrument Engineer
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 4723
Location: Holland

blank.gif
PostPosted: Sun Oct 07, 2018 1:48 pm    Post subject: Reply with quote

thank you for sharing, a nice versatile player module indeed !
_________________
Mark
Back to top
View user's profile Visit poster's website
lslabs2005

Bascom Member



Joined: 28 Dec 2004
Posts: 57

PostPosted: Tue Apr 16, 2019 11:39 am    Post subject: dfplayer how to load mp3 files to NOR FLASH (64Mb) ? Reply with quote

hi, how to load mp3 files to NOR FLASH (64Mb) internal dfplayer
Back to top
View user's profile
O-Family

Bascom Member



Joined: 23 May 2010
Posts: 127
Location: Japan

japan.gif
PostPosted: Tue Apr 16, 2019 2:07 pm    Post subject: Reply with quote

It copies MP3 files to SD card or NOR type flash memory (SPI) using PC.
By the way, USB memory can also be used.
However, since the DFPlayer Mini's [YX5200-24SS] chip is compatible with [KT403A], SPI may not work.

http://translate.google.com/translate?hl=ja&sl=auto&tl=en&u=http%3A%2F%2Fwww.ne.jp%2Fasahi%2Fshared%2Fo-family%2FElecRoom%2FAVRMCOM%2FMP3module%2FMP3module.html&sandbox=1
http://www.ne.jp/asahi/shared/o-family/ElecRoom/AVRMCOM/MP3module/MP3module.html

https://www.youtube.com/watch?v=miCwtyQiUFk&feature=youtu.be
Back to top
View user's profile Visit poster's website
six1

Bascom Expert



Joined: 27 Feb 2009
Posts: 519

germany.gif
PostPosted: Wed Apr 17, 2019 6:11 am    Post subject: Reply with quote

@O-FAMILY *LIKE* Cool
_________________
For technical reasons, the signature is on the back of this message.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum