Jump to content
43oh

legailutin

Members
  • Content Count

    35
  • Joined

  • Last visited

Reputation Activity

  1. Like
    legailutin reacted to larsie in Anaren TI CC110L RF AIR Booster Pack   
    OK, so I made the library, and it was sort of working, but then CorB told me about this library: slaa325a (I'm not allowed to add a URL as I*m a new user, so google it).
     
    I reverted to using that, ported it to Launchpad (just minor config changes) and made it available on my GitHub repository. It's BSD-licensed. Thanks Texas Instruments for making a great Launchpad product and a great CC1101, which must be the most flexible of all RF chips. And to Anaren for the module!!! (you can tell I'm very happy, right? )
  2. Like
    legailutin reacted to CorB in Anaren TI CC110L RF AIR Booster Pack   
    The link to the TI stuff http://www.ti.com/general/docs/litabsmu ... r=slaa325a
  3. Like
    legailutin reacted to gwdeveloper in SimpiciTI Tutorial for CC2500   
    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.
  4. Like
    legailutin reacted to gwdeveloper in SimpliciTI RF wireless for the Launchpad   
    With the group buy for CC2500 radios happening soon, I though everyone might want easy access to software and get up and running with wireless super fast.
     
    The conversion was pretty simple to get SimpliciTI running on the MSP430G2553. It uses UCBO on P1.4, 1.5, 1.6, 1.7. P2.6 and 2.7 were used for GDO0 and GDO2 but these can be changed if needed. The led on P1.0 is used for a connection indicator. Of course, the jumper on 1.6 must be removed.
     
    Unzip the attached file to your SimpliciTI\bsp\boards folders.
    eg:

    C:\Texas Instruments\SimpliciTI-CCS-1.1.1\Components\bsp\boards\LP_G2553
     
    It will work with MDFLY's CC2500 radio http://www.mdfly.com/index.php?main_page=product_info&cPath=8_52&products_id=880&zenid=hqoogv1qn7ler204vb7vjkior3, the group buy CC2500 radio http://www.43oh.com/forum/viewtopic.php?f=22&t=1873, and TI's RF2500T http://www.ti.com/tool/ez430-rf2500t.
     
    I'm working on a demo project to post here as well as a short tutorial on getting a basic SimpliciTI project started in CCS.
     
    On a side note, this will not work in CCSv5.1 yet. The new compiler creates numerous Syntax errors. It compiles and works just fine with CCSv4.
    EDIT: After changing the optimization level and ignoring the syntax errors, it compiles and runs just fine from CCS v5.1!
     
    LP_G2553.zip
  5. Like
    legailutin reacted to turd in [Group Buy-1][D]CC2500 RF Module   
    Sure thing legailutin
    Just pm me your address and I'll mail them out asap.
  6. Like
    legailutin reacted to NatureTM in Full-duplex software UART for launchpad   
    By, "it just doesn't work," I assume you mean the echo is still working, but it's not storing to the array correctly.
     
    I think what might be happening is that you send a character from terminal, the program moves into that while loop, stores the character to array index 0, and then the loop is repeats. If there isn't already another character waiting, SoftSerial_read() returns -1, the loop exits, and nbr is reinitialized to 0. Next time you send a char, you just overwrite the character you already have in array index 0, when you wanted to place it into array index 1. I actually have some code for something similar.
     

    while(1){ while(SoftSerial_empty()){ // software wait for serial // do something } // we got a char while(dispStr[stringIndex - 1] != 13){ // keep adding characters to the array until we get char 13 (line feed) if ( !SoftSerial_empty() ) { while((c=SoftSerial_read()) != -1) { SoftSerial_xmit((uint8_t)c); dispStr[stringIndex] = c; stringIndex++; } } } dispStr[stringIndex - 1] = 0; // terminate string with null char (replace line feed) stringIndex = 0; }
     
    You could replace "while(dispStr[stringIndex - 1] != 13)" with "while(stingIndex < 16)". There are some ways to clean this example up, but it was just something I had thrown together for another project. I does work for me.
×
×
  • Create New...