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

Hi magagna, I have some news! I get it working easily!  In the arduino pro micro, the pin 2 is interrupt 1, so i have a bad pin configuration. My configuration is now as follows:

Code:
#define WLAN_CS 10 // Arduino pin connected to CC3000 WLAN_SPI_CS

#define WLAN_EN 9 // Arduino pin connected to CC3000 VBAT_SW_EN

#define WLAN_IRQ 2 // Arduino pin connected to CC3000 WLAN_SPI_IRQ

#define WLAN_IRQ_INTNUM         1 // The attachInterrupt() number that corresponds

After that, the initialization process is done correctly:

Code:
Waiting on you before starting...

Transmit buffer is 119 bytes
Receive buffer is 119 bytes

Initializing CC3000...
CC3000 is initialized
Version of the CC3000 is: 4.0

I will try new commands to start connecting to the internet =)

Good job!
Logged

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

That is great news. I didn't even think to check that but you're right the interrupt mapping for your board is different. Congratulations!

One thing I see is that your board reports version 4.0 of the firmware. My board says it is version 1.19 since I used the TI demo code and it did a firmware update. This page: http://processors.wiki.ti.com/index.php/CC3000_Release_Notes says 1.19 is the most current version.

We will have to figure out how to port the patch programmer to Arduino for this as well....a lot to do but very exciting...
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

Hi magagna, I am trying to get the smart config working, and I have noticed one todo:

Code:
} // todo: figure out why I had to add this

This is due to an error on security.h. You must add the following code at the end of file to close the extern "C" {

Code:
#endif //CC3000_UNENCRYPTED_SMART_CONFIG

#ifdef  __cplusplus
}
#endif // __cplusplus

#endif

And then just remove this closing "}" line
Logged

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

HI Magagna, thanks for the great job smiley I am using your CC3000 library for connecting UNO board with TI CC3000 Booster board, every thing is working perfect as expected  smiley-cool
only difference is that the cc3000 version is little old (1.7), i hope it'll not great any problem.
"Version of the CC3000 is: 1.7"
going further i was trying to check the MAC address but the function hangs and doesn't return any value smiley-sad

unsigned char MAC_id[]={0x08,0x00,0x28,0x01,0x70,0x16};
Serial.println("updating MAC");
nvmem_set_mac_address((unsigned char*)MAC_id);
Serial.println("MAC updated");

Serial.println("get MAC Address");   
nvmem_get_mac_address((unsigned char *)MAC_id);
Serial.print("MAC id is:");
for(char i=0;i<6;i++)
Serial.print(MAC_id, DEC);

any idea what's wrong here?
Logged

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

HI Magagna, thanks for the great job smiley I am using your CC3000 library for connecting UNO board with TI CC3000 Booster board, every thing is working perfect as expected  smiley-cool
only difference is that the cc3000 version is little old (1.7), i hope it'll not great any problem.
"Version of the CC3000 is: 1.7"
going further i was trying to check the MAC address but the function hangs and doesn't return any value smiley-sad

unsigned char MAC_id[]={0x08,0x00,0x28,0x01,0x70,0x16};
Serial.println("updating MAC");
nvmem_set_mac_address((unsigned char*)MAC_id);
Serial.println("MAC updated");

Serial.println("get MAC Address");   
nvmem_get_mac_address((unsigned char *)MAC_id);
Serial.print("MAC id is:");
for(char i=0;i<6;i++)
Serial.print(MAC_id, DEC);

any idea what's wrong here?


The release notes:

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

says the functions you're using were added with the firmware you have (you have firmware version 1.7 but that's really release package 1.9), but there's nothing about any updates to those API functions since then. I did find one post that says that after someone did a firmware update they got the call to work:

http://e2e.ti.com/support/low_power_rf/f/851/t/244794.aspx

Which isn't really helpful, but is probably further indication that we really need to get the firmware update code ported....

The documentation says nvmem_set_mac_address() should return 0 if successful. Can you verify you're getting that?

The only other thing I can think to try is maybe add a delay between the set and the get? Maybe the CC3000 needs some time to write to Flash?

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

Hi magagna, I am trying to get the smart config working, and I have noticed one todo:

Code:
} // todo: figure out why I had to add this

This is due to an error on security.h. You must add the following code at the end of file to close the extern "C" {

Code:
#endif //CC3000_UNENCRYPTED_SMART_CONFIG

#ifdef  __cplusplus
}
#endif // __cplusplus

#endif

And then just remove this closing "}" line

Good catch! Thanks!
Logged

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

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

HI Magagna, thanks for the great job smiley I am using your CC3000 library for connecting UNO board with TI CC3000 Booster board, every thing is working perfect as expected  smiley-cool
only difference is that the cc3000 version is little old (1.7), i hope it'll not great any problem.
"Version of the CC3000 is: 1.7"
going further i was trying to check the MAC address but the function hangs and doesn't return any value smiley-sad

unsigned char MAC_id[]={0x08,0x00,0x28,0x01,0x70,0x16};
Serial.println("updating MAC");
nvmem_set_mac_address((unsigned char*)MAC_id);
Serial.println("MAC updated");

Serial.println("get MAC Address");   
nvmem_get_mac_address((unsigned char *)MAC_id);
Serial.print("MAC id is:");
for(char i=0;i<6;i++)
Serial.print(MAC_id, DEC);

any idea what's wrong here?


The release notes:

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

says the functions you're using were added with the firmware you have (you have firmware version 1.7 but that's really release package 1.9), but there's nothing about any updates to those API functions since then. I did find one post that says that after someone did a firmware update they got the call to work:

http://e2e.ti.com/support/low_power_rf/f/851/t/244794.aspx

Which isn't really helpful, but is probably further indication that we really need to get the firmware update code ported....

The documentation says nvmem_set_mac_address() should return 0 if successful. Can you verify you're getting that?

The only other thing I can think to try is maybe add a delay between the set and the get? Maybe the CC3000 needs some time to write to Flash?


ya nvmem_set_mac_address() returns 0. and i just noticed that nvmem_get_mac_address() returned value after 40seconds smiley-razz
but the responce is very slow smiley-sad
I'll trying to port the code for firmware update, keep on sharing the ideas. Thanks smiley
Logged

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

I don't know how but nvmem_get_mac_address() returned me correct values some times n that too after waiting for some minutes, but its so unreliable now its not returning any thing. the function hangs in the while loop  of hci_event_handler().
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 don't know how but nvmem_get_mac_address() returned me correct values some times n that too after waiting for some minutes, but its so unreliable now its not returning any thing. the function hangs in the while loop  of hci_event_handler().

I think I may be getting close to figuring this out. It may be a timing problem of the code taking too much time inside digitalRead & Write and missing pulses on the IRQ line.

If you have time, try replacing the digitalRead()s & digitalWrites() in ArduinoCC3000Core.cpp and ArduinoCC3000SPI.cpp with the direct port bit equivalents. If you don't have time or don't know how to do that, I should be able to test it out this weekend. Are you using a plain old Uno or another Arduino variant?
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

Regarding the hardware implementation for FCC certification of an Arduino CC3000 solution, I was digging through the TI forums for help to get Smart Config working and came across this interesting link:

http://e2e.ti.com/support/low_power_rf/f/851/t/236194.aspx

The discussion is about the (lack of) availability of the chip antenna but the last post points to this official link from TI:

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

which contains this (hopefully) useful FAQ:

Quote
Q: How can the customer leverage and reuse the regulatory ID of TI module.
A: The customer does not need further certification (meaning a filing to FCC)
 Warning: The testing for EMC (and electrical safety if applicable) must be performed on the final product. These test results are not filed with FCC but are kept by the manufacturer of the final product.

Q: Is the CC3000 TI regulatory certification eliminating the customer to recertify it? Is there any test that the customer needs to apply on top of TI certification to the end product?
A: Yes. There is no requirement to re-certify the final product as long as the final product is using the TI radio module within the constraints of the FCC grant
Meaning, there is no co-location with other radios and the radio antenna is separated from the user by a minimum distance of 20 cm.

Q:What is the antenna limitation of this certification- is it attached to a specific antenna type or gain?
A: The existing certificate includes the chip antenna. If a different chip antenna is used it must have the same gain or less.The “specific type” means a chip antenna in this case but does not mean the chip antenna has to be from the same manufacturer.
The antenna used and recommended is p/n: AT8010-E2R9HAA is Johanson p/n: 2500AT44M0400 and is featured and stocked on Digikey

Q: The CC3000 was certified with chip antenna. Can the customer use external dipole antenna with the same peak gain and reuse the TI certification?
A: If the customer wishes to use an external dipole antenna they could still re-use the TI certification but would be required to do a Class II modification filing with the antenna(s) that they would like to add to the certification.
This filing can be done by TI or TI could give their customer permission to do a Change of ID which would create another grant that the customer could modify on their own

Q: If the thickness of the antenna trace changes, will this affect the FCC certification
A: No, it will not, as long as the antenna is presented with 50 Ohm as impedance

The actual chip antenna is out of stock at Digikey until mid August but it looks like Mouser has some available:

http://www.mouser.com/ProductDetail/Johanson/2500AT44M0400E/?qs=%2fha2pyFadugpD5gBUDGQSn%252bW0HmcSx9RC8ktaRFgaawx3dWMIUc1gg%3d%3d

Hope this helps.
Logged

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

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

I think I may be getting close to figuring this out. It may be a timing problem of the code taking too much time inside digitalRead & Write and missing pulses on the IRQ line.

If you have time, try replacing the digitalRead()s & digitalWrites() in ArduinoCC3000Core.cpp and ArduinoCC3000SPI.cpp with the direct port bit equivalents. If you don't have time or don't know how to do that, I should be able to test it out this weekend. Are you using a plain old Uno or another Arduino variant?


I am using a plain UNO. I got what you are telling me to do, i'll try that.
Actually i am very new to arduino and this can be taken as my 1st project with UNO, i am quite experienced in coding on direct atmega environment so on this weekend i'll try to port the code on AtMega328P. i have ordered a MSP430 board too, so i'll update the firmware of CC3000 chip smiley
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
I got what you are telling me to do, i'll try that.

I hope this works for you. In my own tests today I confirmed what you're seeing, that sometimes (often?) nvmem_get_mac_address() was locking up. I've made these code changes to the library:

ArduinoCC3000Core.h
Code:
#define Read_CC3000_IRQ_Pin() ((PIND & B00001000) ? 1 : 0)

#define Set_CC3000_CS_NotActive() PORTB |= B00000100
#define Set_CC3000_CS_Active() PORTB &= B11111011

ArduinoCC3000Core.cpp
Code:
inline long ReadWlanInterruptPin(void) {
return(Read_CC3000_IRQ_Pin());
}

ArduinoCC3000SPI.cpp
1. Replaced all references to ASSERT_CS with Set_CC3000_CS_Active()
2. Replaced all references to DEASSERT_CS with Set_CC3000_CS_NotActive()

After I made these changes I haven't seen the problem.


I have a new version of the library published on github, it's got some RAM reduction (TI loves to use 'long's, even when the return value is only 0 and 1), a few bug fixes, and a bunch of new demo code.

There is still a problem where Smart Config works fine on the Teensy but not on a regular ATMega328 Uno. It actually does work, but the library never sends the function a HCI_EVNT_WLAN_ASYNC_SIMPLE_CONFIG_DONE event so you can't tell it's working. It's very weird, but I will keep looking.

Good luck!
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

Hi magagna! I saw your new work in github! It looks sooo fine, plenty of examples! When initializing CC3000, there is a message saying "Unable to get firmware version. Can't continue.". I think that it is caused by an old firmware version, is it?. In previous tests, nvmem_read_sp_version was returning 255 which means an error. I think that i should purchase the TI evaluation board to update the firmware... but it is out of stock!

Nice job!
Logged

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

Hi magagna! I saw your new work in github! It looks sooo fine, plenty of examples! When initializing CC3000, there is a message saying "Unable to get firmware version. Can't continue.". I think that it is caused by an old firmware version, is it?. In previous tests, nvmem_read_sp_version was returning 255 which means an error. I think that i should purchase the TI evaluation board to update the firmware... but it is out of stock!

Nice job!

Thanks! Try commenting out or removing the error checking code in the .ino file. My guess is you're right that it's a bug in older firmware.
Logged

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

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

Hi all,

There is something I don't understand.  The simple link start command has no arguments, but has a argument length of 1 (in bold below).  Does anyone know why?  Am I misunderstanding this argument stuff? 

Host sends CC3000 over SPI the first command: HCI_CMND_SIMPLE_LINK_START
Data: 01 00 05 00 ...  00 01 00 40 01 00 (command opcode 0x4000)


http://processors.wiki.ti.com/index.php/CC3000_Serial_Port_Interface_%28SPI%29

Thanks. 
Logged

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