Home › Forums › Sparkfun MP3 Shield Library Support Forum › Leonardo
Tagged: Leonardo
- This topic has 12 replies, 2 voices, and was last updated 11 years, 12 months ago by Michael P. Flaga.
-
AuthorPosts
-
December 5, 2012 at 3:25 pm #1693Michael P. FlagaMember
Question: Will this driver run the MP3 Player Shield from sparkfun runs on Leonardo ??
Answer: Don’t Know at present.
I would think so. but don’t have one to confirm.
Please let us know if you or anyone finds out.
December 6, 2012 at 12:10 am #1694Michael P. FlagaMemberA quick look at the schematic shows an issue with Arduino Leonardo Board, preventing out of the box operation.
Support for Arduino Leonardo is afflicted by having the SPI pins not routing the same pins as the UNO. This is similar to the Arduino Mega. Where as it appears it should simply work with additional jumpers, from the Leonardo’s ICSP port, which has the SPI pins to the MP3 shields equivalent SPI pins.
D13 to ICSP3 – SCK
D12 to ICSP1 – MISO
D11 to ICSP4 – MOSI
and remember to not use D10Please let us know if this works? I think it should.
December 6, 2012 at 1:16 pm #1696AnonymousInactiveYes Yes Yes its playing BUT
It plays for a split second, and only the first track001.mp3
Every time i typed a number or ( 1,2,3,4,5,6,7,8,9 or – or +)
December 6, 2012 at 1:59 pm #1697Michael P. FlagaMemberThis symptom is typical of the interrupt not triggering the refill(). I bet if you play that or any other file, the music will advance about one second at a time, then stop.
I apologize for not being familiar with the Leonardo, as I don’t have one. So I am getting up to speed vicariously. Some Google Foo, leads me to see there are Issues with attachInterrupt(). Our method of establishing the pin’s interrupt to the refill(). INT.0 and INT.1 are SWAPPed. (nice). And that initial release of the Arduino IDE 1.0.0 had all INT’s outright broke.
So make sure you have IDE 1.0.1 or higher. As 1.0.1 fixed INT 0 & 1. IDE 1.0.2 also fixes INT 2 & 3. But note the Leonardo still has the pins of 2 and 3 swapped.
Two solutions:
1) put a jumper between D2 and D3. Remembering to leave D3 (not used by our example) as INPUT. I have actually done this on my UNO to validate that other INTs will work on this driver. (just not on a Leo).
2) Change line 174 of SFEMP3ShieldConfig.h to :
#define USE_MP3_REFILL_MEANS USE_MP3_Polled
It is by default: USE_MP3_INTx
You can also try USE_MP3_Timer1
December 6, 2012 at 2:10 pm #1698Michael P. FlagaMemberActually simpler than all that above. Change line 145 of SFEMP3ShieldConfig.h from
#define MP3_DREQINT 0 //Corresponding INTx for DREQ pin
to#define MP3_DREQINT 1 //Corresponding INTx for DREQ pin
This will swap the interrupts and should match the Leonardo.
If that works I can put in a Flag to auto select the correct value based on board type.
December 6, 2012 at 2:39 pm #1699AnonymousInactiveThis solution works perfect:
Change line 145 of SFEMP3ShieldConfig.h from
#define MP3_DREQINT 0 //Corresponding INTx for DREQ pin
to#define MP3_DREQINT 1 //Corresponding INTx for DREQ pin
Thank you.
I owe you a BIIIIIIIIIIIIIIIIIIIIIG beer
December 6, 2012 at 2:41 pm #1700AnonymousInactiveI have version IDE 1.0.1
December 6, 2012 at 3:06 pm #1701Michael P. FlagaMemberGreat, I have already patched that to automatically occur for Leonardo’s. And will get flushed up in the next minor release.
Can you confirm that you did need to jump the wires, and that the jump instructions were correct?
It looks a little inconvenient to get the jumpers off the Leonardo’s ISCP header.
December 6, 2012 at 3:45 pm #1702AnonymousInactiveyes I confirm that the 3 wires are required (pin 13,12,11) to ISCP header.
Is it possible to place some pictures ??
December 6, 2012 at 4:42 pm #1703Michael P. FlagaMemberThanks. I appreciate the confirmation.
I have preliminarily loaded the change to my GitHub Fork As to automatically correct the interrupt based on the processor being identified as the Leonardo’s __AVR_ATmega32U4__ flag.
December 8, 2012 at 3:47 am #1710AnonymousInactiveHi,
2 small things
In the help text
Serial.println (F (“[r] Resets and initializes VS10xx chip.”));
must be
Serial.println (F (“[R] Resets and initializes VS10xx chip.”));
Serial.write((byte*)&title, 30);
gives a error
MP3Shield_Library_Demo:151: error: no matching function for call to ‘Serial_::write(byte*, int)’
December 8, 2012 at 4:00 am #1711AnonymousInactive//print out the arrays of track information
Serial.write((byte*)&title, 30); Serial.println(); Serial.print(F(“by: “)); Serial.write((byte*)&artist, 30); Serial.println(); Serial.print(F(“Album: “)); Serial.write((byte*)&album, 30); Serial.println();
December 8, 2012 at 12:22 pm #1712Michael P. FlagaMemberThanks for pointing out the typo.
As for the other issue. You appear to be appointing out a compile error. I thought from above comments you had it working on the Leonardo. So what changed or is different at your end? As I don’t see an issue at my IDE 1.0.1 & UNO. I have just upgraded to IDE 1.0.2 and it appears fins here too.
That said I do read in the release of 1.0.2 there was an addition to the Leonardo’s Serial.Write functions. Maybe there is an issue here with the Leo. As the bug report of this on the 1.0.1 indicates a similar scenario.
Perhaps trying 1.0.2 will work. If this the issue.
-
AuthorPosts
- You must be logged in to reply to this topic.