Mdfly Au5016

Randy5140

Member
Hello All!

Hope I am not rehashing something that has already been posted.

Today in the post I received a package from Mdfly, it appears they have a new SD\SDHC Card MP3 Module.

The model number is AU5016.

As I just received it today I haven't had any time to work with it. And I may not for the next three weeks as I will be out of town at a fly-in.

Anyway,, with all the excitement over the other mp3 modules I thought I would let you all know...

You can go to the Mdfly web site and do a search for the above model number. There is a data sheet available,,

Well,, Just thought I would let you all know..

Later!
Randy
 

Jeff Haas

Senior Member
It is new, the date on the datasheet is this month. I'd guess they realized that they were selling a lot of microcontroller-friendly MP3 modules and decided to make their own. The docs show that controlling it will be similar to the Tenda boards, all done via serial commands.
 
Has anyone made one of these work?
I am trying to trigger it to play the first file as follows:

Serout c.6, T4800_4, (0x01)

I have only the 5v, ground and RXD pins connected (the audio pins are connected to headphones)
The player will play a file when the P/P pin is grounded so I know the player works and the file (and name) is OK....

I know the trigger is being picked up as I flash an LED after the serout command.

Any guidance that can be provided would be helpful...
 

zenaerostar

New Member
Has anyone made one of these work?
I am trying to trigger it to play the first file as follows:

Serout c.6, T4800_4, (0x01)

I have only the 5v, ground and RXD pins connected (the audio pins are connected to headphones)
The player will play a file when the P/P pin is grounded so I know the player works and the file (and name) is OK....

I know the trigger is being picked up as I flash an LED after the serout command.

Any guidance that can be provided would be helpful...
MDfly have different modules - I do not know which you have but if it is the one with pins on 3 sides then the following should apply.

However 2 things the default Baud rate is 9600 and you need to send 2 bytes not just one, first byte is the index eg 1 2nd byte is the file number. page 9 of the pdf. http://mdfly.net/Download/Module/AU5016.pdf.


I have just got mine but not had chance to try it**** - I have tried the Seedstudio version and - so far the Seedstudio has proved to be better quality sound.

The other is another MDFLY with pins down one side and I found the quality on that one not as good - especially with single words or short phrases.

I am using a module for a speaking clock the RF interference from the 3 sided pin on is quite bad at 60khz, the receive frequency - the one with pins down one side is fine.

I am using PIC 16f628a and programming in Melabs Picbasic Pro.


I send 1,1 for track one and 1,70 for track 70 (decimal), 70(decimal) is in hex is 46. eg HSEROUT [1,70]

*** Since writing the above, I have had a quick go, and it is 9600 baud, and does seem work with 2 bytes -for addressing - I will be doing some more over the weekend and will post here what I find.

Am using a PIC so did not read about Picaxe and it's syntax - have now had a quick scan and I think you need

Serout c.6, T9600_8, (1,1) but take with a pinch of salt !
 
Last edited:
Well it is my first Picaxe (and micro controller project).

I realize the default baud rate for the audio board is 9600 but in the initialization code I send the command to drop it to 4800

Any example of syntax to replace Serout c.6, T4800_4, (0x01) assuming I wish to send the message out pin C.6.

Is Serout c.6, T4800, (1,1) correct?
 

Jeff Haas

Senior Member
Here's a short program to test the Tenda board. This is something I put together for the 08M2. To test, copy three MP3 files onto the SD card. Then sort the FAT on the SD card using Drivesort, and finally put the SD card into the Tenda board. Using DriveSort is very quick and will save you all kinds of confusion.
Link to DriveSort.

Code:
; *******************************
;    Filename: 08M2 Tenda basic code		
;    Date: 			
;    File Version: 	
;    Written by: Jeff Haas		
;    Function: Quick test of Tenda MP3 board	
;    Last Revision: 7/8/2014
;    Target PICAXE: 08M2	
; ******************************* 
; Using Picaxe 08M Protoboard...
; Tenda hookup: Power goes to 08M2 5V
; Ground goes to 08M2 GND
; 08M2 serial pin (output from Picaxe) goes to Tenda pin 15 (RXD)
; Remove DEBUG statement to get rid of clicking sounds in speakers!


