[SOLVED] Problem with Multiple Shields : Wifly + MP3 Shield

Also I’ve put a wired jump from A0 to pin 7 over the Mp3Shield . I decided to do this cause the Pin 7 seems to have different functions on both Shields: Pin7 is MP3-DCS on MP3Shield, and Pin7 on Wifly has another function that i don’t find documented.

For SPI, it seems to be compliant with the multiShield rules: The pins 11-12-13 are common MOSI-MISO-SCLK pins, and the Pin 9 is for SD-CS, Pin 7 for MP3-DCS, and Pin 10 for Wifly CS

  • The software only needs a light change:

In the MP3Player Code ( http://pastebin.com/nJefwwgw ), I’ve changed the original line

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

by

#define MP3_XDCS 14 //Data Chip Select / BSYNC Pin

To be able to use the pin A0 jumped over pin7

  • The example MP3Player works ok like this.

  • I use the Wifly Library (1.0) https://github.com/jmr13031/WiFly-Shield with no modifications (just over the Credentials.h)

  • The “WiFly_WebClient” hangs on the “WiFly.begin();” line ;-(

I’ve tried also with a Mega 2560 (with wired jumps from 53,51,50,52 to 10-11-12-13), but with the same results

I’ve search for information over the net but I haven’t found any solution…

Well, the Problem is SOLVED

The Problem had two reasons:

1st: the Wifly _WebClient code should have initalized the CS pins and Reset for the other SPI cards

2nd: the Wifly Shield must be on top, cause if another shield was pluged just over the Wifly Sh., it wasn’t able to get connection wth the SSID

DA ZOLUTION:

pinMode(7, OUTPUT);

pinMode(6, OUTPUT);

pinMode(9, OUTPUT);

pinMode(8, OUTPUT);

digitalWrite(7, HIGH);

digitalWrite(6, HIGH);

digitalWrite(9, HIGH);

digitalWrite(8, LOW);

The complete WiFly_WebClient code is at http://paste.ubuntu.com/5592342/

  • And now it Works…

NOTE: When the program wants to use one card, it has to activate its CS pins and deactivate the CS pins from the others