The CC3000 SDK (Software Development Kit) contains examples for MSP-EXP430F5529 development kit + CC3000EM. The MSP-EXP430F5529 (TI e-Store price: 175 USD) is far more expensive than the MSP-EXP430F5529LP Launchpad (TI e-Store price: 112.99 USD), and the CC3000EM is no longer available, replaced by the CC3000BOOST. This short guide shows how to modify the examples delivered in the CC3000 SDK (for MSP-EXP430F5529+CC3000EM), so the same code can run on the MSP-EXP430F5529LP Launchpad + CC3000BOOST boosterpack.
Hardware Consideration
The following table shows the pinout connection between the CC3000EM and MSP-EXP430F5529:
CC3000EM | MSP-EXP430F5529 |
---|---|
VBAT_SW_EN | P2.3 |
WL_SPI_CLK | RF_SPI_CLK (P3.2) |
WL_SPI_DOUT | RF_SOMI (P3.1) |
WL_SPI_DIN | RF_SIMO (P3.0) |
WL_SPI_CS | RF_STE (P2.6) |
WL_SPI_IRQ | P2.4 |
The following table shows the pinout connections of the CC3000BOOST-MSP-EXP430G2 Launchpad connections and the respective MSP-EXP430F5529LP pinout comparison:
CC3000BOOST | MSP-EXP430G2 | MSP-EXP430F5529LP |
---|---|---|
VBAT_SW_EN | P1.0 | P6.5 |
WL_SPI_CLK | P1.5 | P3.2 |
WL_SPI_DOUT | P1.6 | P3.1 |
WL_SPI_DIN | P1.7 | P3.0 |
WL_SPI_CS | P2.6 | P2.2 |
WL_SPI_IRQ | P2.7 | P2.0 |
As can be seen above, both MSP-EXP430F5529 and MSP-EXP430F5529LP uses the same USCI_B0 pinout for the SPI interface lines (P3.0-P3.2), and the difference between the two boards are at the VBAT_SW_EN, WL_SPI_CS, and WL_SPI_IRQ lines.
Besides that the CC3000 example code usually uses an UART interface for communicating with PC host. In this case both fortunately both MSP-EXP430F5529LP and MSP-EX430F5529 uses the same USCI_A0 UART interface (P4.5-RXD, P4.4-TXD), so no change is needed for the UART interface lines.
Modifying Driver Codes
The definitions of CC3000 module interface are located in board.h header file. First, download the latest CC3000 SDK (I am using the v1.12), it contains the Basic Wi-Fi example. Open the one for MSP-EXP430F5529 which can be found under <CC3000SDK_INSTALL_DIR>\CC3000 SDK\MSP430F5529\Basic WiFi Application. You can choose between IAR or CCS version, since modifying the code will work for both.
Open the board.h header file and change connections for the VBAT_SW_EN, WL_SPI_CS, and WL_SPI_IRQ lines as follows:
........... #ifndef BOARD_H #define BOARD_H // comment/uncomment to select between MSP-EXP430F5529 and MSP-EXP430F5529LP // pinout #define __MSP_EXP430F5529LP__ // Pins from MSP430 connected to the RF Header #ifdef __MSP_EXP430F5529LP__ #define SPI_IRQ_PIN BIT0 #define WLAN_EN_PIN BIT5 #else #define SPI_IRQ_PIN BIT4 #define WLAN_EN_PIN BIT3 #endif #define SPI_SIMO BIT0 #define SPI_SOMI BIT1 #define SPI_CLK BIT2 #ifdef __MSP_EXP430F5529LP__ #define RF_CS BIT2 #else #define RF_CS BIT6 #endif // Ports #define SPI_SEL P3SEL #define SPI_DIR P3DIR #define SPI_OUT P3OUT #define SPI_REN P3REN #define RF_CS_SEL P2SEL #define RF_CS_OUT P2OUT #define RF_CS_DIR P2DIR #define SPI_IRQ_DIR P2DIR #define SPI_IRQ_IN P2IN #define SPI_IRQ_IES P2IES #define SPI_IRQ_IE P2IE #define SPI_IFG_PORT P2IFG #ifdef __MSP_EXP430F5529LP__ #define WLAN_EN_DIR P6DIR #define WLAN_EN_OUT P6OUT #else #define WLAN_EN_DIR P2DIR #define WLAN_EN_OUT P2OUT #endif #define LED1 0x01 #define LED2 0x02 #define LED3 0x03 ...........
In order to maintain the compatibility between the MSP-EXP430F5529 and MSP-EXP430F5529LP, I added the compile time option __MSP_EXP430F5529LP__ (line 9 in the code above). By commenting and uncommenting the macro define __MSP_EXP430F5529LP__ above, you can basically select whether to use the MSP-EXP430F5529 (line commented) or MSP-EXP430F5529LP (line uncommented).
Finally, we need to change the interrupt processing due to the difference of WL_SPI_IRQ line (P2.4 at MSP-EXP430F5529 and P2.0 at MSP-EXP430F5529LP). Open spi.c file and do the following change in IntSpiGPIOHandler() ISR function:
__interrupt void IntSpiGPIOHandler(void) { switch(__even_in_range(P2IV, P2IV_P2IFG7)) { #ifdef __MSP_EXP430F5529LP__ case P2IV_P2IFG0: #else case P2IV_P2IFG4: #endif ................ }
Now we are good to go. Compile the code and flash it to your MSP-EXP430F5529LP with CC3000BOOST attached to the Launchpad, and run the code. Remember that you can always switch back to MSP-EXP430F5529+CC3000EM configuration by commenting the __MSP_EXP430F5529LP__ macro in the beginning of the board.h header file.
I tried this on my MSP430EXP5529LP along with the TI example http://processors.wiki.ti.com/index.php/CC3000_Basic_Wi-Fi_example_application_for_MSP430F5529
But doesn’t work. Problem is, my hyperterminal is not showing the board version etc, meaning CC3000 is not configured properly.
I am using CCSv5_5. Any thoughts?
Hi lilyhack, have you tried to debug in which part of the code does the code hang?
HI, this page is really helpful and informative. I’m a beginner and I am trying to create a web server using CC3000 & Tiva C tm4c123g. However, there are only example on HTTP server for MSP and not Tiva.
Is it possible to modify the code for MSP to work with TIVA?
Can you direct me to any website giving me detailed explaination on how to do this or if you have knowledge on this, can you point me in the right direction.
Hello Everyone,
Can u please tell me in which file i should modify above changes in CCS example. I’m using CCS6
Thanks in Advance.
Regards,
Venkatesh.
Hello Leo,
I am using CC3000 booster pack with MSP-EXP430F5529LP Launchpad. Below i attached the executable to download, obtained making above changes in the code using IAR. can you just test the code with launchpad. As i’m unable to program it into my board.
link to my Binary
https://drive.google.com/file/d/0B-VwwhTCAtj8bmxscTlDcHFyYk0/edit?usp=sharing
Please help..