CC3000 with other SPI devices on Arduino Mega

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jasperp
 
Posts: 50
Joined: Mon May 27, 2013 5:06 am

CC3000 with other SPI devices on Arduino Mega

Post by jasperp »

Hey!

Im looking at purchasing ones of the CC3000 breakout boards for use with my Arduino Mega project.

My projects already however using an LCD shield and screen from SainSmart (my next LCD screen and driver board will be from Adafruit)
This is what im currently using > (http://www.sainsmart.com/sainsmart-tft- ... -plug.html)

What I need to know is could I have both the CC3000 and LCD shield working on my Mega at the same time? I believe they both use SPI pins.
Since the Mega pins which are to be used according to the Adafruit CC3000 guide are in use (50,51,52) could I connect them up to the ISCP headers SPI pins instead?

Thanks in advance!

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by adafruit_support_bill »

If all devices on the bus and their respective libraries are well behaved, you can share the SPI bus. We do not have any experience with the SainSmart shield, so we can't say for sure that it will work.

User avatar
jasperp
 
Posts: 50
Joined: Mon May 27, 2013 5:06 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by jasperp »

So it should work in theory

I believe that each spi device requires a unique ChipSelect pin

Where in the cc3000 library can I modify the CC used by this breakout board?

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by adafruit_support_bill »

You can specify the CS pin in the CC3000 constructor.

Each device also needs to tri-state its bus pins so that they can be shared. And the libraries need to remember to de-assert the CS pin when they are done with it.

User avatar
jasperp
 
Posts: 50
Joined: Mon May 27, 2013 5:06 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by jasperp »

What does Tri-Stating involve exactly?

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by adafruit_support_bill »

Tri-state means that the output of a device pin can be HIGH, LOW or a high impedance state that allows other devices to control the signal. http://en.wikipedia.org/wiki/Three-state_logic

There are various ways to implement it. We use a 74AHC125 buffer on our CC3000 breakouts.

User avatar
jasperp
 
Posts: 50
Joined: Mon May 27, 2013 5:06 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by jasperp »

Thanks for the info

Considering the LCD shield im using takes a 3.2' LCD screen which has an sd card slot which I am also utilizing I believe the libraries correctly use the CS function and the shield is capable of sharing the SPi bus.

I will post my results when I receive my cc3000 board.

User avatar
jasperp
 
Posts: 50
Joined: Mon May 27, 2013 5:06 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by jasperp »

Just so you know I have been able to get the CC3000 to work without issues with the Arduino Mega and LCD TFT Shield/Screen :)

User avatar
adafruit_support_bill
 
Posts: 88089
Joined: Sat Feb 07, 2009 10:11 am

Re: CC3000 with other SPI devices on Arduino Mega

Post by adafruit_support_bill »

Great! Thanks for the follow-up.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”