Home Forums Sparkfun MP3 Shield Library Support Forum SFEMP3Shield works with Arduino Due Reply To: SFEMP3Shield works with Arduino Due


gallegojm replied to the notification email instead of submitting a response. His email:


i Michael
I almost finish to redact this e-mail when I see you send me an other mail. You are faster than me!
Well. I send you now what I was redacting before I make the test with the Due


Hi Michael
I shall try to answer all your questions:

1) PROGMEM does not exist on the SAM3X8E.

Yes. SAM3X8E has no EEPROM but plenty of flash memory for code (512 kBytes). So PROGMEM does not  exist.
Notice that the function F( “…” ) does not generate error under Due but don’t do anything.

2) There is a problem reading back the MP3reset pin.

6) I don’t understand the reason for digitalRead(MP3_RESET) not reading back the MP3_RESET pin. Do you know of a reason for this? Perhaps you could direct me to a Link explaining why. Or is this something you are observing?
I am suspicious this may because of the SparkFun MP3 shield is actually designed for 5V. Where the Due is only 3V which may not be supplying or reading proper signals.
Is it possible that your board or PIN is not actually going low and resetting?

 On Due reading a digital output always return a low value. (http://arduino.cc/forum/index.php/topic,151120.0.html ,http://arduino.cc/forum/index.php/topic,157749.0.html and more) .
That is why I add the variable mp3Reset. I think it is not a bad idea to do this for all the configuration, because it is faster when you need to test the state of the pin. What do you think? Would you prefer an other name for the variable?

3) SPI member functions between UNO and DUE have some differences.
a. SPI.tranfer’s member function requires the Chip Select in the function call.
b. Default setup can’t be used for setBitOrder and setDataMode
c. setClockDivider is obviously different

5) cs_low() and dcs_low(), you have commented out ” SPI.setClockDivider(spiRate);” and not replaced it with “SPI.setClockDivider( MP3_XCS, spiRate );”.

Yes, “the SAM3X8E has advanced SPI capabilities” (http://arduino.cc/en/Reference/DueExtendedSPI )

This is related with SAM3X8E SPI capabilities. “If you specify one of the Arduino Due’s Slave Select (SS) pin in the call to setClockDivider(), the clock setting is applied only to the device connected to the specified SS pin” (http://arduino.cc/en/Reference/SPISetClockDivider )

I just see now I can increase velocity for multiple transfers (like in function Mp3WriteRegister() ) using aditional parameter SPI_CONTINUE calling SPI.transfer()

What Shield are you using and how have mated it to the DUE?

I use an Arduino Ethernet shield between the Due and the MP3 shield.
On the Ethernet shield I solder 3 wires to connect SPI pins MOSI, MISO and SCK from SPI connector to digital pins 11, 12 and 13 and I bent this pins
I also cut the bridge between digital pin 4 and GPIO1 on the MP3 shield as it conflict with SD card select of Ethernet shield.

I think I have to try now to ensure there is no conflict with Ethernet library and if that is right try to merge Due’ modification to you library