title: Using C with the TI EZ430-RF2500 dev chips
body: <p>So what I am trying to do is receive a packet and print the payload to the serial port. Listening at the port is a python script that reassembles the payload and does some things with it. </p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include "mrfi.h"
  int main(void)
  {
    BSP_Init();
    MRFI_Init();
    //Initialize the serial port
    P3SEL    |= 0x30;
    UCA0CTL1  = UCSSEL_2;
    UCA0BR0   = 0x41;
    UCA0BR1   = 0x3;
    UCA0MCTL  = UCBRS_2;                     
    UCA0CTL1 &amp;= ~UCSWRST;
    MRFI_WakeUp();
    MRFI_RxOn();
    __bis_SR_register(GIE+LPM4_bits);
  }
  //This is run when a packet is received
  void MRFI_RxCompleteISR()
  {
    uint8_t i;
    P1OUT ^= 0x02;
    mrfiPacket_t packet;
    MRFI_Receive(&amp;packet);
    char output[] = {"                   "};
    for (i=9;i&lt;29;i++) {
      output[i-9]='a';
      if (packet.frame[i]=='\r') {
        output[i-9]='\n';
        output[i-8]='\r';
      }
    }
    TXString(output, (sizeof output));
  }
  </code></pre>
  
  <p>I send a packet with test data but nothing.  Anybody have any insights?  Also while just so you know I am learning C while I do this, so any pointers on design would also be awesome.</p>
  
  <p>Thanks.</p>