6 years, 10 months ago.

Setup for Adafruit CC3000 and the mbed LPC1768

Hello, I can't quite figure out how to setup the CC3000 module from Adafruit with the mbed LPC1768. I am using the SPI on p5, p6 and p7, IRQ p8, VEN on p9 and Cs on p10. What is the IRQ_port of p10? What needs to be done in the init? Thanks Regards

Question relating to:

4 Answers

6 years, 10 months ago.

Hello Markus Hirsch,

p10 is P0_1 for LPC1768 which means it's port 0. http://mbed.org/users/Lerche/notebook/lpc1768-pin-functions/

If I am not wrong, this IRQ_type should be it:


I will look at this limitation.


You require EINT3_IRQn. p10 is a GPIO interrupt and not a dedicated interrupt pin, they share an interrupt source with external interrupt 3: EINT3.

posted by Erik - 11 Oct 2013

Hey Erik, is this anywhere on mbed? I did not have the reference manual, thus it was only a guess.

posted by Martin Kojtal 11 Oct 2013

I think it is only in the reference manual. Mbed only uses the GPIO interrupts and not the external interrupts, and they are added to the third external interrupt vector. See page 74: http://www.nxp.com/documents/user_manual/UM10360.pdf (Yeah they managed to hide it fairly well also in the manual).

posted by Erik - 11 Oct 2013
6 years, 10 months ago.

Thanks, printed out that page right away :-)

Edit: it does not seem to work. The system hangs whenever a cc3000 function is called. The strange thing is that it sometimes very seldom does connect to the WIFI. But mostly it just freezes, even if I just try to read the MAC address. I cant figure out whats wrong. It does not run anywhere near stable. Sometimes it connects, mostly it just freezes. Strangely it also depends on the following code at what point it hangs. So there must be something fundamentally wrong what I am doing. Has anyone actually used the Adafruit CC3000 together with the mbed LPC1768 and has some tips?

Thanks for the help so far.

Hello Markus Hirsch,

there's was a user who did testing on mbed board with an external cc3000 module. How did you connect the module to your board? should be shortest route possible.

how did you set up the init function? What demo are you testing? Hello world runs here all the time. Right now I am running an application on cc3000 for more than 2 hours, no problems encountered.

If you are not able to just read mac address, there's a problem with SPI. Turn the debug messages on (macros inside cc3000.h file). They might help you. Do you have spectral analyzer to check SPI communication?

posted by Martin Kojtal 11 Oct 2013

Hello Martin, thanks a lot for the help! I tried to turn the SPI clock down to 200KHz but it would still have the same behaviour. With a logicanalyzer the spi looks ok. I will have too try the spectrum, I am wiring this on a breadboard... On the debug I get:

<27>[2;36;40m[CC3000 : HCI TX] Command Sent : 0x4000<27>[0;37;40m<\r><\n>

<27>[2;35;40m[CC3000 : HCI RX] Event Received : 0x4000<27>[0;37;40m<\r><\n>

<27>[2;36;40m[CC3000 : HCI TX] Command Sent : 0x400B<27>[0;37;40m<\r><\n>

and then nothing more. This sequence is from wifi.start(0). Sometimes it gets as far as to finish this and then hangs on getting the MAC address. What config for the Ports and IRQ did you use? In my init() there is the IRQ prioritys:

NVIC_SetPriority(SSP1_IRQn, 0x0);

NVIC_SetPriority(EINT3_IRQn, 0x1);

NVIC_SetPriority(SysTick_IRQn, 0x2);


posted by Markus Hirsch 12 Oct 2013

What demo are you running? I can take a screenshot with a debug info from my console. I already notified Dave, who run cc3000 code on mbed board. Hope he will respond here to further assist you.

I will get an external cc3000 in like 3 weeks.


posted by Martin Kojtal 12 Oct 2013
6 years, 10 months ago.

Hi Markus,

Sorry you are having trouble with the demo I should have released the software for the LPC1768, for now please use the link here :



If you have any problems please let me know. Dont forget to change the socket channel to your own.


Marlus, I just remembered you will need a separate 3.3v supply to run the demo, the Mbed LP1768 3.3v supply does not have sufficient current for the CC3000, it will cause the Mbed to continually reset.


posted by David Fletcher 12 Oct 2013

Thanks a lot!!! Your version worked!!! It seems to be stable now. Where is the difference to the other library? Thanks so much for the help!

(The only strange thing is that when I enter a wrong key it still tells me its connected and then waits forever to get a IP through DHCP.)

posted by Markus Hirsch 13 Oct 2013


The changes are minimal, and are based around how the interrupt is handled, you can see this by looking at cc3000_spi and cc3000 source files, to tell you more would spoil your fun finding the changes. In answer to your second question, you can either see the issue as a security feature, or post your question on the CC3000 home page. We hope you enjoy your CC3000!


posted by David Fletcher 13 Oct 2013
6 years, 8 months ago.

Hi, David, I am having problem using LPC1768 with cc3000. I am running the code (hello world) you provided, and found there are two problems:

1. The firmware version, service pack version and other information from cc3000 seems not correct. I tried the cc3000 with arduino, the service pack version should be 1.24 and the other readings seem also incorrect.

2. CC3000 cannot get ip address from DHCP.

Anyone can help me setting up cc3000 with LPC1768?

Here is the output after enabling the debug msgs:

cc3000 Hello World demo.

MAC address + cc3000 info

[CC3000 : HCI TX] Command Sent : 0x0201

[CC3000 : HCI RX] Event Received : 0x0201

[CC3000 : HCI TX] Command Sent : 0x0201

[CC3000 : HCI RX] Event Received : 0x0201

MAC address 08:00:28:57:ae:51


PP_version 191.4

SERV_PACK 153.16

DRV_VER 49.4.153

FW_VER 10.49.19

Attempting SSID Connection.

[CC3000 : HCI TX] Command Sent : 0x0004

[CC3000 : HCI RX] Event Received : 0x0004 - Connect Policy

Connecting to SSID: my_network. Timeout is 10s.

[CC3000 : HCI TX] Command Sent : 0x0002

[CC3000 : HCI RX] Event Received : 0x0002 - Disconnect

[CC3000 : HCI TX] Command Sent : 0x0001

[CC3000 : HCI RX] Event Received : 0x0001 - Connecting


DHCP request

Waiting for dhcp to be set.

For people who are reading this post please do not use my media/upload link for software! Go to the CC3000 home page and download the software there, as it is up to date and works on the LPC1768, it just needs to be setup correctly. If you have problems start a new thread thanks.


posted by David Fletcher 23 Mar 2014