Cant get Grove MP3 Player to Work

MurrayJ

Senior Member
Hi all, Just received my AXE300 board and a few grove sensors to play around with, but I cant seem to get my MP3 board to make any sort of sound. I am using the standalone Blockly app for windows.

I assume you plug the MP3 board into the UART port (middle bottom of the board), but I have no idea about the sd card, I have tried putting the mp3 files in folders, not in folders, named them 001songname.mp3, 01songname.mp3 etc and nothing seems to work. What am I dong wrong?
 

MurrayJ

Senior Member
That did the trick, thanks Hippy, I was putting them in a folder called 01, which the Seeed pdf gave examples of.
 

hippy

Ex-Staff (retired)
That did the trick, thanks Hippy, I was putting them in a folder called 01, which the Seeed pdf gave examples of.
Thanks for letting us know and confirming that, and that the Grove MP3 setup, works.

It can be a bit of a pain trying to figure out exactly where things should go with multiple options and not always knowing which actually applies.
 

MurrayJ

Senior Member
Just another couple of questions I have. Can you use the Seeed MP3 board on one of the other connectors? As far as I can see there is only one UART connector and when I get things running correctly I wish to use a bluetooth board as well as the MP3 board. I thought a serout might work but I haven't had any luck getting it to go.

I have attached the simple program, but I am confused with many things - ASCII ticked or not, is the speed correct what pin B.0 or B.1 and the code is probably incorrect as well. Any advise to get it to work would be appreciated , or maybe it only works on the UART pin?

MP3-2.jpg
 

hippy

Ex-Staff (retired)
The in-buld Grove MP3 commands are sent via the UART and that's only available on specific pins -

Code:
hsersetup B9600_4, %000
hserout 0, ($7E, $FF, $06, $09, $00, $00, $02, $EF)	;initialise MP3
hserout 0, ($7E, $FF, $06, $12, $00, $00, 1, $EF)	;play
It should be possible to replicate that using Serial Output blocks on other pins. The problem comes in trying to get the data you need to send specified. Using "$7E, $FF..." will send "$" then "7" then "E" etc which are not the binary bytes you need to send.

The "Send as ASCII" option affects how a variable or number is sent when used instead of a text string; as a raw byte - SEROUT...(b0) - or as a printable number - SEROUT...(#b0).

You would need to replace your string "$7E..." with a sequence of number blocks and send them with "Send as ASCII" un-ticked -

Code:
.--__---------------------------------------.---------.
| serial output at [ T9600_8 ] on [ B.1 ] |\| ( $7F ) |
| [ ] send as ASCII                       |/|         |
}--__---------------------------------------+---------{
| serial output at [ T9600_8 ] on [ B.1 ] |\| ( $FF ) |
| [ ] send as ASCII                       |/|         |
`--__---------------------------------------^---------'
 etc
Blockly is intended for simple programs and it may be better to use the Basic programming language where things will be so much simpler.
 

MurrayJ

Senior Member
What about the Basic code box in Blockly? I have been trying to get that to work with the MP3 board as well without success.
 

hippy

Ex-Staff (retired)
What about the Basic code box in Blockly? I have been trying to get that to work with the MP3 board as well without success.
That should work.

Alternatively, if you go into code mode, replace the HSEROUT commands with the equivalent SEROUT commands, ensuring the TX pin is initialised high with a PAUSE after it,, that should work.

Perhaps post your full blockly file as an attachment or your 'Code' code and we can take a look to see if we can determine the problem.
 

MurrayJ

Senior Member
At the moment my basic code is simply what I have below, not sure what I need to add to make it work. I just need a small program to play mp3 file 1 (0001.mp3) and I think I can work out the rest from there.

serout B.1,t9600_8,($7E,$FF,$06,$09,$00,$00,$02,$EF)
pause 100
serout B.1,t9600_8,($7E,$FF,$06,$12,$00,$00,$01,$EF)
 

Attachments

hippy

Ex-Staff (retired)
It could be the first byte is being seen as corrupted by the player. You are using a T9600 baud rate which is idle high, so adding a HIGH B.1 and PAUSE 100 at the start should fix that.

Also; which PICAXE are you using ?

The HSEROUT version communicates at 9600_4 for an M2, 9600_8 for an X2, and your baud rate has to match.
 

MurrayJ

Senior Member
Tried to make the changes you suggested. I am using a Picaxe 20M2 but I get an error unknown symbol for 9600_4, but it downloads (without working) with 9600_8.
 

hippy

Ex-Staff (retired)
The M2's do not support 9600_4. You need to add a SETFREQ M8 at the start of your program to use T9600_8.

You may also need to double the lengths of any PAUSE times.
 
Top