Jump to content
PratikshaBhuta

MSP430f5528 with CC2500

Recommended Posts

hi, 

 

      i have designed a borad with msp430f5528 ans cc2500 , i want to communicate between 2 such devices using the transreceiver module cc2500 can yo help me with the code to transmit and receive data between two cc2500 module 

 

 

thank you

Share this post


Link to post
Share on other sites

hi, 

 

      i have designed a borad with msp430f5528 ans cc2500 , i want to communicate between 2 such devices using the transreceiver module cc2500 can yo help me with the code to transmit and receive data between two cc2500 module 

 

 

thank you

Here are some older threads to help get you started:

http://forum.43oh.com/topic/1493-simpiciti-tutorial-for-cc2500/

http://forum.43oh.com/topic/5691-cc2500-anaren-code-example/

 

You may have to port it to your MSP controller and CCS.

Share this post


Link to post
Share on other sites

hi i have written an example code to transmit data is it correct ?? please check

#include<msp430.h>
#include<msp430f5528.h>
#include "include.h"
#include<stdio.h>
#include<math.h>
/////////////////////////////////////////////////////////////////////////////

extern char paTable[];
extern int paTableLen;
int test[10];
char txBuffer[4], received_ch;
unsigned int i;

///////////////////////////////////////////////////////////////////////////
void main (void)
{
	WDTCTL = WDTPW +WDTHOLD;// STOP WATCHDOG TIMER
	PMMCTL0 = PMMPW;        //OPEN PMM MODULE
	PM5CTL0 &= ~LOCKLPM5;
	P4DIR |= BIT7;                   // Set P4.7 to output direction
	 P4OUT &= ~BIT7;


	TI_CC_Wait(500); //software delay to give the  CC2500 time to startup...

	TI_CC_SPISetup(); // Initialize SPI port
	TI_CC_PowerupResetCCxxxx(); // Reset CCxxxx
	__delay_cycles(100000);

	writeRFSettings(); // Write RF settings to config reg
	TI_CC_SPIWriteBurstReg(TI_CCxxx0_PATABLE, paTable, paTableLen);//Write PATABLE
	
	       test[0]=TI_CC_SPIReadReg(TI_CCxxx0_IOCFG2);
	       test[1]=TI_CC_SPIReadReg(TI_CCxxx0_IOCFG0);
	       test[2]=TI_CC_SPIReadReg(TI_CCxxx0_PKTLEN);
	       test[3]=TI_CC_SPIReadReg(TI_CCxxx0_PKTCTRL1);
	       test[4]=TI_CC_SPIReadReg(TI_CCxxx0_PKTCTRL0);
	       test[5]= TI_CC_SPIReadReg(TI_CCxxx0_ADDR);
	       test[6]=TI_CC_SPIReadStatus(TI_CCxxx0_PARTNUM);
	       test[7]=TI_CC_SPIReadStatus(TI_CCxxx0_VERSION);

//// test to check if crystal is running or not
	    if(test[0]==0x29)   //0x29 i.e CHIP_RDYn (crystal test )
	       {
	    	puts("CC2500 initialized");///crystal running
	    	__delay_cycles(3000000);
	      	}
	    else
	    {
	    	puts("CC2500 not initialized");///crystal not running
	    	__delay_cycles(3000000);


	    }

	     //const char c= test[0];

	  //  puts(c);

while(1)
{
	TI_CC_GDO0_PxIES |= TI_CC_GDO0_PIN; // Interrupt on falling edge (end of packet)
	TI_CC_GDO0_PxIFG &= ~TI_CC_GDO0_PIN; // Clear flag
	TI_CC_GDO0_PxIE |= TI_CC_GDO0_PIN; // Enable interrupt on end of packet


	      TI_CC_SPIStrobe(TI_CCxxx0_SIDLE);
	      TI_CC_SPIStrobe(TI_CCxxx0_STX);// Change state to TX, initiating data transfer

	      txBuffer[0] = 2;//packet length
	      txBuffer[1] = 0x01;//packet address
	      txBuffer[2] = 0x41;
	      //txBuffer[3] = "E";
		 // txBuffer[4] = "L";
		 // txBuffer[5] = "L";
		 // txBuffer[6] = "O";
		  RFSendPacket(txBuffer, 2);//send packet over RF
          __delay_cycles(10000);


if (TI_CC_GDO0_PxIE |= TI_CC_GDO0_PIN)
{
	              puts("Data Transmitted");
		    	__delay_cycles(3000000);
}
else {
	puts("Data not transmitted");
	__delay_cycles(3000000);
}

}//while end
}//main end

thank you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×