gwdeveloper 275 Posted November 30, 2011 Share Posted November 30, 2011 This tutorial is meant to provide simple instruction to prepare a SimpliciTI wireless project using the TI Launchpad and CC2500 radio. Currently, CCSv5.1 will compile this program but have a few syntax errors. They can be ignored for now. CCSv4 will compile with no issues.Please feel free to critique and ask questions. It helps to make us all better.Part 1 of 2Hardware Needed:Launchpad with MSP430G2553CC2500 Radio (several variants available; MDFLY CC2500 breakout or ez430-RF2500t)(will insert an image of various hardware versions from TI to DIY)Software Needed:TI's CCS v5.1 http://processors.wi...hp/Download_CCSSimpliciTI 1.1.1 for CCS http://www.ti.com/tool/simplicitiLP_G2553.zip (launchpad BSP for simpliciTI)2274_SimpliciTI_Toggle.zip (only needed for RF2500T used as slave; it will disable the cpu and set up peripherals to toggle leds) 2274_SimpliciTI_Toggle.zipStep 1: Install Softwares.- Install CCS v5 OR V6 for the MSP430 (if you don't already use CCS)- Install SimpliciTI 1.1.1 (make note of the install directory; we'll use C:\Texas Instruments\SimpliciTI-CCS-1.1.1)- unzip LP_G2553.zip bsp files to C:\Texas Instruments\SimpliciTI-CCS-1.1.1\Components\bsp\boards- modified vlo_rand library for easy address assignment will be unzipped later- for RF2500T, unzip 2274_SimpliciTI_Toggle.zip to your current CCS workspace--- this project will need to be imported to CCS via Project -> Import Existing CCS ProjectStep 2: Create CCS Project-File -> New CCS Project-Give project name. Select MSP430 Family and MSP430G2553 as variant. Connection should be left to default and Empty Project selected for template.5_2folder_structure.JPG[/attachment]Step 4: Create project file structure-Now you will need to open the SimpliciTI\components folder.--- for eg; C:\Texas Instruments\SimpliciTI-CCS-1.1.1\Components(after the following actions, select "Link To" for the copy action)-- drag 3 files from ..\bsp to the bsp project folder-- drag 3 files from ..\mrfi to the mrfi project folder-- drag all files from ..\Simpliciti\nwk to nwk project folder-- drag all files from ..\Simpliciti\nwk_applications folder to nwk applications project folder-We'll borrow the nwk .dat files from the EZ430RF project--drag smpl_nwk_config.dat from \SimpliciTI-CCS-1.1.1\Projects\Examples\eZ430RF\Simple_Peer_to_Peer\CCS\Configuration to the configuration project folder.--drag smpl_config.dat from \SimpliciTI-CCS-1.1.1\Projects\Examples\eZ430RF\Simple_Peer_to_Peer\CCS\Configuration\End_Device to the end device project folder.[attachment=1]5_3linked_files.JPG[/attachment]end of part 1. (limited due to 5 attachments per entry) larsie, znanev, unixxdeveloper and 9 others 12 Quote Link to post Share on other sites
gwdeveloper 275 Posted November 30, 2011 Author Share Posted November 30, 2011 Step 5: Add Includes and Predefines -Right Click on Project -> Properties -Under Build; MSP430 Compiler; Include Options --Add SimpliciTI directories to include. There will be a total of 6 folders. ---\bsp ---\bsp\boards\LP_G2553 ---\mrfi ---\nwk ---\nwk_applications Add main files and create new configurations -unzip the vlo_rand files and copy(not link) to your project's application folder -cut and paste the main_rx.c and main_tx.c files into your project's application folder main_tx.c /* transmitter code */ #include "msp430g2553.h" #include #include "bsp.h" // bsp header files #include "bsp_leds.h" // included with simpliciti #include "bsp_buttons.h" #include "mrfi.h" // simpliciti headers #include "nwk_types.h" #include "nwk_api.h" #include "vlo_rand.h" /* global variables */ typedef struct sensors_struct { char cadc; int iadc; }my_sensors; struct sensors_struct sensor; unsigned int i; volatile int ADCdata[10]; // dtc address // for simpliciti tx/rx linkID_t linkIDTemp; uint8_t msg[8]; addr_t lAddr; char *Flash_Addr; /* end globals */ /* prototypes for init functions */ void Init_ADC10(void); void Init_TIMER0A0(void); void createRandomAddress(void); /* end prototypes */ void main(void) { sensor.cadc = 'A'; sensor.iadc = 125; BSP_Init(); // init bsp first, then simpliciti BCSCTL3 = LFXT1S_2; // aclk = vlo // address check and creation Flash_Addr = (char *)0x10F0; // RF Address = 0x10F0 if( Flash_Addr[0] == 0xFF && // Check if device Address is missing Flash_Addr[1] == 0xFF && Flash_Addr[2] == 0xFF && Flash_Addr[3] == 0xFF ) { createRandomAddress(); // Create Random device address at } // initial startup if missing lAddr.addr[0] = Flash_Addr[0]; lAddr.addr[1] = Flash_Addr[1]; lAddr.addr[2] = Flash_Addr[2]; lAddr.addr[3] = Flash_Addr[3]; // load address SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, &lAddr); SMPL_Init(NULL); // null callback for TX Init_ADC10(); Init_TIMER0A0(); do { // wait for button if (BSP_BUTTON1()) { break; } } while (1); while (SMPL_SUCCESS != SMPL_Link(&linkIDTemp)) // link to Rx { BSP_TOGGLE_LED1(); // toggle red for not linked } BSP_TURN_OFF_LED1(); // red off BSP_Delay(2000); // for 2 seconds BSP_TURN_ON_LED1(); _EINT(); // Enable Global Interupts while (1) { BSP_TOGGLE_LED2(); // adc with dtc in use ADC10CTL0 &= ~ENC; // turn off adc10 while (ADC10CTL1 & BUSY); // wait if adc10 core is active ADC10SA = (unsigned int)ADCdata; // data buffer start ADC10CTL0 |= ENC + ADC10SC; // sampling and conversion start LPM3; // insert sensor calculations here // or // send raw adc data from P1.0 sensor.iadc = ADCdata[0]; // turn on radio and tx sensor struct SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, 0); SMPL_Send(linkIDTemp, (uint8_t *)&sensor, sizeof( my_sensors )); } } // setup adc10 to use dtc, 1 channels, void Init_ADC10(void) { ADC10CTL0 &= ~ENC; // turn off adc for settings ADC10CTL0 = ADC10ON + MSC + ADC10SHT_2 + SREF_0; // turn on; multisample; 16 cycles; vcc/v-- ADC10CTL1 = CONSEQ_2 + ADC10SSEL_0 + ADC10DIV_0 + SHS_0 + INCH_10; // repeat single; smclk; /1; int temp sensor //ADC10AE0 = 0x01; // enable adc channel; not needed for int temp ADC10DTC0 = ADC10CT; // continuous transfer ADC10DTC1 = 10; // 10 transfers/block ADC10SA = (unsigned int)ADCdata; // start address for dtc conversions ADC10CTL0 |= ENC; } void createRandomAddress(void) { unsigned int rand, rand2; char *Flash_Addr; Flash_Addr = (char *)0x10F0; do { rand = TI_getRandomIntegerFromADC(); // first byte can not be 0x00 of 0xFF } while( (rand & 0xFF00)==0xFF00 || (rand & 0xFF00)==0x0000 ); rand2 = TI_getRandomIntegerFromADC(); BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz DCOCTL = CALDCO_1MHZ; FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 for Flash Timing Generator FCTL3 = FWKEY + LOCKA; // Clear LOCK & LOCKA bits FCTL1 = FWKEY + WRT; // Set WRT bit for write operation Flash_Addr[0]=(rand>>8) & 0xFF; Flash_Addr[1]=rand & 0xFF; Flash_Addr[2]=(rand2>>8) & 0xFF; Flash_Addr[3]=rand2 & 0xFF; FCTL1 = FWKEY; // Clear WRT bit FCTL3 = FWKEY + LOCKA + LOCK; // Set LOCK & LOCKA bit } // enable Timer0a0 16bit up mode void Init_TIMER0A0(void) { TA0CCTL0 = CCIE; // no capture, toggle TA0CCR0 = 12000; // about 1 sec with vlo TA0CTL = TASSEL_1 + ID_0 + MC_1; // ACLK, /1, up mode } // Timer0A0 isr #pragma vector=TIMER0_A0_VECTOR __interrupt void Timer0A0(void) { __no_operation(); // cycle alphabet to show part of struct transfer if (sensor.cadc < 90) { sensor.cadc = 'A'; } else { sensor.cadc++; } LPM3_EXIT; // Exit LPM } main_rx.c /* receiver code */ #include #include #include #include "vlo_rand.h" #include "bsp.h" // bsp header files #include "bsp_leds.h" // included with simpliciti #include "bsp_buttons.h" #include "mrfi.h" // simpliciti headers #include "nwk_types.h" #include "nwk_api.h" /* global variables */ typedef struct sensors_struct { char cadc; int iadc; }my_sensors; struct sensors_struct sensor; /* bsp related variables */ linkID_t linkIDTemp; uint8_t smpl_buffer[MAX_APP_PAYLOAD]; uint8_t len; uint8_t flag; addr_t lAddr; char *Flash_Addr; static uint8_t sRxCallback(linkID_t); void createRandomAddress(void); /* end globals */ void main(void) { BSP_Init(); // init bsp first, then simpliciti // address check and creation Flash_Addr = (char *)0x10F0; // RF Address = 0x10F0 if( Flash_Addr[0] == 0xFF && // Check if device Address is missing Flash_Addr[1] == 0xFF && Flash_Addr[2] == 0xFF && Flash_Addr[3] == 0xFF ) { createRandomAddress(); // Create Random device address at } // initial startup if missing lAddr.addr[0] = Flash_Addr[0]; lAddr.addr[1] = Flash_Addr[1]; lAddr.addr[2] = Flash_Addr[2]; lAddr.addr[3] = Flash_Addr[3]; // load address SMPL_Ioctl(IOCTL_OBJ_ADDR, IOCTL_ACT_SET, &lAddr); SMPL_Init(sRxCallback); SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, 0); // turn on radio, listen while (SMPL_SUCCESS != SMPL_LinkListen(&linkIDTemp)) // link to Tx { BSP_TOGGLE_LED1(); // toggle red for not linked } BSP_TURN_OFF_LED1(); // red off NWK_DELAY(2000); // for 2 seconds BSP_TURN_ON_LED1(); _EINT(); // Enable Global Interupts while (1) { } } static uint8_t sRxCallback(linkID_t linkIDTemp) { SMPL_Receive(linkIDTemp, (uint8_t*)&smpl_buffer, &len); if(len == sizeof(my_sensors)) { memcpy(&sensor, smpl_buffer, len); } else { __no_operation(); BSP_TOGGLE_LED1(); } // replace with_ return message; return 0; } void createRandomAddress(void) { unsigned int rand, rand2; char *Flash_Addr; Flash_Addr = (char *)0x10F0; do { rand = TI_getRandomIntegerFromADC(); // first byte can not be 0x00 of 0xFF } while( (rand & 0xFF00)==0xFF00 || (rand & 0xFF00)==0x0000 ); rand2 = TI_getRandomIntegerFromADC(); BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz DCOCTL = CALDCO_1MHZ; FCTL2 = FWKEY + FSSEL0 + FN1; // MCLK/3 for Flash Timing Generator FCTL3 = FWKEY + LOCKA; // Clear LOCK & LOCKA bits FCTL1 = FWKEY + WRT; // Set WRT bit for write operation Flash_Addr[0]=(rand>>8) & 0xFF; Flash_Addr[1]=rand & 0xFF; Flash_Addr[2]=(rand2>>8) & 0xFF; Flash_Addr[3]=rand2 & 0xFF; FCTL1 = FWKEY; // Clear WRT bit FCTL3 = FWKEY + LOCKA + LOCK; // Set LOCK & LOCKA bit } -Right click on your project -> properties to create new configurations -from main panel, select "Manage Configurations" -- create RX and TX configurations, copying settings from existing Debug configuration This section will need to be repeated for each build configuration. -Under Build; MSP430 Compiler; Advanced Options; Command Files --add links to the EZ430RF project's nwk .dat files [attachment=0]5_commandfiles.JPG[/attachment] -Under Build; MSP430 Compiler; Advanced Options; Predefined Symbols --Add new Pre-define Name "MRFI_CC2500" -press ok to return. --right click project -> Build Configurations -> Set Active -> RX --right click main_tx.c -> Resource Configurations -> Exclude from Build -Repeat the process, making TX the active Build Configuration and excluding main_rx.c If you followed these instructions, you're currently ready to build the TX side of the application. Click the hammer and build the application. If you get any errors, follow back through the steps to make sure you have all of the settings and includes properly configured. If all is well, program your LP and press play. Of course not much will happen until you program the RX application and debug it as well. Very simply, it creates a connection and transmits analog data read from the internal temp sensor. These example applications are creating the most simplified connection with no dropped connection checks. Use the SimpliciTI API to extend the applications with Link_To and Listen_To. Changing the configuration .dat files will also also for multiple end devices and one access point. I hope this tutorial helped a few people out with running the SimpliciTI RF wireless stack. The instructions can be followed to run SimpliciTI on the Launchpad with G2553, ez430-RF2500t and MSP-EXP430F5529 development board(or the sweet F5529 board found on 43oh.com). BTW, this can also run on an EvalBot with minor changes. yoyogin, RobG and legailutin 3 Quote Link to post Share on other sites
kenemon 29 Posted December 2, 2011 Share Posted December 2, 2011 Sorry to bother GW, I tried to load up that g2553 code you posted, and i was bounced for code size violation. Does this mean I need to purchase ISR upgrade? what are you using. I prefer CCS, but i cant seem to find the project folder posted anywhere.... thanks. KB Quote Link to post Share on other sites
gwdeveloper 275 Posted December 4, 2011 Author Share Posted December 4, 2011 Hello KB. There shouldn't be any code size violations with the demo of CCS. The demo TX program compiles to about 8.5K which is well under the 16K limit of CCS. If you're using IAR Kickstart, you'll run out of room at 4K. Also, the bsp for the G2553 I uploaded will only work in the CCS version of SimpliciTI. IAR's version has different declarations for the interrupts and variables. kenemon 1 Quote Link to post Share on other sites
gwdeveloper 275 Posted December 6, 2011 Author Share Posted December 6, 2011 Just wanted to add a SimpliciTI BSP for the MSP-EXP430FR5739 board as well. Finally got the clock and SPI configured properly. [attachment=0]EXPFR5739.zip[/attachment] bluehash 1 Quote Link to post Share on other sites
kenemon 29 Posted December 6, 2011 Share Posted December 6, 2011 Thanks GW, sorry to keep pecking at you. I managed to get CCS working, but as I am trying to work with SimpliciTI and the LSR WiFi modules, I am a little stuck. Looks like I need a 4wire JTAG programmer..... Too bad the LP doesnt break out a few more pins on the F chip. Makes me think it was intentional to ensure the longevity of their $100+ programmer.. KB Quote Link to post Share on other sites
gwdeveloper 275 Posted December 7, 2011 Author Share Posted December 7, 2011 I've looked at the LSR wifi modules but never had a chance to test with one. LSR does have a SimpliciTI porting guide in their download section though. You may want to look at that to see if it requires any other changes. kenemon 1 Quote Link to post Share on other sites
kenemon 29 Posted December 9, 2011 Share Posted December 9, 2011 @GW: I have seen that (unreleased) porting guide there, I am trying to learn from you, because they only provide an IAR package. Did you get any LSR modules when they were passing by? Quote Link to post Share on other sites
kenemon 29 Posted December 19, 2011 Share Posted December 19, 2011 HI All, some confusion here regarding the wireless chips. In general, I understand using the TI chips require programming with the cc-debugger. However, some of the evm's use other evm's to program them. Similar to the LP (has onboard debugger), that makes sense. My question is on the soc chips, do you need to program both the mcu AND the radio chip? Or, is the firmware something that isnt accessable at that point? Do the CC2500's come with preinstalled firmware, or did you need to program them for this project? Thanks. Quote Link to post Share on other sites
GarySeven 8 Posted December 20, 2011 Share Posted December 20, 2011 The radio chips don yoyogin and kenemon 2 Quote Link to post Share on other sites
EE_Felix_2012 0 Posted May 23, 2012 Share Posted May 23, 2012 Hi I would like to know how this can be implemented on the CC110L booster pack. I also can't seem to see the images attached. Quote Link to post Share on other sites
bluehash 1,581 Posted May 23, 2012 Share Posted May 23, 2012 I can see the images fine. I'm using chrome. Also, welcome to the Forums! Quote Link to post Share on other sites
EE_Felix_2012 0 Posted May 23, 2012 Share Posted May 23, 2012 Yea I got the images to show up, now I am just trying to figure out how to use this tutorial with CC110L. If anyone knows how I would appreciate it if you could let me know how. Quote Link to post Share on other sites
MarkusR 0 Posted October 24, 2012 Share Posted October 24, 2012 Couple of issues:1) I cannot see any of the pictures. (but I was able to configure the project and compile it OK).2) Is there a schematic for wiring the MSP430 Launchpad with G2553 to the CC2500 Module that you get from 43oh store?Adding: I assume the configuration is as follows from mrfi_board_defs:Launchpad pins -> cc2500 module pinP1.4 -> P8 (Chip Select)P1.5 -> P3 (SPI clock)P1.6 -> P2 (SPI transfer)P1.7 <- P4 (SPI transfer) P1.6 -> P4 (SPI transfer)P1.7 <- P2 (SPI transfer)VCC -> P1 (Vcc)GND -> P6 (Gnd) Quote Link to post Share on other sites
FnuGk 0 Posted November 6, 2012 Share Posted November 6, 2012 Hi the link for 2274_SimpliciTI_Toggle.zip seems to to just bring me to the dropbox 404 page. Could you provide a mirror? Thanks in advance Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.