Sign in

username or email:

password:



Not a member?
Forgot your Password?

Search msp430



Search tips

Subscribe to msp430



Discussion Groups

See Also

DSPFPGA

Discussion Groups | MSP430 | MSP430-RF2500 reading a packet problem

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.


So far in May, you have voted 0 times ou of a total of 20 votes by the community.
Please help us clean the archives from unuseful discussion threads by using the voting system! Details here.


Is this thread worth a thumbs up?

+2

MSP430-RF2500 reading a packet problem - Kostas Panagiotakis - Jul 23 12:38:53 2012

Hello my name is Kostas and I want to ask you a question regarding the MSP430 eZ430-RF2500 development tool.
I'm trying to send a packet, from one board to another, by pressing the on board button. The packet contains the letter "A". When the packet is received I want to check if it contains the letter and if it does, to turn on the red light on the board. The problem is that I cannot read the contents of the packet thus, I cannot perform the check. Below is the code that I'm using to perform this task. What should I do to fix this problem?
Thanks in advance.
#include "mrfi.h"
#include "radios/family1/mrfi_spi.h"

int main()
{
  BSP_Init();
  P1REN |= 0x04;
  P1IE |= 0x04;
  MRFI_Init();
  MRFI_WakeUp();
  MRFI_RxOn();
  __bis_SR_register(GIE+LPM4_bits);
}

void MRFI_RxCompleteISR()
{
  mrfiPacket_t packet;
  MRFI_Receive(&packet);
  if (packet.frame[0]=='A'){
  P1OUT ^= 0x02;
  }
}

#pragma vector=PORT1_VECTOR

__interrupt void Port_1()
{
  P1IFG &= ~0x04;
  char rx='A';
  mrfiPacket_t packet;
  packet.frame[0]=rx;
  MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED);
  P1OUT ^= 0x01;
}







(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: MSP430-RF2500 reading a packet problem - Dan Bloomquist - Jul 23 18:20:45 2012

Kostas Panagiotakis wrote:
> void MRFI_RxCompleteISR()
> {
> mrfiPacket_t packet;
> MRFI_Receive(&packet);
> if (packet.frame[0]=='A'){
no
> P1OUT ^= 0x02;
> }
> }
>
> #pragma vector=PORT1_VECTOR
>
> __interrupt void Port_1()
> {
> P1IFG &= ~0x04;
> char rx='A';
> mrfiPacket_t packet;
> packet.frame[0]=rx;
no
> MRFI_Transmit(&packet, MRFI_TX_TYPE_FORCED);
> P1OUT ^= 0x01;
> }

It looks like you have just copied code from the net, and used it with
assumptions. You need to read about how to build a packet or at least
use an example doing such. A packet is composed of a header, payload,
and payload size. frame[0] is *not* for payload data.

If you don't bother to understand the libraries you intend to use, you
will waste a great deal of time with a shotgun.

Best, Dan.

--
"If they can get you asking the wrong questions, they don’t
have to worry about answers."

-- Thomas Pynchon





(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )