Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 37
61  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 20, 2013, 07:25:26 pm
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.
62  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 20, 2013, 07:20:45 pm
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.
63  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 20, 2013, 07:01:46 pm
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.


64  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 18, 2013, 09:42:52 pm
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.
65  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 18, 2013, 07:31:03 pm
I apologize for that error. I caught that a while ago. I've tried using the built in constants, e.g. SPI_MODE1, but get the same results no matter what option I pick.

Quote
There are a lot of complaints on the TI forums about the state of the CC3000 documentation (or lack thereof.)  :-(

Yes...it hasn't been as much fun as I'd hoped...

66  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 18, 2013, 02:36:11 pm
Well I have bad news, good news, and bad news.

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:

First string:
02 00 FF 00 00 00 00 00 00 00 (expected)
81 00 7F 80 00 00 00 00 00 00 (observed)

Second string:
02 00 00 00 05 04 00 40 01 00 (expected)
81 00 00 00 02 82 00 20 00 80 (observed)

TI's documentation (http://processors.wiki.ti.com/index.php/CC3000_Host_Programming_Guide) says:

Quote
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?

I'm attaching my useless code, maybe I'm overlooking something obvious here?
67  Using Arduino / General Electronics / Re: Will SPI work between two systems with different power supplies? on: June 18, 2013, 02:28:59 pm
Thanks for everybody's help. I swapped the Teensy out for a Nano + some resistor voltage dividers and am now getting SPI data back.

It's the wrong data -- everything is shifted right one bit -- but at least it's data instead of all FFs or all 00s.

I don't want to mix up multiple threads in this project so I'll be continuing it in my main CC3000 topic:

http://forum.arduino.cc/index.php?topic=164007.new#new

Thanks again.

[edit - added link to the other thread]
68  Using Arduino / General Electronics / Re: Will SPI work between two systems with different power supplies? on: June 18, 2013, 10:07:14 am
There is no hardware reasion for this not to work.

I was afraid you were going to say that....
69  Using Arduino / General Electronics / Re: Will SPI work between two systems with different power supplies? on: June 18, 2013, 10:06:54 am
As long as the teensy has 5V tolerant inputs (or you're using some kind of level shifter to get the 5V from the Arduino down to 3.3V for the teensy's inputs), and the teensy outputs data that is within the spec of the Arduino's inputs (LOW < 0.3*Vcc, HIGH > 0.6*Vcc) then it should be perfectly fine.

There is no level shifting. Both devices are running at 3.3V. (different power supplies + common ground, but same voltage).
70  Using Arduino / General Electronics / Will SPI work between two systems with different power supplies? on: June 18, 2013, 12:35:37 am
Hi all,

Can an Arduino and another device communicate via SPI if they have different power supplies (the grounds are connected). If so, do I need to do anything special, e.g. force MISO to INPUT_PULLUP etc.?

I'm trying to get a Teensy to communicate with a TI CC3000 and the wiring checks out but I'm not getting a valid reply to the init string. The CC3000 wants about 300mA @ 3.3V and the Teensy can only supply about 100mA so I'm using a LD1117V33 to power it. (I'm using the Teensy because it has (relatively) gobs of RAM and runs at 3.3V natively so I don't have to do any IO level shifting).

Thanks as always.
71  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: June 16, 2013, 07:51:10 pm
Howdy,

I may have made some progress.

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:

   http://processors.wiki.ti.com/index.php/CC3000_Host_Driver_Porting_Guide

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:

Code:
//*****************************************************************************
//
//! This function enter point for write flow
//!
//!  \param  SpiPauseSpi
//!
//!  \return none
//!
//!  \brief  The function triggers a user provided callback for
//
//*****************************************************************************

void
SpiPauseSpi(void)
{
// todo: code this
// SPI_IRQ_PORT &= ~SPI_IRQ_PIN;
}

I'm not sure how you pause SPI on Arduino, if it's necessary, if removing it will break something else, etc., but I'm working on it.

If I ever get anything useful working I will post this on github or some place, but for now it's just commented out code and a bunch of Serial.println()s.

Chris
72  Using Arduino / Microcontrollers / Re: Making Leonardo clones with unique VID/PID? on: June 05, 2013, 08:54:53 pm
No, it will be fine. You're making an exact copy of the Leonardo so you're using the same VID/PID.

If you were making something for sale, however, you would have to get your own VID because the Arduino team says you can't use theirs for other commercial products. That's what the akafugu post is talking about.

Good luck!
73  Development / Other Hardware Development / Re: discussion on supporting the TI CC3000 WiFi module on: May 29, 2013, 11:10:33 am
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.
74  Using Arduino / Project Guidance / Re: Is there another way to upload code to arduino? on: May 18, 2013, 01:44:00 pm
You could give the end users access to the .hex file and point them in the direction of XLoader

http://russemotto.com/xloader/

which will hide the command line-iness of having to use avrdude directly, unfortunately it's Windows only.

Good luck!
75  Using Arduino / General Electronics / Re: USB D+/D- Resistors on: May 18, 2013, 11:14:09 am
Thank you all for the answers!
Yes I should have provided additional information on the schematic..
Both D+ and D- are wired from a Micro USB connector to an FTDI chip (FT230XQ) through a 27 (Ohm?) resistor. They go into USBDM (D+) and USBDP (D-) of the FTDI.

So.. could it be 27 Ohm?

The spec sheet for the FT230X (http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf) calls for 27 Ohm resistors on D- and D+ (as well as 47 pF caps to ground).

So as retrolefty says...yes....

Good luck!
Pages: 1 ... 3 4 [5] 6 7 ... 37