Shop OBEX P1 Docs P2 Docs Learn Events
BS2P40 controlling USB/SD card MP3 Player Module — Parallax Forums

BS2P40 controlling USB/SD card MP3 Player Module

LuXo12LuXo12 Posts: 31
edited 2011-05-19 15:39 in BASIC Stamp
Good Evening
For past few days I have been trying to write a code, that will allow me to control my mp3 module (for which I am including a link to the manual) without any success.
The problem I am having is that I'm not able to play back any music when using serial connection, but when I use buttons for basic control (play, pause, next, previous, vol up, vol down, and stop) the unit starts playing music with out any problems.
I did follow the manual for serial hook up to a micro controller but still no luck.
So i was wondering if anyone could take a look at the code I wrote, and suggest a possible error that i might have made,
I am including my code .bs2 code and link to the manual

Thank You

http://www.elechouse.com/elechouse/images/product/USB-SD%20Audio%20Module/USBSD%20mp3%20module%20V1.2.pdf

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-26 21:12
    Do not use the HEX2 in the SEROUT statement. The MP3 player expects a sequence of 8 bit values. They just happen to be written in hexadecimal (like $7E) in the documentation. You need the HEX2 in the DEBUG statement because you have to be able to read the values when they're displayed on the PC's screen.

    I haven't checked the "baud" value. Whatever the Stamp help files give you for 2400 Baud, normal mode, 8-bit, no parity should work.
  • LuXo12LuXo12 Posts: 31
    edited 2011-02-26 21:47
    Thank you for the advice I going to give it a try
  • LuXo12LuXo12 Posts: 31
    edited 2011-02-27 08:58
    I made changes the suggested changes to the code and still no go I will keep trying, I also tried sending data inverted with and without parity bit and true polarity with out any luck, any other suggestons?
    I forgot to mention that the buttons are still being pulled up through 10k resistor, and so is the RXd and Txd data line
  • Mike GreenMike Green Posts: 23,101
    edited 2011-02-27 09:14
    At the bottom of page 5 of the datasheet, there's an example. Based on that, the corresponding SEROUT statement would be:

    SEROUT pin, Baud, [ $7E, 7, play, (folder dig 1)+"0", (folder dig 0)+"0", (song dig 2)+"0", (song dig 1)+"0", (song dig 0)+"0", $7E ]

    Note that "song dig 1" extracts the 10^1 digit of song expressed in decimal. This is described in the Stamp manual. Adding "0" turns this into an ASCII digit as required by your MP3 player.
  • LuXo12LuXo12 Posts: 31
    edited 2011-03-01 19:57
    Thanks Mike I did try modifing my code with the code you suggested, but still no luck, once I get some time on my hands Im going to write new code from scratch,
    Thank You for your suggestions
  • LuXo12LuXo12 Posts: 31
    edited 2011-05-19 15:39
    SOLVED
    I now that I'm finished with my classes I was finally able to solved the problem I had with this module. As unbelievable as it may sound, datasheet/manual was not 100% correct, But somehow I managed to get it working
    full files and expanation s are in the included file
    Thanks to everyone that helped meMP3 SEND 2.0.bsp
Sign In or Register to comment.