This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EZ430-RF2500 SERIAL to RF Bridge

Other Parts Discussed in Thread: CC1100, CC2500, SIMPLICITI

I'm trying to make a SERIAL ro RF Bridge making it possible to control several RF enabled products and hardware.

I'm using the MSP430 Interface to CC1100/2500 llibrary but can't get it to work. The major problemm is I don't know where to start.

I've tryd all tutorials and example codes, blinking leds, push button, temperature but the CC2500 is giving me a headache.

 

Are there any (simple) examples of listening to the serial port and sending data via the CC2500?

 

Final goal is to control the Philips LivingColors lamp;

http://www.lighting.philips.com/microsite/living_colors/?lang=en

  • The COM part is working. Now the CC2500 part. I've included "CC1100-CC2500.h" and edited TT_CC_msp430.h (#include "msp430x22x4.h") to make it suitable for my EZ430-RF2500. Now i'm getting a list of errors:

    Error[Pe020]: identifier "P5OUT" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 228
    Error[Pe020]: identifier "P5DIR" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 229
    Error[Pe020]: identifier "ME2" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 231
    Error[Pe020]: identifier "USPIE1" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 231
    Error[Pe020]: identifier "UCTL1" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 232
    Error[Pe020]: identifier "CHAR" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 232
    Error[Pe020]: identifier "SYNC" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 232
    Error[Pe020]: identifier "MM" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 232
    Error[Pe020]: identifier "UTCTL1" is undefined C:\Documents and Settings\8\Desktop\CC2500\TI_CC_spi.c 233
    Error[Pe020]: identifier "CKPL" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 233
    Error[Pe020]: identifier "SSEL1" is undefined C:\Documents and Settings\*\Desktop\CC2500\TI_CC_spi.c 233
    ......................

    ......................

    ......................

  • Any help?

    I want to sent data received from COM. When it recieves "?" i would like to switch the CC2500 to listen mode to learn the RF codes from a RF remote control. This way i can emulate the remote control with my software.

    It seems sending is working kind of. But after two ot three sends my code loops infinitely.

    My code:

     

    #include "include.h"
    #include <string.h>

    extern char paTable[];
    extern char paTableLen;

    char rxBuffer[60];

    unsigned char DataPtr=0;
    unsigned char DataPtrREC=0;

    char ccByte;
    char RcByte;
    char RcData[60];

    int RcCount;

    void SendData(void);

    void main (void)
    {
     WDTCTL = WDTPW + WDTHOLD;                 // Disable Watchdog

      P1OUT = 0x00;
      P2SEL = 0x00;                             // configure Xin/Xout as digital I/Os
      P2OUT = 0xFB;
      P2DIR = 0x04;
      P2REN = 0x11;                             // use pull-up for incremental encoder
      P2IES = 0x00;
      P2IE = BIT0 + BIT4;
      P3OUT = 0x00;
      P3DIR = BIT4 + BIT5;
     
      BCSCTL1 = CALBC1_1MHZ;                    // Set DCO
      DCOCTL = CALDCO_1MHZ;
      P3SEL = 0x30;                             // P3.4,5 = USCI_A0 TXD/RXD
      UCA0CTL1 |= UCSSEL_2;                     // SMCLK
      UCA0BR0 = 104;                            // 1MHz 9600
      UCA0BR1 = 0;                              // 1MHz 9600
      UCA0MCTL = UCBRS0;                        // Modulation UCBRSx = 1
      UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
      IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
     
      TI_CC_SPISetup();                         // Initialize SPI port

      TI_CC_PowerupResetCCxxxx();               // Reset CCxxxx
      writeRFSettings();                        // Write RF settings to config reg
      TI_CC_SPIWriteBurstReg(TI_CCxxx0_PATABLE, paTable, paTableLen);//Write PATABLE

      // Configure ports -- LEDs, GDO0 to RX packet info from CCxxxx
      TI_CC_LED_PxDIR = TI_CC_LED1 + TI_CC_LED2; //Outputs
      TI_CC_GDO0_PxIES |= TI_CC_GDO0_PIN;       // Int on falling edge (end of pkt)
      TI_CC_GDO0_PxIFG &= ~TI_CC_GDO0_PIN;      // Clear flag
      TI_CC_GDO0_PxIE |= TI_CC_GDO0_PIN;        // Enable int on end of packet

      TI_CC_SPIStrobe(TI_CCxxx0_SRX);           // Initialize CCxxxx in RX mode.
                                                // When a pkt is received, it will
                                                // signal on GDO0 and wake CPU
      TI_CC_LED_PxOUT |= TI_CC_LED2;
      P2IFG=0x00;
     
      while(1)
      {
        __disable_interrupt();
        IE2 |= UCA0RXIE;                        // Enable RX int
        __bis_SR_register(CPUOFF + GIE);        // Enter LPM0 w/ interrupts

      }
    }

    void SendData(void)
    {
      UCA0TXBUF = 'S';
      TI_CC_SPIStrobe(TI_CCxxx0_STX);
     
      RFSendPacket(RcData, sizeof(RcData));         // Send value over RF
     
      P1IFG &= ~(TI_CC_SW1);                     // Clr flag that caused int
      P2IFG &= ~TI_CC_GDO0_PIN;                  // After pkt TX, this flag is set.
      TI_CC_SPIStrobe(TI_CCxxx0_SIDLE);          // switch CC2500 into idle mode
      TI_CC_SPIStrobe(TI_CCxxx0_SPWD);           // switch CC2500 into sleep mode
     
      TI_CC_SPIStrobe(TI_CCxxx0_STX);
    }

    #pragma vector=PORT2_VECTOR
    __interrupt void port2_ISR (void)
    {
      char len=60;                               // Len of pkt to be RXed (only addr
                                                // plus data; size byte not incl b/c
                                                // stripped away within RX function)
      int k;
      int r;
      if (P2IFG & TI_CC_GDO0_PIN)
      {
        RFReceivePacket(rxBuffer,&len);       // Fetch packet from CCxxxx
        P2IFG &= ~TI_CC_GDO0_PIN;                 // Clear flag
      }
    }

    #pragma vector=USCIAB0RX_VECTOR
    __interrupt void USCI0RX_ISR(void)
    {
      RcByte = UCA0RXBUF;                       // Get RXed character
     
      switch(RcByte)
      {
        case '.':
          RFSendPacket(RcData, sizeof(RcData));
          RcCount = 0;
          memset(RcData, 0, sizeof(RcData));
          P1IFG &= ~(TI_CC_SW1);                     // Clr flag that caused int
          P2IFG &= ~TI_CC_GDO0_PIN;                  // After pkt TX, this flag is set
          break;
        case '?':
          TI_CC_SPIStrobe(TI_CCxxx0_SRX);
          break;
        default:
          RcData[RcCount] = RcByte;
          RcCount ++;
          break;
      }
    }

  • Have you taken a look at SimpliciTI?  It works out of the box with the eZ43-RF so it should be easier to get started.

  • SimpliciTI is a network protocol. As far ass I know it is not possible to control hardware that doesn't understand SimpliciTI. Correct me if I'm wrong.

  • i'm not exactly sure what you mean by "control hardware that doesn't understand SimpliciTI" but there is no reason you can't modifiy the the hardware peripherals without having to go through simpliciTI.

  • We have two RF controlled LED ligths. http://www.lighting.philips.com/microsite/living_colors/?lang=en

    We are trying to control those lamps with a PC Application The lamp doesn't understand SimpliciTI.

     

    At this moment I'm trying the MRFI interface.

  • The software is blocked in this point: (CC1100-CC2500.c)

    void RFSendPacket(char *txBuffer, char size)
    {
    TI_CC_SPIWriteBurstReg(TI_CCxxx0_TXFIFO, txBuffer, size); // Write TX data
    TI_CC_SPIStrobe(TI_CCxxx0_STX); // Change state to TX, initiating
    // data transfer

    while (!(TI_CC_GDO0_PxIN&TI_CC_GDO0_PIN));
    // Wait GDO0 to go hi -> sync TX'ed
    while (TI_CC_GDO0_PxIN&TI_CC_GDO0_PIN);

    Why pin GDO0 doesn't go hi?

  • I had the same problem.

     

    I replaced the following lines:

    while (!(TI_CC_GDO0_PxIN&TI_CC_GDO0_PIN));
    // Wait GDO0 to go hi -> sync TX'ed
    while (TI_CC_GDO0_PxIN&TI_CC_GDO0_PIN);

    With:

    do
    {
        status = TI_CC_SPIReadStatus(TI_CCxxx0_TXBYTES);
    } while (status != 0);

     

    Basically I just wait until I know the TX buffer is empty. Does anyone see a problem doing it this way?  It's worked well for me so far.

**Attention** This is a public forum