Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 11 months ago.
Adafruit cc3000 shield
Hi All,
I have an Adafruit cc3000 shield and a kl25z. Using this combination, I am able to power the board and connect to my home wifi network using the new cc3000 host library (great work on an awesome library, by the way!). However, when I attempt to open a TCP server socket, the "accept" function always returns an error. I am testing with the "cc3000 tcp server demo" demo program.
I am pretty sure this is power related as the shield draws quite a lot power. I am not using any external power for this shield, just the kl25z plugged into USB on my windows laptop. I note that the demo is designed for the WiGo, which is basically a tweaked kl25z and I believe something has been altered on the power supply. There is also a reference to requiring 500mA in the init() function of the demo program
I am a software guy and fairly new to the hardware side of things. Can anyone suggest how I can power the cc3000 shield externally without impacting the USB functionality? When I've done this on a teensy3.0,it was a matter of cutting a trace on the board to isolate the 5v line from the USB and the powering the board via an external 5v source.
With the kl25z, that is not how it's done (I think). Can I just apply a 5v source to the VIn and grounds pins on the cc3000 sheild? If I do this, would I need to do anything to protect the kl25z. I am going to stack this shield with an RF22B radio shield so don't want to impact that one, either.
Regards James
2 Answers
10 years, 11 months ago.
Hello James,
thanks!
I run some tests with KL25Z, there's assembled regulator which is not much low dropout regulator (1.2V), there's also diode D2 where is another voltage drop. The most we got was around 160mA, which is not sufficient for cc3000. You need an external source for cc3000. Please add external power source, and report back if it works! I have external cc3000 but haven't got time to play with it.
To answer your last paragraph, please check 5.1 Power Supply section in the User guide for KL25Z. There's table with answers.
Regards,
0xc0170
10 years, 11 months ago.
Thanks to Martin and David for your help so far. Seems the more I dig the more issues I am discovering.
Both KL25Z boards I have are revision D and I have discovered this board has numerous issues including
1. Doesn't supply 3.3v to the 3.3v pin (not really an issue in this case)
2. Doesn't supply power to the 5v pin when powered from an external source on the V_IN pin.
The second issue meant that I couldn't power the cc3000 by powering the KL25Z externally from a 2S Lipo battery, despite the fact that the KL25Z itself powered ok this way. I don't have access to a clean 5v power source/converter at this point for direct connection to the CC3000, but have ordered some.
This site explains the KL25Z Revision D issues http://www.element14.com/community/docs/DOC-55214/l/review-for-frdm-kl25z-rev-e-and-modify-it-to-generate-5v-from-vin
I also discovered my cc3000 shield was missing the ceramic antenna it was supposed to come with, which explained why it only worked with an external antenna attached. I had thought this was a power issue, too. I wonder what else it is missing? It may just be a dud board!
I have sourced the breakout version of the board, as per what David is using so will try that tonight. Sounds like external power may not be necessary, based on David's tests, but I will try both ways.
I will also double check my firewall & antivirus software, but I am pretty sure that is not the issue.
USB 3.0 sounds good, but my computer doesn't support it. Maybe I need to ask for a new one for Christmas :-)
I'll keep you posted.
PS. I'm only able to accept Martin's answer (David's show up as comments only), but you have both helped in equal measure, I appreciate it.
Update: As per David's findings, I have played around a bit more with the cc3000 demos and my cc3000 shield and discovered that I can indeed power it directly from USB without external power. My problem is not power related at all, although when I use this board in the field without USB, I will need to power it externally.
The issue I was having appears to be a misunderstanding of how the TCPSocketServer::accept function should work. On other platforms, accept is usually blocking unless you specifically set it not to be. However, the accept function here is non-blocking. So it appears to return instantly with an error. However if it receives a connection, it accepts it correctly.
It would be good to either add a note to the documentation or change the accept function to be blocking and not return immediately, as I imagine most programmers would be expecting this function to block.
posted by 05 Dec 2013CAn you start a new question/discussion regarding blocking socket for cc3000? The socket is set to blocking (true) by default in the Socket layer, means it should be blocking for cc3000. Probably need to check this, check what getsockopt returns. I can't recall it at the moment.
Regards,
0xc0170
Martin, It is blocking but set at 1.5 sec and appears very quick, so maybe a timer issue! I can increase the blocking time ok.
Dave.
posted by 05 Dec 2013Thanks for the update. So it appears that the only change would be to increase the default timeout or block indefinately. It would also be good if the socket could return a different error code for a timeout, given it's not really an error.
I'll start a new thread on this, as requested.
posted by 05 Dec 2013
Hi James, If you obtain an IP address without any issues, for example your usb port being reset multible times, then your issue is not power. The current required is peak 350mA for the Tx current only. I do not have an Adafruit cc3000 sheild, but do have a KL25z and an Adafruit breakout board. At the moment it's being used else where, so will take a while for me to dig it out.
Dave.
posted by David Fletcher 04 Dec 2013James, I Have now had time to test the KL25Z and my Adafruit CC3000 breakout board, on a usb 2.0 connection, and did not find any problems. If you are going to develop using multiple platforms using usb as your power source. May I make a suggestion that you use a usb 3.0 powered hub as they support 900mA per connection. I have not tried the KL25Z on usb 3 yet, and I have heard that netmf boards get hung up, I have not had any problems with a number of different development boards I have used with usb 3. Also please check that your firewall or anti-virus software is not blocking your connection.
EDIT: I have now checked using the KL25Z on a usb 3.0 powered hub and it works fine.
posted by David Fletcher 04 Dec 2013