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 ago.
Getting Started with Sparkfun cc3000 + LPC1768
I'm using the simple Hello World Example in the cookbook however I am using a different breakout board that that of Adafruit. I am using the sparkfun breakout board with instructions here: https://learn.sparkfun.com/tutorials/cc3000-hookup-guide for the ariduno. However I am trying to hook it up with the mbed.
Currently I have pins of the sparkfun cc3000 breakout set up like this :
GND -> external USB GND
VCC -> external USB supply (5v 1A)
MOSI - > mbed p5
MISO -> mbed p6
SCK -> mbed p7
CS -> mbed p10
INT -> mbed p9
EN -> mbed p8
I am more confused about which pins should go where for CS, INT, and EN because they do not correspond to the adafruit IRQ and VBEN. If anyone has insight on this that would be great.
Also the code that I am trying to get this to work is the original hello work program except I have defined MY_BOARD as MBED_BOARD_EXAMPLE:
main.h
#ifndef MAIN_H #define MAIN_H #define WIGO 1 #define WIFI_DIPCORTEX 2 #define MBED_BOARD_EXAMPLE 3 #define UNDEFINED 4 #define MY_BOARD MBED_BOARD_EXAMPLE void init(); #endif
I've left init.cpp alone however reading some other forums it seems that it should be changed? I am not sure about what to do if that is the case:
init.cpp
#include "main.h" #include "mbed.h" #if (MY_BOARD == WIGO) #include "NVIC_set_all_priorities.h" /** * \brief Wi-Go initialization * \param none * \return none */ void init() { DigitalOut PWR_EN1(PTB2); DigitalOut PWR_EN2(PTB3); // Wi-Go set current to 500mA since we're turning on the Wi-Fi PWR_EN1 = 0; PWR_EN2 = 1; NVIC_set_all_irq_priorities(3); NVIC_SetPriority(SPI0_IRQn, 0x0); // Wi-Fi SPI interrupt must be higher priority than SysTick NVIC_SetPriority(PORTA_IRQn, 0x1); NVIC_SetPriority(SysTick_IRQn, 0x2); // SysTick set to lower priority than Wi-Fi SPI bus interrupt PORTA->PCR[16] |=PORT_PCR_ISF_MASK; PORTA->ISFR |= (1 << 16); } #elif (MY_BOARD == WIFI_DIPCORTEX) /** * \brief Wifi DipCortex initialization * \param none * \return none */ void init() { NVIC_SetPriority(SSP1_IRQn, 0x0); NVIC_SetPriority(PIN_INT0_IRQn, 0x1); // SysTick set to lower priority than Wi-Fi SPI bus interrupt NVIC_SetPriority(SysTick_IRQn, 0x2); } #else /** * \brief Place here init routine for your board * \param none * \return none */ void init() { } #endif
I have edited NVIC_set_all_priorities.h since my LPC1768 board is supported:
NVIC_set_all_priorities.h
#ifndef SET_ALL_PRIO #define SET_ALL_PRIO #include "mbed.h" enum FIRST_LAST_IRQ { #define LPC176X first_IRQ_number = SysTick_IRQn, last_IRQ_number = CANActivity_IRQn, }; void NVIC_set_all_irq_priorities(int priority); #endif // SET_ALL_PRIO
However running the helloworld program doesn't give me any results. Tera Term prints out "cc3000 Hello World demo." however it doesn't print if the cc3000 module has successfully connected or failed to connect. Either the program is somehow stuck, it is in a loop, or my terminal is just not printing a response. I've set my baud rate on Tera Term correctly and the cc3000 has a 5v 1A external power supply.
If anyone has the experience to help me get my sparkfun module working I would really really appreciate it. Thank you so much!
Question relating to:
1 Answer
10 years ago.
If you are using the constructor in main without changes then connect like this:
CS -> mbed p8
INT -> mbed p9
EN -> mbed p10
Dave.
Edit: OP has opened a new question related to the above issue here: http://developer.mbed.org/questions/5380/cc3000-hangs-at-hci_event_handler/?c=14387
I connected the module to the mbed as per your instructions. But running the debug the module still hangs. Debugging also doesnt work. I've edited the macros in cc3000.h:
macro
#define CC3000_DEBUG_SOCKET 1 // Debug - HCI TX messages #define CC3000_DEBUG_HCI_TX 1 // Debug - HCI Rx messages #define CC3000_DEBUG_HCI_RX 1 // Debug - General Debug #define CC3000_DEBUG 1 // Add colour to the debug messages, requires a VT100 terminal like putty, comment out to remove #define VT100_COLOUR 1
but im not getting any results. On tera term, it just displays the message "cc3000 Hello World demo." and nothing more happens
posted by 24 Nov 2014