Pages: 1 ... 5 6 [7] 8 9   Go Down
Author Topic: discussion on supporting the TI CC3000 WiFi module  (Read 49470 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These are both very informative documents on the use of termination resistors:

http://www.ti.com/lit/an/scaa045a/scaa045a.pdf

http://www.fairchildsemi.com/an/AN/AN-610.pdf

My circuit did not work with the CC3000 until I installed a thevenin termination scheme...
Logged

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

Any updates on the library magagna? Waiting patiently...  smiley
Logged

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

These are both very informative documents on the use of termination resistors:

http://www.ti.com/lit/an/scaa045a/scaa045a.pdf

http://www.fairchildsemi.com/an/AN/AN-610.pdf

My circuit did not work with the CC3000 until I installed a thevenin termination scheme...

Thanks! Funny enough, the chip is communicating just fine with the MCU so i think i'll hold off with the termination for now. I took everything apart and put in all together starting with the CC3000 and adding on the other peripherals. Didn't really do anything different in terms of connections other than adding the voltage regulator. Has anyone tried to get it to run commands similar to the WiFi shield? I.e. things like setting up a client and/or server etc. I know it's come up on the thread once or twice, but i'm not sure if anyone has resolved the issue yet. I'm having a go at it right now. Most of the socket commands seem to be available in the library though.
Logged

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

Your welcome! Give it a shot and let us know if you get it to work...
Logged

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

So no luck so far with getting it to connect with a server over the network. I tried setting up the socket for communication following the bit of sample code posted on the thread from TI, which works fine, except the "connect()" command fails. I tried another approach:
Code:
if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
          Serial.println ("Problem creating socket!");
        }
       
        Serial.print ("Sockfd = ");
        Serial.println (sockfd);
       
        servaddr.sin_family = AF_INET;
        inet_aton ("127.0.0.1", &servaddr.sin_addr);
        servaddr.sin_port = htons (SERV_PORT);
       
        Serial.println("Connecting to server...");
       
        if (CCconnect (sockfd, (sockaddr *)&servaddr, sizeof (servaddr)) < 0) {
          Serial.println ("Could not connect to server!");
        }
        else {
          Serial.println ("Connection made!");
        }

but I still ended up with the same results. It connects fine to the network, but just doesn't seem to be able to connect to the server.

Note: I copied the 'inet_aton' function from one of the files in the 'firmware' folder of the WiFi library to the 'socket.c' file because there isn't any definition of it in the CC3000 library.I also renamed 'connect()' to 'CCconnect()' because there seemed to be some kind of conflict.
Logged

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

Do you know where in the CCconnect() function that it gets hung up? I too have noticed that there are conflicts with other libraries, specifically the Ethernet library, as of now the two cannot coexist...
Logged

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

Any updates on the library magagna? Waiting patiently...  smiley

I haven't had a chance to do any work on it and likely won't until next week; I'm on vacation right now and currently only have Internet access on my phone. I have been reading about the problems with using resistor ladders on SPI like my original design and your notes; as soon as I get back I'm going to try something like a 74HC125 (http://forum.arduino.cc/index.php/topic,58643.0.html) or TXB0104 (http://forum.arduino.cc/index.php?topic=99169.0).

Osh Park says my CC3000 boards are shipped so as soon as I get home (12 August) I hope to get another module working and can get started on porting the firmware upgrade. I'm also looking at abandoning TI's base code for the library and adopting the code being written for the Netduino (http://forums.netduino.com/index.php?/topic/9083-spark-core-ti-cc3000-porting-for-super-wifi-mini/page-7) but want to see what AdaFruit's doing first.
Logged

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

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

Do you know where in the CCconnect() function that it gets hung up?

It seems like it goes into the hci_event_handler and then freezes up. Should I be worried if the IP and gateway info all show 255.255.255.255? I feel like it displayed a different IP and gateway when I started testing initially, but now it just defaults to 255.255.255.255
Logged

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

Try putting in a ~50 ohm series resistor at the signal origin, I'm not yet convinced that your issues isn't signal reflections messing with the SPI bus...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good job magagna for porting the code, works a treat.
I had problems at first with synchronization as i was running my whole Arduino board at 3V3 and 16Mhz and it was unreliable, then i switched to 5V and i used resistor dividers for the signal lines then it worked.

Now i want to begin communication using UDP packets as i want to send commands from another device, for ex a mobile phone or another computer on the wlan. I tested the ability to send packets between devices on my network and seems to work.

The code provided for testing does not work and i tried to take it step by step, after calling socket() the next step is to call connect() and here the problems begin, you have to format the address in the AF_INET format, and there is no function included to do that, the included Basic Wifi Example from TI calls a object tSocketAddr but the arduino sketch can't find this.

I believe that if i can figure out how to format the address it will then be able to send and receive. Any thoughts?

EDIT#1:
After some more research i found that the fix was simple: the object must be initialised.. sockaddr tSocketAddr;

The complete code for sending a UDP is:
Code:
sockaddr tSocketAddr;

  char McastPacketTx[] = {
    'd','a','t','x'        };
  int McastPacketTxLen = 4;
  unsigned int port = 12345;
 
  int mySocket = socket(AF_INET, SOCK_STREAM, IPPROTO_UDP);

  tSocketAddr.sa_family = AF_INET;
  tSocketAddr.sa_data[0] = (port & 0xFF00) >> 8;
  tSocketAddr.sa_data[1] = (port & 0x00FF);
  tSocketAddr.sa_data[2] = 192;
  tSocketAddr.sa_data[3] = 168;
  tSocketAddr.sa_data[4] = 1;
  tSocketAddr.sa_data[5] = 101;


  connect(mySocket, &tSocketAddr, sizeof(tSocketAddr));

  send(mySocket, McastPacketTx, McastPacketTxLen, 0);
And it works good, it sends the packet but i found two problems: the big one is that it gets stuck after successfully sending the packet, and the other problem is that on the receiving application the port shown as incoming varies in a random way. I also tried closing the socket after sending but doesn't help or do anything.
« Last Edit: August 05, 2013, 02:18:41 am by wkt » Logged

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

Try putting in a ~50 ohm series resistor at the signal origin...

I'm already using resistors as voltage dividers for the signals from the Arduino to the CC3000 board, so adding the resistor makes everything stop working altogether. I'll try and get my hands on a level shifter and then have the series resistor termination to see if that solves the problem. I also tried taking all the other peripherals on the SPI off, and still got the same results though, so maybe it's not a reflection issue?

@wkt good to know it's (kind of) working for you. Do you have only the CC3000 board connected on the SPI? and how are you level shifting for the signals. thanks! Please let us know if you have any more successes!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 15
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes i have it connected via SPI and i've stated in my previous post that i am using resistor voltage dividers. I am shifting the following lines: CS->D10, DI->D11, CLK->D13, EN->D9 (whick are inputs to the cc3000) and the other connections: DO->D12, IRQ->D3 (which act as outputs) i am connecting directly to my arduino.

The connection for the voltage dividers is found on the github readme page (https://github.com/cmagagna/ArduinoCC3000) and is universal for any module.
Code:
Arduino pin -----> 560 Ohm --+--> 1K Ohm -----> GND
                             |
                             |
                             +---> CC3000 pin
I see that you are using this method as well, it works good for me and i have a home made breakout board, so no problems. Check your connections and make sure that you made all six of them (plus supply), i think i had trouble when at first try i tied EN directly to VCC.


I will try to resolve my freezing problem, i am thinking at another hw problem as i am using a diy board, and to be sincere i omitted some components, like the antenna, it is only the trace that runs to the not populated chip antenna, but it seems to work well (i receive signal from my neighbours wifi). But maybe when transmitting something happens and a protection comes in. Other things that may be wrong are the decoupling caps on the breakout board, i am using 1uF and 0.1uF and maybe it needs more (i will try that soon).

It would help me much if someone has the time to test the code i posted and get back with a response, if it has the same freezing problem.
Logged

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

I just ordered the Adafruit's board : http://www.adafruit.com/products/1469

I will let you know as soon as I have results!
Logged

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

Adafruit released their library!

https://github.com/adafruit/Adafruit_CC3000_Library
Logged

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

Hello all,

I'm back from vacation and got my test boards from Osh Park. I reflow soldered one last night and much to my surprise it's actually working.

I see AdaFruit's released their board and library; I've ordered one of their boards and have downloaded their library but haven't had a chance to do anything with it beyond a quick glance.

Going forward, my immediate priority will be to port the firmware upgrade code to Arduino because that will be of most use to most people. After that, I'm not sure if I'll continue development of my version of the library or fork the AdaFruit code. My goal is to make Arduino + CC3000 web and Bonjour/zeroconf servers, so if I can use the AdaFruit code to handle the lower-level details that will be great.

More soon...


* DSC_0017.JPG (196.31 KB, 903x649 - viewed 106 times.)
Logged

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

Pages: 1 ... 5 6 [7] 8 9   Go Up
Jump to: