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.

packet.frame[0] details

Other Parts Discussed in Thread: CC2500

Background: Using msp30f2274, CC2500, Iar embedded workbench kickstart edition

Hi the structure of the mrfi packet is as follows:


typedef struct
{
  uint8_t frame[MRFI_MAX_FRAME_SIZE];
  uint8_t rxMetrics[MRFI_RX_METRICS_SIZE];
} mrfiPacket_t;

 

 

However, i cant seem to create a mrfi packet and send a number '10' and below. It works if i send '11' to '64' so far. Can i have some explanation? Here is my code:

 

 

#include "mrfi.h"

void print_counter(int8_t counter)
{
  char output[] = {"   "};
  output[0] = '0'+((counter/10)%10);
  output[1] = '0'+ (counter%10);
  TXString(output, (sizeof output)-1);
}
int main(void)
{
 
  BSP_Init();
  P1REN |= 0x04;
  P1IE |= 0x04;
  MRFI_Init();
 
 
  P3SEL    |= 0x30;     // P3.4,5 = USCI_A0 TXD/RXD
  UCA0CTL1  = UCSSEL_2; // SMCLK
  UCA0BR0   = 0x41;     // 9600 from 8Mhz
  UCA0BR1   = 0x3;
  UCA0MCTL  = UCBRS_2;                    
  UCA0CTL1 &= ~UCSWRST; // Initialize USCI state machine
  IE2      |= UCA0RXIE; // Enable USCI_A0 RX interrupt
 
 
  MRFI_WakeUp();
  MRFI_RxOn();
  __bis_SR_register(GIE+LPM4_bits);
}
void MRFI_RxCompleteISR()
{
  mrfiPacket_t packet;
  P1OUT ^= 0x02;
  MRFI_Receive(&packet);
  print_counter(packet.frame[0]);
}
#pragma vector=PORT1_VECTOR
__interrupt void Port_1 (void)
{
  P1IFG &= ~0x04;
  mrfiPacket_t packet;
  packet.frame[0]=10;   /*********************HERE I HAVE PROBLEM***************/
  MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED);
  P1OUT ^= 0x01;
}