Pages: 1 [2] 3 4 ... 9   Go Down
Author Topic: discussion on supporting the TI CC3000 WiFi module  (Read 40759 times)
0 Members and 1 Guest are viewing this topic.
SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6378
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I caught that a while ago
Can we see the actual code that you have now?

Code:
SPI.begin();
SPI.setDataMode(3);
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV8);
I'd feel better if the SPI.begin() was last instead of first.
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm pleased to report that works! No idea why, but it's definitely working now with the Nano. I'm getting exactly what I expect:

First packet data: 2 0 FF 0 0 0 0 0 0 0 (HCI_CMND_SIMPLE_LINK_START ack)
Wlan sent me: 2 0 0 0 5 4 0 40 1 0 (HCI_CMND_SIMPLE_LINK_START command complete)

I'm still unable to get it working with the Teensy -- even with dc42's suggestion of resistors on the IO lines all I get back is FFs. I'll work on that later.

In the meantime, back to porting the library to Arduino.

Thanks for your help.
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Keep us posted on your progress! I too am working on getting a CC3000 working with an arduino...
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've got good news to report. I'm now able to get the TI library to compile for Arduino and execute basic commands (show version, start config, connect to a WiFi network, get a DHCP address, etc.). I'm still experimenting with the API but it looks like everything is there and functional.

I found the problem between the Teensy and the CC3000 -- the TI module is very unforgiving about what it expects in SPI timing and/or the Teensy 3.0 SPI implementation has a bug about how it handles SPI mode 1 (CPOL=0 CPHA=1) so I'm bit banging everything for now. The nice thing about the Teensy is it has (relatively) lots of Flash and RAM so I didn't have to worry about buffer sizes etc.

The code currently compiles for the ATMega328 but crashes/reboots when I call the init routine on my Nano...my guess is it's running out of RAM. There's a 'small memory' compiler option ("#define CC3000_TINY_DRIVER" - http://processors.wiki.ti.com/index.php/Tiny_Driver_Support) which is supposed to limit the library to about 200 bytes of memory but that doesn't work for me...I probably broke something while porting the code but I'll get back to that soon.

Once I know everything's working I'm going to remove all my debugging etc. then do a diff between the TI reference library and my code, document the changes, and post things on github or Google code.

In the meantime I hope someone's working on a hardware implementation...currently I'm using the CC3000EM (http://www.ti.com/lit/ug/swru326/swru326.pdf) but it's got a weird pinout, is expensive, and seems to be perpetually on backorder everywhere.


Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Glad to see that someone is also working on this! I also have a CC3000 evaluation board, and would like to communicate it with my arduino micro at 3.3 to make some tests. I started to port the example library for the TI chip, but it is in a very preliminary stage. What is your compiled sketch size in the Arduino environment? Are you compiling with CC3000_TINY_DRIVER definition enabled?.  

How many pins are you using to communicate with the chip? I need 6, one to drive wifi enabled/disabled, one to detect chip IRQs, and the typical 4 for SS, CS, MISO and MOSI.

Hope to see some library or reference software to test with the Arduino =D

Keep us updated!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just writing our posts at the same time!  smiley

I have the Type-VK module from Murata, seems to be very similar to yours from TI:

http://www.murata-ws.com/type-vk.htm

I think that is ease to do a breakout module for this chip with an easy interface. I though that I read that is necessary a four layer PCB with a whole GND layer. There are some layouts already from the internet that can be a good starting point:

http://hackaday.com/2013/01/27/a-breakout-board-for-a-tiny-wifi-chip/

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Something I have seen with my first IRQ tests, is that when powering the CC3000 from the Arduino 3v3 ( board is at 3v3 ), all stop working and cannot receive any IRQ or communicate with serial port with PC, when driving WIFI_ENABLED on. However, powering the CC3000 module from an external power supply, all work as expected, and IRQs are received normally. Not sure if it is the same problem with your Arduino. But is a little issue i found when using the Arduino. Powering from other 3v3 boards does not seem to be a problem.
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What is your compiled sketch size in the Arduino environment?

37K Flash, 4.3K RAM (on a Teensy 3.0).

Quote
Are you compiling with CC3000_TINY_DRIVER definition enabled?.

When I set the target to Uno and set CC3000_TINY_DRIVER it uses 11.4K Flash and ~ 250 bytes RAM (but doesn't actually work yet).

Quote
How many pins are you using to communicate with the chip?

Yep, 6 pins:

The normal SPI pins: MOSI, MISO, SCK, CS
The notification pin (TI calls this WLAN_SPI_IRQ)
The 'enable module' pin (TI calls this VBAT_SW_EN in some places and WLAN_EN in others).

Quote
Hope to see some library or reference software to test with the Arduino

Licensing for my implementation will start at $25 per CPU. Just kidding. I'll post it as soon as I'm not embarrassed by it.
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Something I have seen with my first IRQ tests, is that when powering the CC3000 from the Arduino 3v3 ( board is at 3v3 ), all stop working and cannot receive any IRQ or communicate with serial port with PC, when driving WIFI_ENABLED on. However, powering the CC3000 module from an external power supply, all work as expected, and IRQs are received normally. Not sure if it is the same problem with your Arduino. But is a little issue i found when using the Arduino. Powering from other 3v3 boards does not seem to be a problem.

I did have this problem at the very beginning...the CC3000 wants up to 250mA @ 3.3V and neither my Teensy or Nano can drive that much current. Right now I'm taking the 5V from USB and running it through a LD1117V33 for the CC3000, and connecting the grounds together.
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6378
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I hope someone's working on a hardware implementation.
There are RF compliance issues, if you don't exactly follow the TI reference design rules and antenna selection.  And the design rules are tough to follow (weird board thickness, etc.)  There is useful discussion under the hackaday link alvarolb posted...

You get a bit disillusioned when all those lovely $12 modules become $40 boards, and your homemade "simple" replacement isn't legal :-(
It'd be more productive to write TPLINK router code to turn it into a slave device, and then you wonder what your arduino is there for at all.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6378
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
powering the CC3000 from the Arduino 3v3
The CC3000 is a power-hungry beast, well above the 50mA "spec" of the Arduino board, and probably beyond what the separate regulator chip on the Uno can provide...
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There are RF compliance issues, if you don't exactly follow the TI reference design rules and antenna selection.  And the design rules are tough to follow (weird board thickness, etc.)  There is useful discussion under the hackaday link alvarolb posted...

You get a bit disillusioned when all those lovely $12 modules become $40 boards, and your homemade "simple" replacement isn't legal :-(
It'd be more productive to write TPLINK router code to turn it into a slave device, and then you wonder what your arduino is there for at all

I agree...that's why I'm hoping someone else does that part...

I actually wouldn't mind a CC3000 daughterboard at $40 if it had more of a normal footprint (not necessarily a real shield, but something more like the hackaday board).

It seems like the WiFi for Arduino right now is either

* Expensive and weird (the official Arduino WiFi board or the Yún)
* Cheaper but limited API (the RN-XV)
* Cheaper but requires "cloud" services (the Electric Imp and the Spark Core)
* Cheaper but in a form factor not great for small embedded systems (connecting an Arduino to a router per your example)

My hope is the CC3000 will let us get past all of that.
Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

0
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a guy that published eagle design files for a CC3000 breakout

http://centerblack.com/

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi in your quote you said ..... $40 boards, and your homemade "simple" replacement isn't legal :-(, are you referring to compliance and FCC certifications?
So you are saying if somebody sells it as a board it is illegal? TI selling it for their MSP did they get FCC?

Thanks for educating us on this.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 106
Posts: 6378
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, and yes...
Logged

Pages: 1 [2] 3 4 ... 9   Go Up
Jump to: