Hi all,
i was able to perform transmission and reception of messages by using CC2500 and MSP430F147. I do not use addresses.
I perform the reception of a messages by using interrupt on GDO0 configured to asserts when sync word has been received, and de-asserts at the end of the packet.
Then, to read the received data i use the function "RFReceivePacket" given by Texas.
char RFReceivePacket(char *rxBuffer, char *length)
{
char status[2];
char pktLen;
if ((TI_CC_SPIReadStatus(TI_CCxxx0_RXBYTES) & TI_CCxxx0_NUM_RXBYTES))
{
pktLen = TI_CC_SPIReadReg(TI_CCxxx0_RXFIFO); // Read length byte
if (pktLen <= *length) // If pktLen size <= rxBuffer
{
TI_CC_SPIReadBurstReg(TI_CCxxx0_RXFIFO, rxBuffer, pktLen); // Pull data
*length = pktLen; // Return the actual size
TI_CC_SPIReadBurstReg(TI_CCxxx0_RXFIFO, status, 2);
// Read appended status bytes
return (char)(status[TI_CCxxx0_LQI_RX]&TI_CCxxx0_CRC_OK);
} // Return CRC_OK bit
else
{
*length = pktLen; // Return the large size
TI_CC_SPIStrobe(TI_CCxxx0_SFRX); // Flush RXFIFO
return 0; // Error
}
}
else
return 0; // Error
}
The system works well, but unfortunately some times the receiver gets stucked, and the GDO0 signal never de-asserts.
Maybe the receiver never gets the "End of packet" sent by the transmitter? Or maybe i do some error in reading received data?
Thanks in advance for your help.
Best regards,
Oscar