Calling on the community for offering a Low-cost wifi option

Finally got around to wiring up CC3000 to my Cerbuino. I’m not sure I’ve got it connected correctly, as it’s not getting much further past: Resetting Connection before setting Policy.

Any help would be appreciated.

Socket1 --> Adafruit CC breakout

pin1 -->
pin2 --> VIN
pin3 --> IRQ
pin4 --> VBEN
pin5 -->
pin6 --> CS
pin7 --> MOSI
pin8 --> MISO
pin9 --> CLK
pin10 --> GND

I’ve tried to swap pin4 & pin5 to no success.

I modified the correct enum value in the constructor:

var wifi = new WifiAdapter("CC3000", InterfaceProfile.CerbuinoBee_Socket1_CC3000);

My Bee is still 4.2, so I changed the project to that version.

[quote=“VS2012 output”]CC3000 Internet Time Example
Sending - Simple Link Start
Send 4000 starting
Send 0008 starting
Resetting Connection before setting Policy.
Send 0002 starting
Send 0008 starting
Send 0002 starting
Send 0008 starting
Send 0002 starting
[/quote]

The first one I received with the FCC markings had the current firmware, but the 2 others I received since were NOT current firmware. That is was immediately sparked my writing of the new firmware patcher.

It sounds like you’re doing everything right. Changing the target to 4.2 is fine.

Here’s how I connect the Adafruit device:

Using the Cerbuino Adhoc Profile.

SPI CLK == Cerbuino D13
SPI Data1 == Cerbuino D12
SPI Data2 == Cerbuino D11
SPI Chip Select == Cerbuino D4
Wifi Power Enable == Cerbuino D5
Interrupt == Cerbuino D6

Also, I had to power the Adafruit device with 5V. My guess is that’s because the thing is made for the Arduino.

Also, the version of the library in codeplex is very bad about giving any information on debugging the connection. If it works, it’s obvious, if it doesn’t, the output is a bit odd as it continues to send commands as if everything is working… This is fixed in for the next version.

The first person (other than me) to try the firmware patcher succeeded in patching their device! Ok Mike, you’re next. Make sure you have the hardware working with the library from codeplex first. You don’t want to have an unstable connection when flashing. Send me an e-mail at valkyrie-mt -at- outlook. I’ll mail you the flasher code.

[quote=“Valkyrie-MT”]Here’s how I connect the Adafruit device:

Using the Cerbuino Adhoc Profile.

SPI CLK == Cerbuino D13
SPI Data1 == Cerbuino D12
SPI Data2 == Cerbuino D11
SPI Chip Select == Cerbuino D4
Wifi Power Enable == Cerbuino D5
Interrupt == Cerbuino D6

Also, I had to power the Adafruit device with 5V. My guess is that’s because the thing is made for the Arduino. [/quote]

Looking over the GHI docs, the pins I used were correct. I’ll verify my wiring, later on, and if that fails, I’ll try the AdHoc.

I was using the Gadgeteer 5v pin for power. I may need to get a separate 5v supply, though there’s no mention of that on the Adafruit page. They powered it from the Arduino directly.

Thanks!!!

Reconnected my wires on Socket 1, getting similar issues.

I’ll try again later – am at home for lunch now

I added this to the driver to use the G400HDR

 wifi = new CC3000Driver((Cpu.Pin) 95, (Cpu.Pin) 86, (Cpu.Pin) 6, SPI.SPI_module.SPI2);

i’m getting this from the output file with the adafruit module / same results with a 100 ohm resister in series on the clk line

Using mainboard GHI Electronics G400HDR version 1.2
Program Started
Sending - Simple Link Start
Send 4000 starting
Setting Event Mask
Send 0008 starting
Requesting SP Version
Send 0207 starting
Send 0002 starting

i’m guessing that the firmware update will fix this.

I am puzzled that the GHI module only seems not to communicate at all though-

Program Started
Sending - Simple Link Start
Send 4000 starting
Send 4000 starting
Send 4000 starting
Send 4000 starting
Setting Connection Policy.
Send 0004 starting
Send 4000 starting
Send 0004 starting
Send 0004 starting

[quote=“MikeCormier”]I am puzzled that the GHI module only seems not to communicate at all though-

Program Started
Sending - Simple Link Start
Send 4000 starting
Send 4000 starting
Send 4000 starting
Send 4000 starting
Setting Connection Policy.
Send 0004 starting
Send 4000 starting
Send 0004 starting
Send 0004 starting
[/quote]

That’s what I am getting with my Adafruit – I assumed I was doing something wrong. So perhaps I do need the firmware update afterall.

I’ll have to see if I can get the breakout to work with my Medusa, as it’s an Uno “clone”.

No, the firmware update will not fix this. It should be communicating with any old firmware version. Any attempt to update the firmware without being able to communicate will fail.

What model?

Well, there is one outstanding hardware issue. Most of my various cc3000 modules, on occasion, fail to communicate over SPI (I get nonsense bytes 040404 or something else) and I have not been able to determine why yet. I was thinking I needed a good oscilloscope to capture the SPI communication at high resolution with the Stellaris and compare to with the cerbuino.

If someone can figure it out, that would be great. My guesses as to what wrong are:

  • Possible CPHA/CPOL misconfiguration or incorrect implementation in .NET MF firmware
  • Perhaps a delay somewhere in the startup is necessary
  • Something about SPI implemented by TI is not the same as that in the STM32F4
  • Drawing too much power too suddenly? (I don’t think so though)
  • Reflection on the SPI line?
  • Noise on the SPI Line?

The software is coming along nicely. I expect to have another check-in within 2 weeks that will be hugely improved.

Also, do you have a cc3000 working with the old firmware? If so, send me an e-mail at:
-at- outlook.com and I will send the firmware patcher.

