Can I Turn the CC3000 OFF? [solved]

Ahh cool, good to know it’s not something in the core firmware.

As for equipment, I would highly recommend for an oscilloscope the Rigol DS1052E ($300 ish) and a logic analyzer Saleae Logic 8 ($150). Even though the logic analyzer is more useful when decoding I2C, SPI, UART, etc… I would say get the scope first because it gives you a better overall picture of what your signals look like, which is really important. Basically though if you can afford both right away, I would go for both as soon as you can. If there is a better scope for your money out there right now, I would love to hear it. Also if you have a little more cash to spend and are serious about electronics, I would go for the Rigol DS2072 ($830).

Thanks for the guidance @BDub, I really appreciate it!

1 Like

Very glad you figured this out! Nice job!

You might want to consider Embedded Artists Lab Tool which combines a 11 input Logic Analyzer and dual oscilloscope probe inputs. Display and control software is on a PC via USB. I think it can handle up to 100 MHz combined channels (i.e. 100 MHz 1 channel, 50 MHz 2 channels etc.).

Available for Mouser for $129. Includes the LA hookups but not the probes.
Embedded Artists Lab Tool

1 Like

Make that 60 (1) and 30 (2) MHz for the analog inputs, now that I went back and reread the spec. I have one and really like it

Back to the original question. “Can we power down the CC3000?”

It looks like we can get the Spark to run while the CC3000 is not connected to the internet now. I haven’t got to trying this yet but I will soon so hopefully it works out when that time comes. But I could really benefit by keeping the ARM32 processor running while the CC3000 is powered down to save about 100mA in power consumption when the WiFi is not needed.

I’m looking at the sleep code here: https://github.com/spark/core-firmware/blob/master/src/spark_utilities.cpp#L203

I think SPARK_WLAN_SLEEP will deep sleep the cc3000 and keep the stm32 going, but I need to double check with @mohit

1 Like

Yes, it can be done like Dave suggested and is documented here:
http://docs.spark.io/#/firmware/sleep-spark-sleep

Hope this helps!

2 Likes

@Dave @mohit Ok so if I want only turn the CCC300 wifi Chip off and keep the ARM processor working I will just need to put Spark.sleep() into my main loop or should I use SPARK_WLAN_SLEEP

Ideally I want to trigger this CC300 ON/OFF function via a external button.

It looks like Spark.sleep() has to be triggered to turn back on based on a preset time frame. I prefer to trigger it ON/OFF via a switch.

If you want it to be a triggered event, using the SPARK_WLAN_SLEEP flag directly is the way to go.

1 Like

@mohit or @Dave can you help me understand how I would use this code with my current application.

How and where should the SPARK_WLAN_SLEEP be dropped into my current sketch to turn off the CC3000?

And then say I wanted to put a switch on Digital Pin to trigger it ON/OFF what would that look like?

Sorry guys I wish I knew this programming better but I’m just starting out and need lots of help from you guys :wink:

@satishgn I’m trying to understand how to use the code you created here https://github.com/spark/core-firmware/commit/f437dc4756671b08150fefdeb9c7471b9dc581ca

So if I understand correctly I would have to take all to files and replace and add them to the Spark Core via a local build to get these functions to work:

WiFi.on()
WiFi.off()
WiFi.status()

If so will these functions ever make it to the online IDE build?

Also does WiFi.off() actually power down the CC3000?

And how does this compare with the recommended SPARK_WLAN_SLEEP flag feature recommended by @mohit

What is the easiest way to power down the CC3000 and keep the ARM 32 processor running using the current Web IDE build?

@RWB Right now the recommended way to put WiFi in stop mode i.e. turn CC3000 off is to pull the latest git-hub master commits and build locally.

To disable both WiFi and Cloud at startup, place the 2 includes in your application.cpp
#include “spark_disable_wlan.h”
#include “spark_disable_cloud.h”

To disable WiFi i.e. turn off CC3000 during runtime,
just call WiFi.off() in your setup() or loop()

@Dave @zachary , any ETA on when will this find its way to the WebIDE build?

1 Like

We’re making some changes, and I think we may roll out a firmware push today, not sure yet

1 Like

Anytime this week would be AWESOME!

So after the update I could use the these functions without having to build locally?

To disable WiFi i.e. turn off CC3000 during runtime,
just call WiFi.off() in your setup() or loop()

I should say, half of the team will be traveling in / for the next few days. @will and I are flying to China tomorrow, @jgoggins and @zach will be flying this weekend for Makerland in Poland. So it will probably be tough to have another firmware rollout that quickly, but we’ll try for Friday or early next week. :slight_smile:

@Dave Anytime soon is good with me :smile:

Compiling locally sometimes doesn’t go very smoothly so I would like to avoid it if possible.

1 Like

@Dave and @will,

will we be seeing photo updates from you guys in China for the manufacturing run? :smiley:

Would be nice to see the HAXLR8R office!

1 Like

Yea that would be awesome to see what you guys have going on over there. Please do share some pictures with us if you can.

http://www.saleae.com/logic

Got one. Love it. Eight channels, sample rates up to 8Mhz and the user interface is very nice. It has common serial data format decoding, etc. :smiley: