Wave Pin Conflicts
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 10
- Joined: Wed Jan 16, 2013 1:01 am
Wave Pin Conflicts
I have an AdaFruit Wave Shield that I need to use w/ a WiFi shield that uses pins 11, 12, & 13 also. What are my options to resolve this?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Pin Conflicts
That depends on what the WiFi shield uses those pins for. If it is for SPI, you should be able to share as long as the CS pin is different. The WaveShield uses pint 10 for CS by default.
-
- Posts: 10
- Joined: Wed Jan 16, 2013 1:01 am
Re: Wave Pin Conflicts
Thanks for you help. This is my first experience w/ Arduino and my electronics knowledge is limited; although I am learning a lot!
Wave | | Wifi
----------------------------
| 0 |
| 1 |
LCS | 2 | Interrupt (2 or configurable
CLK | 3 |
DI | 4 |
LAT | 5 |
| 6 |
| 7 |
| 8 | Interrupt (2 or configurable
| 9 | LED ("Can be removed")
CS | 10 | SS
SD | 11 | MOSI
SD | 12 | MISO
SD | 13 | Clock (SCK)
My understanding is that 2 and 10 conflict, so I need to move them.
Pin 2 -> I can move the Wave to 1 or the WiFi to 8
Pin 10 -> I can move the Wave to 7
Pins 11/12/13 are not configurable on either shield.
Thanks again!
Wave | | Wifi
----------------------------
| 0 |
| 1 |
LCS | 2 | Interrupt (2 or configurable
CLK | 3 |
DI | 4 |
LAT | 5 |
| 6 |
| 7 |
| 8 | Interrupt (2 or configurable
| 9 | LED ("Can be removed")
CS | 10 | SS
SD | 11 | MOSI
SD | 12 | MISO
SD | 13 | Clock (SCK)
My understanding is that 2 and 10 conflict, so I need to move them.
Pin 2 -> I can move the Wave to 1 or the WiFi to 8
Pin 10 -> I can move the Wave to 7
Pins 11/12/13 are not configurable on either shield.
Thanks again!
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Pin Conflicts
You want to avoid pin 1. That is also used for serial communication which is valuable for debugging things.Pin 2 -> I can move the Wave to 1 or the WiFi to 8
Yes. You just have to make the change in the code to reflect that.Pin 10 -> I can move the Wave to 7
-
- Posts: 10
- Joined: Wed Jan 16, 2013 1:01 am
Re: Wave Pin Conflicts
I've moved the Wave Shield pins so they look like
|Wave|WiFi
0| |
1| |
2| | Interrupt
3|LCS |
4|CLK |
5|DI |
6|LAT |
7| |
8| | Disabled
9|CCS | Disabled
10| |SS
11|MOSI|MOSI
12|MISO|MISO
13|SCK|SCK
In setup I call
pinMode(SS, OUTPUT);
to setup pin 9.
The Wave board works when plugged directly into the uno3, but when stacked on top of the WiFi shield it shows the error
Error: Card init. failed!
SD I/O error: 1, 8
I'm not sure what to try next so these shields work together. Any ideas?
|Wave|WiFi
0| |
1| |
2| | Interrupt
3|LCS |
4|CLK |
5|DI |
6|LAT |
7| |
8| | Disabled
9|CCS | Disabled
10| |SS
11|MOSI|MOSI
12|MISO|MISO
13|SCK|SCK
In setup I call
pinMode(SS, OUTPUT);
to setup pin 9.
The Wave board works when plugged directly into the uno3, but when stacked on top of the WiFi shield it shows the error
Error: Card init. failed!
SD I/O error: 1, 8
I'm not sure what to try next so these shields work together. Any ideas?
-
- Posts: 10
- Joined: Wed Jan 16, 2013 1:01 am
Re: Wave Pin Conflicts
The WiFi shield is a LinkSprite CuHead.
http://linksprite.com/wiki/index.php5?t ... duino_V2.0
If I upload a sketch to exercise the WiFi it works with the Wave Shield stacked on it.
If I declare an SdReader in the WiFi's sketch then it fails to execute correctly.
I don't think they're sharing pins 11, 12, & 13 correctly, which points to a software bug (I think).
Will you point me to any good resources to help me understand how to share these pins correctly?
(Please remember that I'm just beginning.) Thanks!
http://linksprite.com/wiki/index.php5?t ... duino_V2.0
If I upload a sketch to exercise the WiFi it works with the Wave Shield stacked on it.
If I declare an SdReader in the WiFi's sketch then it fails to execute correctly.
I don't think they're sharing pins 11, 12, & 13 correctly, which points to a software bug (I think).
Will you point me to any good resources to help me understand how to share these pins correctly?
(Please remember that I'm just beginning.) Thanks!
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Pin Conflicts
It could be that the two libraries are using different implementations of the SPI protocol that are not compatible.
The first two links cover the SPI library and give some background on how it works. The third link describes some of the common problems encountered with Arduinos and multiple SPI devices.
http://arduino.cc/en/Reference/SPI
http://tronixstuff.BANNED.com/2011/0 ... e-spi-bus/
http://www.circuitsathome.com/mcu/runni ... no-spi-bus
The first two links cover the SPI library and give some background on how it works. The third link describes some of the common problems encountered with Arduinos and multiple SPI devices.
http://arduino.cc/en/Reference/SPI
http://tronixstuff.BANNED.com/2011/0 ... e-spi-bus/
http://www.circuitsathome.com/mcu/runni ... no-spi-bus
-
- Posts: 10
- Joined: Wed Jan 16, 2013 1:01 am
Re: Wave Pin Conflicts
These are excellent articles, and I'm still digesting all of the information in them. My understanding of the SPI is (SET SPI LOW, USE (MOSI, MISO, SCK), SET SPI HIGH).
I decided to see what state the WiFi and WaveHC were leaving the SPI in after initialization.
The WiFi leaves the SPI in HIGH.
The WaveHC leaves the SPI in LOW.
To verify this I put some print statements in the SdReader.cpp of the WaveHC library in the spi Low and spi High functions. Then in the daphc example I put a while(1); at the end of setup to identify the last command. It appears that the WaveHC's last command is leaving the SPI in LOW.
I'm using the latest version of the WaveHC library (wavehc20110919.zip). Before I start fixing it ...
1. Is there a better library I should be using instead?
2. Does adafruit maintain WaveHC?
3. If so, is there a way to submit my fixes to the WaveHC library to help others trying to use it?
I decided to see what state the WiFi and WaveHC were leaving the SPI in after initialization.
The WiFi leaves the SPI in HIGH.
The WaveHC leaves the SPI in LOW.
To verify this I put some print statements in the SdReader.cpp of the WaveHC library in the spi Low and spi High functions. Then in the daphc example I put a while(1); at the end of setup to identify the last command. It appears that the WaveHC's last command is leaving the SPI in LOW.
I'm using the latest version of the WaveHC library (wavehc20110919.zip). Before I start fixing it ...
1. Is there a better library I should be using instead?
2. Does adafruit maintain WaveHC?
3. If so, is there a way to submit my fixes to the WaveHC library to help others trying to use it?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Pin Conflicts
The most up-to-date WaveHC library can be found here. http://code.google.com/p/wavehc/
As well as contact information for Bill Greiman the maintainer of this library.
As well as contact information for Bill Greiman the maintainer of this library.
Please be positive and constructive with your questions and comments.