I really like the price and form-factor of the CC3000 WiFi module http://www.ti.com/product/cc3000

and I REALLY link the concept of SimpleLink for a headless embedded device http://www.ti.com/ww/en/simplelink/

From what I can tell, there is no Arduino support for the module and from what I read, the module supports DHCP, DNS, TCP/IP and UDP but not much else (ie no HTTP) - for sure less than the current Ardunio WiFi shield (that works great but it too expensive for my needs and does not have the SimpleLink capability) ...

So my question is - does anyone have an idea how hard it would be to hook up the module to an Uno (SPI interface is pretty straightforward) and to get a library in place to support the module to the point that we could hook up to cosm.com (formerly pachube.com aka patch bay).

Thoughts, comments?

Cheers David

PS: BTW I'd be willing to build the shield and provide it to the community to do the API work

I think you're right, it does have the possibility to be a really good fit for wireless Arduino-based devices. DigiKey has the chip for $12.51 (http://www.digikey.com/product-detail/en/CC3000MODR/296-35512-1-ND/3768439), which is a lot better than official wireless board or even the WiFly adapter from SparkFun et al.

I've got the data sheet bookmarked and will hopefully get to reading it this weekend, but I glanced through it at lunch and it seems doable. The chip's 3.3V only so you'll have to level convert the SPI pins but there's several ways to do that.

You're right it doesn't have a built in webserver for HTTP, but I don't think it would be too difficult to adapt the existing Arduino libraries to do that.

You've probably seen this guy's working on a shield (http://www.evenchick.com/cc3000-shield-and-the-internet-of-things.html) but I'm not sure of the project's current status. TI's got several eval boards, I'm going to look into those as well.

Does anyone know of any work being done for home automation purposes? For example connecting a CC3000 to a low cost MCU so that you can control wall sockets (relays) and light dimmers would be amazing. Right now the only options require additional wireless hardware to receive the signals and all the solutions are proprietary.

I just got a CC3000EM prototype board. I'm going to try connecting it to an Arduino over SPI via a TXB0104 level translator, then starting a library for it (unless I can find someone else already working on one).

I'll post further updates in the Networking forum, but if anyone has any immediate questions please let me know.

I'm still working on it but so far no real news to report. I have the CC3000 evaluation module but so far I've been unable to get an Arduino to get the CC3000 to do WiFi-ish things.

I thought I'd have better luck getting TI's MSP430 board (it's only about $35 from DigiKey - http://processors.wiki.ti.com/index.php/CC3000_Wi-Fi_Platforms) and reverse engineering a working copy, but I've been unable to install their IDE on my Windows 8 laptop (yet another reason to not get a Windows 8 laptop...but I digress...)...hopefully some night this week or this weekend I'll be able to try again with a Windows 7 or XP box.

Initially I was never able to get the CC3000 to respond to any SPI commands from either a Nano or a Teensy, so I bought TI's MP430 board (their version of Arduino) to make sure it even works. I finally got their IDE installed and got some of their sample apps compiled and uploaded yesterday. I was able to configure it with the iPhone app, ping it, etc.

So now I'm back to making the CC3000 work with Arduino and port TI's CC3000HostDriverLibrary. The biggest obstacle is their code spi.c and spi.h, which does all the SPI work but is all TI-specific. It's semi-documented here:

but I didn't find that guide to be very complete or useful, so I copied their version, renamed the files to ArduinoCC3000SPI so they can work with Arduino's standard SPI.h, then commented out all the TI hardware-specific code until it compiled. It doesn't do anything yet but I believe just compiling is a good sign.

I'm currently slogging through their code and trying to figure how to rewrite the TI code for Arduino. Here's an example:

void SpiPauseSpi(void){ SPI_IRQ_PORT &= ~SPI_IRQ_PIN;}void SpiResumeSpi(void){ SPI_IRQ_PORT |= SPI_IRQ_PIN;}As far I understand these functions enable or disabled the IRQ_SPI Line in your Microcontroller, and in case of CC3000 produce a falling edge in the IRQ Pin it would not be treated

I do the same using a Flagvoid SpiPauseSpi(void){ irq_flag=0;}void SpiResumeSpi(void){ irq_flag=1;}

I finished porting the library's SPI routines but the init routine locks, I traced that down to it waiting and never receiving an init reply from the CC3000.

I put the library to the side and went back to trying to communicate with it directly by bit-banging the handshake pins and manually sending the init string via SPI, and it's failing the same way the library fails. I wanted to rule out the Teensy so I swapped it for a Nano + some voltage dividers (Arduino pin -> 5.6K R -> CC3000 pin + 10K R -> GND).

I'm now able to do the initial handshaking, send the SPI init string, and get the SPI init response. (I'm not sure why the Teensy wasn't working but I'll come back to that later)

The problem now is the data I'm getting back is 1 bit off. Both the received bytes in the init string, and the bytes in the init response, have a leading 1 bit:

The SPI protocol is used to communicate with the CC3000 device from the host MCU that is acting as the SPI master while the CC3000 device is the SPI slave. The protocol is an extension of the existing standard SPI. The endianness on transport is assumed to be most-significant bit (MSB) first.The clock and phase settings for the SPI are configured such that the data is sampled on the falling edge of the clock cycle. Note that different MCU may use different naming conventions in order to configure SPI clock phase and polarity, For example, MSP430 uses UCCKPL and UCCKPH for clock polarity and phase respectively. Both are set to 0, indicating that the data is sampled on the falling edge of the clock cycle. The more generic convention is CPOL and CPHA, however, in order to configure sampling on the falling edge of the clock cycle, CPHA is set to 1.

I take this as CPOL=0 CPHA=1, which for Arduino is SPI.setDataMode(1), but that isn't working. I've tried modes 0, 2, and 3 as well, and get the exact same results. I've also tried changing the SPI clock with DIV2, DIV4, DIV8 with no changes.

Short of bit-banging the SPI protocol to the CC3000, does anyone have any ideas on how to fix this?