Go Down

Topic: Combining a Ethernetshield and Waveshield, SS conflicts? (Read 497 times) previous topic - next topic


  I have searched forums for a number of days now and read posts that have had success with combining the EthernetShield together with the Waveshield.  As of yet I have not succeeded and ask for help from someone who has gotten this running on an UNO.

    After reading many posts I think I understood that there is a conflict with the SS signal.  I added and defined pin 9 to be an SS_CS signal and in then changed  the SPISSHigh and Low functions to use SS_CS (pin 9) rather than pin 10 (SS).  I also initialized both pin 10 and pin 9 as outputs and set them high.

This allowed me to run either the Waveshield (using pin 9)  or the Ethernet Shield (using pin 10) successfully when independent.

I was also able combine both hardware's with the UNO and then run either's code successfully whereas I was not able to do that previously, without the changes to the conflicting SS pins.

However I am still unable to run the combined code.   The Ethernetshield runs and finds the client but I am unable to play a wavefile.  It reports that it is unable to open a wave file on the SD card.   I know all is fine with the SD card files as the waveshield runs fine as long as the Ethernet code is not running.

Looking at the pins with a scope it occurs to me that Pin10 for the Ethernet is Oscillating high/low constantly.  Is the problem perhaps that the code has to disable the ethernetshields activity temporarily when the SD card needs to be accessed?

When I run only the Waveshield code I see its (pin9) select pin rest low normally.  It goes high and low during the play of a file and then rests low once again when done.  This also seems a little strange, but works when only the waveshield code  is run.   I also put all the hardware back to original ( only UNO + waveshield on pin 10) and pin 10 acts the same so it was not anything I changed.  It seems to me that the select pin should rest high when not playing a file?

    In all the examples I have read about they seem to make it appear as simple as remapping another unused pin for the chip select to the waveshield?

Can anyone please help me out with this?    Code size is only 18K and I am running the 328 microcontrolller.


In case this may be of help to someone in the future:

I pursued the fact that the SS_SC(pin 9) select line for the waveshield remained low always.  Even though this worked fine for the base waveshield code it was causing conflicts when combined with the Ethernetshield code.

After a lot of edits to the SDReader.cpp file  I was able to get this to work.
I first started by commenting out the "card.partialBlockRead(true);" in the main file.  This then allowed the SS_SC line to remain high unless actually reading a wavefile.

I refused to leave this commented out for some reason?  I used the SD library>utility>Sd2Card.cpp as an example and edited multiple spots in the SDReader.cpp file to send  "spiSSHigh"
when returning false.  Lastly I then added a spiSSHigh prior to returning true when attempting to read data with a count = 0.

This got the SS_CS line freed up high after any wavefile read.  However the line was still low just after init and before the first wavefile read.  Something in the Fat partition reading. I was too burnt to pursue that one so I just forced pin 9 high after the partition search in setup and before the ethernet.begin.

Success!  Now the SS_CS remains high when not in use and the the Ethernet card works fine with the Waveshield.  I am very happy after all this searching and editing as I admit I am far from an expert programmer.    I am sure experts would handle this differently but at least this works.
Perhaps some people get it working right off after changing the pin used for the waveshield due to the SD card they are using ?  (SD card dependent bugs in the code?)

The code hints at this by saying you can comment out the "card.partialBlockRead(true);" if you have problems.  However I never had any problems with it uncommented when I was only using the waveshield.  (no outward indication that there were issues).

Hope this may help someone else someday.

Go Up