Picaxe 40X1 and MDFLY AU5120

Krafter

Member
Hi everyone. This is my first post and my first project with a picaxe and an mdfly AU5120 mp3 player. I am familiar with programming, serial comms and basic electronics but I can't seem to get this thing to work. I'm sure I'm just not doing something right and that's why I'm here. Any help would be great.

As I said, I can't seem to get this thing to play. Right now, I have the player plugged into a set set of PC speakers and it's not doing anything. I currently have pin 7 (TX) of the 40X1 going to pin 16 (RX) of the mdfly. I wrote the following code just to try and get the thing to do something.

Code:
serout 7, 4800, ($EF)
pause 1000

main:

serout 7, 4800, ($001)
pause 500
As I understand it, though I may be wrong, "serout 7, 4800, ($XX)" should send that Hex string through the serial port of the picaxe to the player. Is this correct? If not can someone point me in the right direction? I have been using this video as a reference though he's using a different chip.

edit: I got it working! I obviously have a lot to learn about a picaxe. I didn't realize that the outputs are not only digital but they can also be a serial out. I moved the wire from pin 7 to pin 34 and modified the code from serout 7 to serout b.1 and it played!
 
Last edited:

1968neil

Senior Member
Code:
Symbol Voice_Out     = C.7   ' Set Output pin for Audio Module
Symbol VoiceBaud     = T4800 ' Set Baud Rate for Audio Module
Symbol Voice_wait    = pinC.5' Define busy line input 
Symbol Voice_Delay   = 500   ' Define delay value





Initialise_Voice_Module:                         ; 

serout Voice_Out, VoiceBaud, ($EF) ; STOP Voice module                   
pause 500
serout Voice_Out, VoiceBaud, ($E6) ; Set Voice volume level
pause 500
serout Voice_Out, VoiceBaud, ($F1) ; Set Voice volume level

Main:

serout Voice_Out,VoiceBaud, ($01)   ; Run Voice Command
do
 if voice_wait = 1 then exit ; wait until voice module has finished
loop

Goto main

The code above shows you how to use the busy line and how to initialise the module before use, this may save you some headaches :)
Its a good little module and I use it quite a bit myself, There is a few good threads in the forum to read, Some SD cards don't work too well and sorting the files on the card using "DriveSort" will help.
Enjoy
Regards
1968neil
 

Krafter

Member
Thank you very much. Your code will save me some programming. I was already using the busy pin to prevent another command from being issued but I was doing it a much different way. Your sample is much cleaner.

I only have one file playing right now but if I run into sorting issues then I'll be sure to checkout"DriveSort"

Thanks again. I'm really beginning to love my picaxe! This thing is just frigging awesome!
 
Top