Home Forums Sparkfun MP3 Shield Library Support Forum Sound isn't working :( Reply To: Sound isn't working :(

#1753

Yes, I do mean the Serial Monitor.

I can tell you your sketch works just fine on a normal Arduino using version 01.00.02 of this driver . I have just ran it. (note the most recent version on my mpflaga’s github has some difference’s stick to 1.0.2 for now, as on Bill’s github).

In your code above the music automatically plays, with out Serial Monitor interaction. In the MP3Shield_Library_Demo.ino it does not, requiring user input via the Serial Monitor. Hence from the Serial Monitor user input is needed from its menu. 1 and d are such menu commands.

There are many Arduino’s and clones out there. So it is hard to know what the problem is. Hence, my statements “Italian” referring to the original design versus some clone (which may have differences). Where most all Arduino’s are similar, but there some subtle differences. Such as: a Seeeduino Arduino may have different pin uses then a Original (Italian) Arduino. I don’t have a ArduinoBT to test it out on and not sure if it would be the same as yours. Where I dosee a difference between normal USB/Serial and the original “Arduino BlueTooth” . In that D7 is not open for general use. Rather it is tied to the BT’s reset.

Using an Arduino BlueTooth add’s extra challenges, likely the problem here. In a Normal Arduino the USB to Serial Port chip (aka FTDI) will automatically reset the Arduino’s CPU when the Serial Port’s DTR is toggled at connection of the Serial Monitor or other Serial Device. And out of boot the Arduino’s kernel looks for a special message as to upload. And if it does not get it and times out it runs the code already loaded. Where your ArduinoBT does not have this USB to Serial chip, but rather has a BlueTooth to Serial chip and it does not reset the CPU when the Serial Port is connected. Hence you need to manually hit the reset button, when loading. Also you can hit the reset after reloading, and it should time out and just run on. Allowing you to see all the prints, from the just out of reset. Normally these can happen before the Serial Monitor is fully displayed and be missed.

Additionally you need to match the Baud Rates. If I recall with the BT chip you need to be exactly at its baudrate. It may not be initially 115200, but likely either 57600 (aka 56K) or possibly 9600.

You likely have TWO problems.

First the COM3 error. This nothing to do with this Library. Have you been able to run other Arduino Code with Serial Ports. Such as …\examples4.Communication\ASCIITable\ASCIITable.ino It will stream out the ASCII table over the Serial Monitor. Likely your COM3 is used by something else, in addition to the Virtual Serial Port created by the BT driver. Try changing COM port to a different value.

Normally the IO pin D7 on most Arduino’s are free to use for anything. And the SparkFun MP3 Player Shield uses D7 as the XDCS signal. However, the ArduinoBT (likely yours) has D7 hard wired to the Reset of the BT chip. Hence when ever the MP3 driver sends data(music) to the MP3 chip the BT chip will get its reset pin toggled. Not good. Hence we need to re-route the XDCS function away from D7 and to the next unused pin, D5. This is a hard-mode and can be done with out cutting or soldering. Rather bending and jump wires. Bend the MP3 SHields D7 pin so that it wont mate to the Arduino’s header. This will separate the the MP3’s XDCS from base Arduino’s D7. Then changing the SFEMP3ShieldConfig.h MP3_XDCS from 7 to 5:

  #define MP3_XDCS             7 //Data Chip Select / BSYNC Pin
to
  #define MP3_XDCS             5 //Data Chip Select / BSYNC Pin

routes the XDCS signal to the unused D5 pin of the Arduino base board. Then on the MP3 Player Shield using a jump wire, jump D5 to D7 on the Shield. This then routes the XDCS signal from the base Arduino’s D5 back into the MP3 Player Shield’s XDCS input.

I believe 1.00.02 to be stable and best at the moment. With its example opening messages and error responses. But you need to get the opening messages first before moving on with the playback. Otherwise it is just guessing, what is wrong.  I always take things step by step.

Note there are more then one difference here, and that makes it more complicated for debugging. Hence the step by step. However, these extra complexities may make it worth getting a regular UNO for initial learning. Until you become more confident of typical Arduino’s and the hassles added by BT. I have several. Always good to have others for references, in case one breaks or gets weird.

P.S. Feel free to donate to Bill’s causes. However, I am separate from his causes. Just helping out.