Adafruit VS1053 (mp3) library for music maker shield ported?

Finally can get the SparkTimer-code to work … yeah … making progress…

Update: First time I got it to fully compile … yeah … will start real life testing tomorrow … too tired today :stuck_out_tongue:

@peekay123 I get the sound part working but it seems the Interrupt-playing is not working as it only plays about 2 seconds and then it stops. I’m using TIMER3 now instead of TIMER2 as it seems TIMER2 is no longer available.
Any ideas? Timing issues?

Ah … the D0 interrupt problem on the photon - took D4 now and it is working!!!

You have to change the DREQ define in your program to something other than D0 - then it seems to work, though there are some bleeps and scratches from time to time which might be related to some timing/SPI-issues …

2 Likes

@McTristan, I’m using A1. I am testing the code as we speak. So far so good on the latest develop branch running the player_simple example.

2 Likes

@McTristan, I was able to get the player_interrupt demo working as well and without any glitching whatsoever. In all cases, the Photon was running in AUTOMATIC mode with a Cloud connection. I was unable to get the MIDI example working and I suspect it is related to the odd 31250 baud setting required. I did not do a lot of debugging on this. :smile:

3 Likes

Me neither, Midi was not my main scope. My Photon is finally doing what my Core could do for ages - yeah :wink:

1 Like

@peekay123 @McTristan sounds like you two made good progress! What’s the best way to get this running - will either of you be posting the library somewhere? Thanks

@stoobee, I’ll be updating my repo tonight :smile:

2 Likes

Could reproduce my clicking issues on one VS1053 module so far - the others are working just fine so I think it might be related to some hardware issues on my side. You can find my repos as always on my github account. I’ve already created a non-public library which seems to work ok, haven’t updated my samples though - could just publish it for the masses…

1 Like

@peekay123 Is your repo public? I don’t see it on your github account.

@core16, here it is. HOWERVER, I haven’t update the SparkIntervalTimer files. I’ll try to get to that tonight. :smile:

@core16, I updated the library. Give it a shot and let me know how it works for you. :smile:

Hi @peekay123 Thanks for you’re work on this! I’m trying to get the player_simple.ino example working on the Photon, but I keep getting the error: “Couldn’t find VS1053, do you have the right pins defined?” So just wanted to check the pin connections with you:

VS1053 > Photon
RST > D2
CS > D3
DCS (XDCS) > D4
DREQ > A1
CARDCS (SDCS) > A0
VCC > 3V3
ROUT > right hand audio jack pin
LOUT > left hand audio jack pin
AGND > centre audio jack pin
GND > GND

In the file I can’t see anything about connecting the VS1053’s SCLK, MOSI or MISO pins. Does this need to be done? If so which pins do these connect to on the Photon – I’ve looked through the files in the library and can’t work it out…

Thanks

@stoobee,you can refer to the docs for the hardware SPI pins. Here are the adjusted connections you need:

VS1053 > Photon
VCC > 5V (not 3V3)
CLK > A3
MOSI > A5
MISO > A4

:slight_smile:

Thanks! That makes sense about the SPI. I’m a bit confused about the 5V though - I can’t see a pin on the photon that outputs 5v, do I need an expernal power source for the VS1053?

@stoobee, I should have specified Vcc > Vin since Vin is USB voltage when powered via USB, which is what I am assuming you are doing.

@peekay123 Ahhh, ok. Does the same apply if you use the battery shield (https://www.sparkfun.com/products/13626) i.e. connect VCC to VIN?

@stoobee, looking back at the hardware design of the board, I realize you could power off the Photon’s 3.3V supply. However, the current draw on the microSD can be quite large and draw too much from the Photon’s SMPS. The battery shield supplies USB or battery power to the Vin pin on the Photon. So, I suggest you keep the connection from Vcc > Vin.

@peekay123 Great, thanks so much for your help!!

1 Like

@peekay123 I have it working, amazing! One other issue (that may not be an issue…). After a few seconds the breathing cyan light turns to breathing green light. I know this means it’s not connected to the cloud, but just wondering if this is normal or not. From reading this thread: Photon Breathing green after flashing it appears that maybe it’s ok?? Thanks