Hey! I am pretty green when it comes to this stuff. I just got Music Shield v1.13,Genuine Arduino Duemilanove w/368 chip, Arduino 22 running on Windows XP.
I tried to use the demo code to play music and I am not having too much luck.
Initially, I could not even get the code to compile unless I selected a board other than I have. After changing a couple of the lines of code I was able to get it to compile. So I uploaded to my Duemilanove…
…Now music still won’t play and when I open up serial monitor I get Fat16 init errors, SD errors, and open file errors.
I have also tried older versions of the IDE (21 and 18) with similar results.
Is this normal?
Is there a quick fix?
Are there other examples of code that others have written?
Steve thank you for your post! I have tried that. I have even ordered more Arduinos (Genuine mega 2560 and geniune uno) and more memory (Sandisk 2gb) and will try those too. I have tried Arduino 18, Arduino 21, and Arduino 22. I have tried multiple memory cards. I have tried to compile the “demo” code without modification, as well as with mods. I am brand new to programming and micro-controllers and am having fun with exception to this blasted shield. If I can’t get it working I think I would rather smash it at this point rather than sell it to another person and curse them with it. If anyone out there has had this thing working please tell me what board and code used as well as what memory stick and I will try to recreate those variables prior to smashing. I have wasted 30 dollars on this shield and would have rather spent that on more Arduinos instead.
Thank you for trying to help! Things like changing PB1 to PORTB1 and correcting case issues with Fat16Util to Fat16util. Anyway, the software would not even compile the “demo” code when the board I have is selected. If I selected the Mega with 1280 or 2560 it would compile just fine and after I changed a few of the PB vs PORTB and PD instead of PIND lines and the Fatutil, it would compile for any of the ATMega368 boards also. I have tried changing the portpins.h file even, but when that was unsuccessful, I changed that back. The mods I did allowed the code to compile but it still did not run properly. I don’t know if that is because of the memory I bought. On top of the additions to my collection such as the MEGA and the UNO, I have also ordered a Sandisk 2gb micro sd. I have ordered a Mega2560 and an UNO to play with also so we’ll see. I am a little ticked off that I have had this thing for so long without getting it to work I could put it in the trash. I however, have spent over $100 now on micro-controllers to try to get this piece to work. I have been unsuccessful to date.
Please help
windows xp
arduino 18, 21, 22
Arduino Duemilanove368, Mega 2560, UNO368
I have one on order but have not yet received it. For me, with some experience programming chips, I was going to look at the demo code to see how the registers are programmed. That means downloading the datasheet for the chip and studying the registers. There is also help in the vlsi.fi website. Then I was going to modify the code to my liking, including adding a display. But this is just a plan.
I don’t know what your goals are but for a beginner, programming a chip like this is probably too complex.
BTW, that board is “dirt cheap”. Just the vs1053 chip will cost you $20 elsewhere…
Well I finally got the Musicshield to play music. I had to burn bootloader on a new ATMega 168 and drop that into my duemilanove. I don’t know why but that worked. I now have issues with the buttons not working. No volume or track advance or anything but progress nonetheless. I appreciate all the help and will continue trying. I am fairly new at this stuff and I will not avoid challenges, after all nobody is a “natural” at programming. But as a total newcomer to the Arduino world, I naively assumed that the source code that seeedstudio tests this thing with would at least perform the basic functions. I will say that the board is pretty inexpensive and that is part of what attracted me to it (that and the thought of SD for storage, recording, and the size). Now I need to study the basics of the code to get it to recognize the buttons and the ipod dock connector.
so that said glt, please repost when you get your Musicshield as I would like to see your progress and your project.
Thanks
So I am still trying. I got my Mega 2560 today and tried again. I deleted all zip and uncompressed files having to do with the Music Shield and started from scratch. I now have even more questions.
I am not sure I have unzipped the libraries correctly as I get alot of (duplicate definition) errors unless I put *.cpp files in their own folder and leave the *.h files alone. Is what I have done correct?
I now am stuck on an undefined reference to …
…Play()
…InitSPI();
…InitIOForVs10xx();
…InitIOForKeys();
…InitIOForLEDs();
…InitFileSystem();
…`Mp3Reset()’
First of all please accept my apologies, my lack of patience might have got the better of me, I can now use most of the Music Shield. Playback but no recording.
Hi Steve! Thanks! I just deleted all musicshield files and reinstalled, and I am able to compile!! A breakthrough! Things I found out…
…I can get the chip to play on a ATMega168 chip.
…I can get playback and button functions on UNO and Duemilanove with ATMega368 and it sounds great!!!
…I cannot get any leds or anything with the MEGA 2560 however the code does compile.
THANK YOU for your patience and all of your help everyone! Is there now a quick fix for the 2560? Do I need to edit all references to 1280 to 2560? Thanks as this is awesome! I am listening to some of my favorite music again!
Cool, glad to know that you make it work!
We’ve not tested the code on 2560. I will test that if I find some time.
However it will be helpful if you can also submit your testing result
I can get the code to compile and upload to the 2560 but that is where it stops. I bought this unit to play music and for sd storage on projects but, after plugging away on this and realizing the unit will not record without mega 1280, now I want to record. So when I went to buy a Arduino Mega they were sold out of the 1280 (so I bought a 2560). If I un comment the //Serial.println(“Hello test!”); the board will display serial info “Hello test!”. But no music or leds or button function. I also now get error messages only if I select the ATMega168 (not enough space). I feel so much better that I am able to use this now.
If I could help in any way to test revisions of code or if you have any suggestions for the 2560 to work please let me know. I can’t help but notice…
…#if defined(AVR_ATmega1280)
is there any reason why changing 1280 to 2560 would help? I might just try to find a MEGA with 1280 to try. Does the Seeeduino Mega v1.1 work for recording?
Thanks!
Eric
By the way, the setup I have that worked is
Windows XP
Arduino Duemilanove w/ ATMega328
Arduino 22
noname 2GB sd micro
The pins on Arduino 168 or 328 connected to Music Shield are not the same as Mega1280 and 2560.
On 168 or 328, the SPI pins are 10,11,12,13, while on 1280 they are something else. I’m not familiar with 2560. But I think mega1280 is enough for normal use.
You can refer to the garden page of Music Shield where illustrates how to record the music based on the Seeeduino Mega v1.1 (1280).
Thanks as I already got a mega1280 now. Can anyone tell me the sample rate while recording? I was able to record but wanted better quality. Can I adjust sample rate or bit rate?
-E
Sorry we didn’t do much exploring on the music shield. You may refer to the datasheet of vs1053b, or ask for the service of VLSI company. http://www.vlsi.fi/en/home.html
Hi E3po, it’s looked like interesting, congratulation…
Btw I still have problem with my music shield, I’m using Arduino Mega 1280.
This is my error code when I try to compile MusicShieldNewSDLib_r:
MusicShieldNewSDLib_r\config.cpp.o: In function `InitSPI()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:32: multiple definition of `InitSPI()'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:32: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `SPIPutChar(unsigned char)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:50: multiple definition of `SPIPutChar(unsigned char)'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:50: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `SPIGetChar()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:56: multiple definition of `SPIGetChar()'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:56: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `InitIOForVs10xx()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:65: multiple definition of `InitIOForVs10xx()'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:65: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `InitIOForKeys()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:79: multiple definition of `InitIOForKeys()'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:79: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `InitIOForLEDs()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:103: multiple definition of `InitIOForLEDs()'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:103: first defined here
MusicShieldNewSDLib_r\config.cpp.o: In function `InitSPI()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/config.cpp:32: multiple definition of `temp'
config.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/config.cpp:32: first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o:(.bss.file+0x0): multiple definition of `file'
newSDLib.cpp.o:(.bss.file+0x0): first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o: In function `readFile(unsigned char*, int)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/newSDLib.cpp:73: multiple definition of `readFile(unsigned char*, int)'
newSDLib.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/newSDLib.cpp:73: first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o: In function `error_P(char const*)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/newSDLib.cpp:33: multiple definition of `error_P(char const*)'
newSDLib.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/newSDLib.cpp:33: first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o:(.bss.card+0x0): multiple definition of `card'
newSDLib.cpp.o:(.bss.card+0x0): first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o: In function `openFile(char*)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/newSDLib.cpp:60: multiple definition of `openFile(char*)'
newSDLib.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/newSDLib.cpp:60: first defined here
MusicShieldNewSDLib_r\newSDLib.cpp.o: In function `initialSDCard()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/newSDLib.cpp:46: multiple definition of `initialSDCard()'
newSDLib.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/newSDLib.cpp:46: first defined here
MusicShieldNewSDLib_r\player.cpp.o: In function `controlLed()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/player.cpp:40: multiple definition of `controlLed()'
player.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/player.cpp:40: first defined here
MusicShieldNewSDLib_r\player.cpp.o: In function `scanKey':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/player.cpp:59: multiple definition of `scanKey()'
player.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/player.cpp:59: first defined here
MusicShieldNewSDLib_r\player.cpp.o: In function `AvailableProcessorTime':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/player.cpp:65: multiple definition of `AvailableProcessorTime()'
player.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/player.cpp:65: first defined here
MusicShieldNewSDLib_r\player.cpp.o: In function `playFile(char*)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/player.cpp:67: multiple definition of `playFile(char*)'
player.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/player.cpp:67: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `SendZerosToVS10xx()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:284: multiple definition of `SendZerosToVS10xx()'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:284: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3WriteRegister(unsigned char, unsigned char, unsigned char)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:31: multiple definition of `Mp3WriteRegister(unsigned char, unsigned char, unsigned char)'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:31: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `VsSineTest()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:211: multiple definition of `VsSineTest()'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:211: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3WriteRegisterWithDelay(unsigned char, unsigned char, unsigned char)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:68: multiple definition of `Mp3WriteRegisterWithDelay(unsigned char, unsigned char, unsigned char)'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:68: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3SoftReset()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:114: multiple definition of `Mp3SoftReset()'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:114: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3SoftResetWithoutPatch()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:138: multiple definition of `Mp3SoftResetWithoutPatch()'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:138: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3Reset()':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:158: multiple definition of `Mp3Reset()'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:158: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3ReadRegister(unsigned char)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:88: multiple definition of `Mp3ReadRegister(unsigned char)'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:88: first defined here
MusicShieldNewSDLib_r\vs10xx.cpp.o: In function `Mp3WriteRegisterWithDelay(unsigned char, unsigned char, unsigned char, int)':
C:\data-C--8-8-2009\arduino-0022\libraries\MusicShieldNewSDLib_r/vs10xx.cpp:49: multiple definition of `Mp3WriteRegisterWithDelay(unsigned char, unsigned char, unsigned char, int)'
vs10xx.cpp.o:C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build9132105570205782871.tmp/vs10xx.cpp:49: first defined here
My problem initially was the Mega2560 which DOES NOT WORK and I think I tried the MusicShieldNewSDLib_r without success. So try to delete what you have and try the NewSoftSerial library and music_v1_13.
I have had luck replacing the ATMega 328 in my duemilanove with a 168 and running the newer code, but since you have a mega if libraries are correctly installed and you run the music_v1_13 you should be fine.
-e