#Picaxe 08M2

Serout C.0,T4800,(0xEF) 'STOP Tenda module before doing anything
Pause 1000
Serout C.0,T4800, (0xE1); 'Set MP3 volume
Pause 1000

Pause 1000
Serout C.0, T4800, (0x01) ' Play first file on SD card
Pause 6000
Serout C.0, T4800, (0x02) ' Play second file on SD card
Pause 6000
Serout C.0, T4800, (0x03) ' Play third file on SD card
Pause 6000
 

zenaerostar

New Member
Well it is my first Picaxe (and micro controller project).

I realize the default baud rate for the audio board is 9600 but in the initialization code I send the command to drop it to 4800

Any example of syntax to replace Serout c.6, T4800_4, (0x01) assuming I wish to send the message out pin C.6.

Is Serout c.6, T4800, (1,1) correct?
I assume you send the command to change the default baudrate at 9600 as if you send it at 4800 it won't work as it will not be understood.


Try the serout and see - I do not use picaxe so cannot really comment.

It would be better to show all your code so that those more familiar with picaxe can see if it is workable.
 

zenaerostar

New Member
I now have had chance to do some more tests, I mis-read the data sheet regarding sending 2 bytes for playing, it is only one byte - sorry for error.

I now have my speaking clock mostly working using the module, a pic and a UK MSF receiver, I use uart on pic for sending to announcer, and bit bang for the receiver as the pic I use is 16F628a and only has 1 hardware uart, however it still hic-cups even with the 100ms delay so more work needs to be done, the same program on another mp3 module works fine.

I also found that it seems a bit peculiar on playing one of the mp3 files, it would play it using the button controls but on serial command it refused, so I reconverted the wav file to mp3 and tried again, and that played serially and by button !!!



It has been a bit of a battle trying to use the busy signal - it seems to delay itself - although the led busy light seems OK.

So my SD card has the numbers 1 to 59 + extra files for "at the xxx tone"..."and 50secs" etc

On power up, just to make sure I send hex F1 to ensure that index 1 is used (not really necessary but belt and braces)

So to send the announcement At the third tone it will be 10:05 and 40 secs... then pips.

I send file 73 (HEX 49) pause 100millisecs to allow busy signal to react, then check if the board is busy, if so wait until free, then send file 10 (hex0a), pause/wait, send file 5 (hex 5), pause/wait, send file 63 (hex 3f), send file 78 (hex 4E)

Perhaps more to follow in due time.

Added

It seems that very short files ( the word "one" for example) cause a problem when requested by serial - though they play OK if using the Kbuttons - investigating further on this.
 
Last edited:

zenaerostar

New Member
I am rapidly coming to the conclusion that there is an inherrent
firmware problem with the serial routines in this chip.

I said I had some "hiccups" this is what I have found.

Reset the unit.

Use the K connections to play the first 8 files- work 100%

Send serial command to play files, 1 - fails, so do files 2-6, 7 plays and on until 32, 32 then plays file 48, and carries on 33 onwards, until it then misses files 64 and 65.

Run the sequence again and now it misses out 1-9, file 10 is ok and on until 32 as above etc.





I have been monitoring with a PC what the pic sends and the characters are sent correctly, I have also tried sending from a PC using USB to ttl serial adapter and I get the same errors.

I have checked the files on the SD card with drivesort and also tried another sd card, also both modules I have exhibit same problems.

If I get the module to play, without using serial command, all the files in seuence, then the playback is 100% correct !!!!

I will do some more testing when I get time, and will be contacting MDFLY about this.

To the original poster Palmdale Haunter I would think your non play of your file is the same problem as I have - perhaps if you are watching this thread you could let us know if you have had any success.


UPDATE....... SOLVED PROBLEM HOPEFULLY

The PDF is a bit vague about the TTL serial power connection, I did have it connected and tried disconnected but there was no change in operation.


I happened to change the cables to the board, I use the ones with single pin sockets on the end, and found that it started to work correctly...... looking at the cables I found that the VIO cable had a bad connection on one end, so was not always making a connection.