@ Valkyrie-MT
Just for a sanity check here is what I’ve done.
G400HDR on socket 6

i have the Adafruit shield connected as follows

extender cc3000
pin 1 (3.3v) > not connected
pin 2 (5v) > VIN
pin 3 (Int) > IRQ
pin 4 > not connected
pin 5 (enable) > VBEN
pin 6 (CS) > CS
pin 7 (MOSI) > MOSI
pin 8 (MISO) > MISO
pin 9 (SCK) >100ohn resister > CLK
pin 10 (GND) > GND

also i added in the WifiAdapter

wifi = new CC3000Driver((Cpu.Pin) 95, (Cpu.Pin) 86, (Cpu.Pin) 6, SPI.SPI_module.SPI2);

i am getting the following program output

Found debugger!

Create TS.

Loading start at 202ce930, end 202fd8f8

Assembly: mscorlib (4.2.0.0) Assembly: Microsoft.SPOT.Native (4.2.0.0) Assembly: Microsoft.SPOT.Security.PKCS11 (4.2
.0.0) Assembly: System.Security (4.2.0.0) Assembly: Microsoft.SPOT.Hardware (4.2.0.0)
Assembly: Microsoft.SPOT.Graphics (4.2.0.0) Assembly: Microsoft.SPOT.TinyCore (4.2.0.0)
Assembly: Microsoft.SPOT.IO (4.2.0.0) Assembly: System.IO (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.Usb (4.2.0.0)
Assembly: Microsoft.SPOT.Hardware.SerialPort (4.2.0.0) Assembly: Microsoft.SPOT.Touch (4.2.0.0)
Assembly: Microsoft.SPOT.Ink (4.2.0.0) Assembly: Microsoft.SPOT.Hardware.PWM (4.2.0.1)
Loading Deployment Assemblies.

Attaching deployed file.

Assembly: WifiExampleApp (1.0.0.0) Attaching deployed file.

Assembly: Networking.WifiAdapter (1.0.0.0) Attaching deployed file.

Assembly: GHI.Hardware.G400 (4.2.11.0) Resolving.

The debugging target runtime is loading the application assemblies and starting execution.
Ready.

‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\mscorlib.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Native.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Security.PKCS11.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.Security.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Graphics.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.TinyCore.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\System.IO.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.Usb.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.SerialPort.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Touch.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Ink.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\Microsoft .NET Micro Framework\v4.2\Assemblies\le\Microsoft.SPOT.Hardware.PWM.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Users\a0psgzz\Desktop\CC3000WifiPatchProgrammer\ManagedCC3000Wifi\WifiCC3000\bin\Debug\le\Networking.WifiAdapter.dll’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Users\a0psgzz\Desktop\CC3000WifiPatchProgrammer\ManagedCC3000Wifi\WifiExampleApp\bin\Debug\le\WifiExampleApp.exe’, Symbols loaded.
‘Microsoft.SPOT.Debugger.CorDebug.dll’ (Managed): Loaded ‘C:\Program Files (x86)\GHI Electronics\GHI Premium NETMF v4.2 SDK\Assemblies\le\GHI.Hardware.G400.dll’
CC3000 Internet Time Example
Interrupt state before start: True
Starting up CC3000…
Sending - Simple Link Start
Shutting down CC3000…
#### Exception System.Exception - 0x00000000 (4) ####
#### Message: SPI response to Simple Link Start was invalid, check SPI connection to CC3000.
#### Networking.CC3000Driver::Send [IP: 0204] ####
#### Networking.CC3000Driver::Send [IP: 000b] ####
#### Networking.CC3000Driver::Init [IP: 002a] ####
A first chance exception of type ‘System.Exception’ occurred in Networking.WifiAdapter.dll
SPI response to Simple Link Start was invalid, check SPI connection to CC3000.
#### Exception System.Exception - 0x00000000 (1) ####
#### Message: Failed to initialize the CC3000. Startup aborted!
#### Networking.CC3000Driver::Start [IP: 0043] ####
#### Networking.WifiAdapter::.ctor [IP: 00e0] ####
#### WifiExampleApp.InternetTimeExample::Main [IP: 000f] ####
A first chance exception of type ‘System.Exception’ occurred in Networking.WifiAdapter.dll
An unhandled exception of type ‘System.Exception’ occurred in Networking.WifiAdapter.dll
Additional information: Failed to initialize the CC3000. Startup aborted!
Uncaught exception
Done.

attached is the output from the logic analyzer

I’m not seeing the clock pulses or any outgoing message in that trace. Can you connect the Chip Select to the analyzer too?

I just found a thread about the issue… looks like it’s just a timing issue at startup.

it was there on the last one it just wasn’t labeled correctly
i’m going to try wiring it up on a hydra to see if that makes a difference

tried with cerb40
same output on analyzer

I’m probably not a good help here sorry, since I do not actually have one of these modules… but I have a $50 Dangerous Prototypes Logic Sniffer

@ MikeCormier:
It looks like your SPI clock idle state is wrong. Your trace shows idling high, but it should be low. See the Saleae Logic trace in,

http://processors.wiki.ti.com/index.php/CC3000_Serial_Port_Interface_(SPI)#CC3000_Init_Operation

The CC3000 wants SPI mode 1 (CPOL = 0, CPHA =1) and this is set correctly in Valkyrie-MT’s code.

EDIT: Apparently I cannot post links. So the link is:

http://processors.wiki.ti.com/index.php/CC3000_Serial_Port_Interface_(SPI)#CC3000_Init_Operation

@ MikeCormier - can you post a high resolution picture of how it’s connected?

@ Valkyrie-MT
here is a couple pics
one on cerb40 and 1 on g400hdr