This was the cause of the serial errors. So make sure you have a voltage on that pin.

One other point on the Baud rate there is obviously a misprint, for 4800 and 9600 it says Hex D0, from the list I believe D0 should be for 4800 and D1 for 9600.

I will test other serial commands later this week and see if they all work.

Further updates at a later date.
 
Last edited:

zenaerostar

New Member
INDEX INFORMATION.

The PDF does not say much about the indexes. You cannot have more than 512 files in the root.

For a test, I made a new directory just named as 2, and put some music mp3s in there, making sure they were numbered and sorted correctly for that directory.

To switch to this, the stop (hex FA) command was sent (to stop anything that was playing), a pause, followed by hex F2 to select the new index.

Then sent play file 1 and on and the music files played correctly.
 

zenaerostar

New Member
There does not seem to be anyone following this thread as there have been no other postings other than my own since post 7 so I will call a halt to further updates on this and any other modules I have been trying.
 

westaust55

Moderator
@zenaerostart,

The absence of posts by others should not always be seen as lack of interest.

To date, there has been 653 views by at least 84 members so folks have been looking.

I have posted many "Getting Started . . ." type tutorials and informative threads in the past. Some may have several thoussand views but very limited posts by others. It is all helping to contribute to the PICAXE experience and build up a greater information base for others to glean from.

Feel free to continue posting your experiences. They may not be of immediate/instant need for others, but if you post schematics and example code these can be of interest and future to use to many.
One option is to develop a working project and post all the information you have acquired in the FINISHED Projects section.
 

john2051

New Member
Hi, thanks for the datasheet, at least I can read up on these, and who knows, maybe some other supplier may have some.
regards john
 

Masizemore

New Member
au5016 sequential play/baud question

I got three of these little guys, got the third one wired up tonight. My first picaxe/mdfly project but have most of it working (now that I let the magic smoke out of one of the darlington arrays :( ) My code does probably leave a little to be desired but hopefully makes sense so two questions in relation to this AU5016/picaxe:

1) anyone successfully got it to drop into 4800 baud so you don't have to overclock?
2) If you look at the subroutine randomback, I want to start on track 1 and go sequentially up through the number of tracks (the card has 21 tracks and a "haunt" speaking track which only plays when triggered. I am using the CHI030 boards so putting the serial out on C.2 which is prob a little abnormal but hey, it works. I can't get it to start on track 1 and can't 100% confirm it is sequential after that. Any ideas would be greatly appreciated, I have this base code now on 2 picaxe/au5016 combos.

Full code below
Code:
'Need to let it stabilize so pause 30
symbol numtrack = b0
let numtrack=21
symbol haunttrack = b1
let haunttrack=16 ' 23 hex
symbol BUSY=pinC.6
symbol TRIG=pinC.0
symbol curtrack = w1
let curtrack=100
'm4 is def clock speed, right now m8 needed for mp4
pause 60000

high c.2
pause 1000

setfreq M8 ' Set to 8Mhz to comm
pause 2000
gosub clickrelay 'flash lights to let know initialized

'
main:
if TRIG=1 then
	gosub trigger
elseif BUSY=0 then
	gosub randomback
	goto main
else
	goto main
endif
goto main


randomback:
let w0=numtrack
let curtrack = curtrack+1
if curtrack > numtrack then
	curtrack=1
endif
serout c.2,t9600_8,(curtrack) ' Play
'setfreq M4 ' Set back to 4Mhz for delays to be true
return

trigger:
'turn on lights
high b.0
' Send haunttrack
serout c.2,t9600_8,($FA) ' Stop MP3
pause 500
let w4=haunttrack
serout c.2,t9600_8,($16) ' Play
high b.5
let w3 = 16*1000*2
pause w3
'turn on fog
high b.6
let w3=13*1000*2
pause w3
'turn on motor
high b.7
do while BUSY=1
loop
' turn all off
gosub offall
pause 20000 'overclock so pause 10 sec to reset
return

offall:
low b.0
low b.6
low b.7
low b.5
return

clickrelay:
high b.0
pause 1000
low b.0
pause 1000
high b.0
pause 1000
low b.0
return
 

Jeff Haas

Senior Member
I gave this a quick go in the simulator.

If you do not click C.0 (the pin in the simulation window is grey, not yellow) then you can watch as the simulator steps through and flashes the lights, then goes to the randomback routine (the virtual serial port window will show this). It looks like it's starting at [01] and proceeding upward properly. You should have a list of the mp3s and check them off as they get played, that will tell you if you're getting what you want.

What is your trigger? A button, step pad, PIR...?

It's a bit hard for me to follow the code - I suggest you label the pins, it'll make reading your code easier (for us and for you, months from now!) And it makes it easier to move the pin connections around if you have to, you just change the definition at the top of the code. For example:

Code:
; Define pins
symbol LIGHTS = b.0          'Assigns b.0 to lights
symbol THING = b.5          'Assigns b.5 to ??
symbol FOG = b.6          'Assigns b.6 to fog
symbol MOTOR = b.7          'Assigns b.7 to motor
Then later you just do this:

Code:
'turn on lights
high LIGHTS

'turn on fog
high FOG
let w3=13*1000*2
pause w3
'turn on motor
high MOTOR
And later still:

Code:
offall:
low LIGHTS
low FOG
low MOTOR
low THING
return
 

Masizemore

New Member
Hey Jeff, thanks for the info. Yeah, I need to clean the code up a bit and put in more variables. I think the problem is I need to re-sort the mp3 card to get the sequence I want. I did learn more about how to use the simulator/term window for it to watch the values which let me figure out my mistake on using the haunttrack var in the trigger routine. Haven't decided if I want to fight the baudrate should just be a D0 command but tried once before (but tried about 2000 test lines before quit hanging it all up.

Thanks
Marc
 

Masizemore

New Member
Also Jeff, I apologize, the trigger is basically just a button (technically, another relay will make the contact)

Here is the cleaned up code, should make a little more sense. Thanks to yourself and all the others that have helped or had code samples to review and try.

Marc

Code:
; greeter.bas, a home haunt animatronic control program 
; utilizing a PICAXE 18M2 Chip, PICAXE-18 Project Board and a MDFLY AU5016 MP3 Player
; Copyright (C) 2014 Marc Sizemore

;    This program is free software: you can redistribute it and/or modify
;    it under the terms of the GNU General Public License as published by
;    the Free Software Foundation, version 3.

;    This program is distributed in the hope that it will be useful,
;    but WITHOUT ANY WARRANTY; without even the implied warranty of
;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;    GNU General Public License for more details.

;    See the GNU General Public License
;    at see http://www.gnu.org/licenses/

'define working vars
symbol numtrack = w0
symbol haunttrack = w5
symbol curtrack = w1
'define new names
symbol MPSERIAL=C.2
symbol MPBUSY=pinC.6
symbol MPBAUD=t9600_8
symbol MAINTRIG=pinC.0
symbol SPOTLIGHT=b.0
symbol FOGGER=b.6
symbol LEDEYES=b.5
symbol WIPER=b.7
'initialize variables
let numtrack=21
let haunttrack=22 ' 23 hex
let curtrack=100

'Need to let it MP3 stabilize so pause 60 second
'may not be needed for this but in tests was better
'safe then sorry
pause 60000

high MPSERIAL
pause 1000

setfreq M8 ' Set to 8Mhz to comm
pause 2000
gosub clickrelay 'flash lights to let know initialized

'
main:
	if MAINTRIG=1 then
			gosub trigger
		elseif MPBUSY=0 then
			gosub randomback
			goto main
		else
			goto main
	endif
goto main


randomback:
	'Rotate from 1 to number of tracks
	let curtrack = curtrack+1
	' if counter is greather than number of tracks, reset to beginning
	if curtrack > numtrack then
		curtrack=1
	endif
	' Send the track number to the MP3 to play
	serout MPSERIAL,MPBAUD,(curtrack) ' Play
return

trigger:
	'Runs the main haunt sequence
	'turn on lights
	high SPOTLIGHT 
	' Send haunttrack
	serout MPSERIAL,MPBAUD,($FA) ' Stop MP3
	pause 500	
	serout MPSERIAL,MPBAUD,(haunttrack) ' Play main haunt track
	'turn eyes on
	high LEDEYES
	' w3 is just used as a "holder" for the time to pause given the overclock
	let w3 = 16*1000*2
	pause w3
	'turn on fog
	high FOGGER
	let w3=13*1000*2
	pause w3
	'turn on motor
	high WIPER 
	do while MPBUSY=1
	loop
	' turn all off
	gosub offall 
	pause 20000 'overclocked so pause 10 sec to reset
return

offall:
	low SPOTLIGHT
	low WIPER
	low LEDEYES
	low FOGGER
return

clickrelay:
	'blink light twice
	high SPOTLIGHT
	pause 1000
	low SPOTLIGHT
	pause 1000
	high SPOTLIGHT
	pause 1000
	low SPOTLIGHT
return
 

Masizemore

New Member
Thanks, I have gotten a couple more revelations it wasn't my sort order on the card, it looks to be a bug in the mp3 player. Funny thing is I added the debug command to watch it live and it actually played track 1 for the first time. Took the debug command out and it started track 3 again. Added it back in and back to track 1 even if computer unplugged.:( Another tasty tidbit is that I went back to the mdfly site and the board is now nowhere to be found on the site, luckily the datasheet while not visible was accessible at http://mdfly.net/Download/Module/AU5016.pdf but no clue how much longer, again :(

Marc

New Code module
Code:
randomback:
	'Rotate from 1 to number of tracks
	let curtrack = curtrack+1
	' if counter is greather than number of tracks, reset to beginning
	if curtrack > numtrack then
		curtrack=1
	endif
	' Send the track number to the MP3 to play
	serout MPSERIAL,MPBAUD,(curtrack) ' Play
        debug
return
 

Masizemore

New Member
Makes perfect sense, that little time slice may be all it needs for the busy to go high. I was wondering if it was rolling past those tracks in error hence the debug. Will give that a shot tonight. Thanks Jim
 

zenaerostar

New Member
On my speaking clock, after I sent the serial command to play a track I had a subroutine that waits for the Busy flag, also similar routine before sending serial command

eg
send serial
pause 10
check Busy
If Busy is not Busy then stay in the loop below the pause.


You can then do your next bit of whatever

I suggest you add check the Busy before you send the serial command as well.

Here is my PicbasicPro code for the sub routines

WAIT4BUSY: ' AFTER SENDING SERIAL - PLAYER SLOW TO GO BUSY SO THIS WAITS FOR IT
pause 10 'millisecs
LOOPITHERE3:

IF MP3BUSY = 0 THEN LOOPITHERE3

RETURN





ANNOUNCERBUSY:

LOOPITHERE1:
IF MP3BUSY=1 THEN LOOPITHERE1
pause 10 ' a little breathing space for the unit
RETURN

------------------------------------------------------------
and here is how they are used.

IF SMIN=0 THEN
GOSUB ANNOUNCERBUSY 'check announcer has stopped playing previous track and is free for new command
HSEROUT [72] ' O'CLOCK send command

GOSUB WAIT4BUSY ' wait for announcer to start
----------------------------------------------------------
 

Masizemore

New Member
Hey Jim, that worked, appreciate it! Zenaerostar, great idea, I will definitely check it out.. Now if I can just figure out which MP3 I will use on the next project lol.
 

zenaerostar

New Member
I have tried

http://www.seeedstudio.com/depot/Grove-Serial-MP3-Player-p-1542.html?cPath=38

Works OK - howerver they did not bring out the busy line - just a led, but with a small fine tipped soldering iron you can attach a wire to the led - goes hi when active - only minor changes to code needed if I remember.


Have also tried

http://www.mdfly.com/products/sd-card-mp3-player-module-rs232-ttl.html

works OK as well - control set slightly different - default baud 4800.

If the chip on board is a WT5001 then here is the data sheet http://www.microelectronicos.com/datasheets/WT5001.pdf
I have the WT5001M02-28P but have not yet tried it.

Did a search on AliBaba for other modules - found this http://www.alibaba.com/product-detail/Mp3-Player-Module-RS232-Serial-Control_1563880542.html - states they will supply one off - price not shown.
 
Top