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.

Query on default Settings -- CC2500

Other Parts Discussed in Thread: CC2500

Hi,


I have doubts regarding the default Settings for CC2500. I have referred to the datasheet have not changed any settings rather that a register called MCSM1, where I want the CC module to remain in the same state after a transmit or receive.

Is it enough for setting an initial transmission/reception? Cos, I am not able to receive the data sent from one CC with these default settings.

Please let me know if I had to configure any other configuration registers? In case needed, I have attached my code here. Please help me out in this.

#include <18F24J11.h>
static unsigned char TransmitData[40] = "Tiino";

void main()
{
    output_high(SPI_SS);  // Initial Slave Select to a high level
    // Initialize the hardware SSP for SPI Master mode.
    
    while(TRUE)
    {
     setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64);
        CC_SetIdleMode();
        CC_Initial_Check();
        CC_WriteRFSettings();
        CC_SetIdleMode();
        CC_ClearTransmitFIFO();
        CC_TransmitData();
        CC_CheckNoOfBytesinTXFIFO();
        CC_SetTransmitModeMode();
        //CC_SetReceiveModeMode();
        delay(50);
    }
}

void CC_Initial_Check()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(VERSION_NUMBER);
    ReceiveValue = spi_read(DUMMY);
    delay(5);
    spi_write(PART_NUMBER);
    ReceiveValue = spi_read(DUMMY);
    delay(5);
    output_high(SPI_SS);
}

void CC_WriteRFSettings(void)
{
	TI_CC_SPIWriteReg(TI_CCxxx0_MCSM1 ,   0x3E);
}

void TI_CC_SPIWriteReg(char addr, char value)
{
    output_low(SPI_SS);
    delay(5);
    spi_write(addr);
    delay(5);
    spi_write(value);
    delay(5);
    output_high(SPI_SS);
}

void CC_SetIdleMode()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(SIDLE);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    spi_write(SFTX);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    output_high(SPI_SS);
}

void CC_ClearTransmitFIFO()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(SFTX);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    output_high(SPI_SS);
}

void CC_TransmitData()
{
    static unsigned char CountVar;
    while(TransmitData[CountVar] != '\0')
    {
        TI_CC_SPIWriteReg(TX_FIFO , TransmitData[CountVar]);
        ++CountVar;
    }
    CountVar = 0;
}

void CC_CheckNoOfBytesinTXFIFO()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(NUMBER_TXBYTES_IN_FIFO);
    ReceiveValue = spi_read(DUMMY);
    delay(5);
    output_high(SPI_SS);
}

void CC_SetReceiveModeMode()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(SFRX);
    ReceiveValue = spi_read(SNOP);
    spi_write(SRX);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    output_high(SPI_SS);
}

void CC_SetTransmitModeMode()
{
    output_low(SPI_SS);
    delay(5);
    spi_write(SCAL);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    spi_write(STX);
    ReceiveValue = spi_read(SNOP);
    delay(250);
    spi_write(SIDLE);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    spi_write(SFTX);
    ReceiveValue = spi_read(SNOP);
    delay(5);
    output_high(SPI_SS);
}



BTW, I am using PIC18F for my transmitting side and an MBED LPC1768 for receiving data.

Thanks!!

  • Hi,

    Another problem. I have a function called CC_SetTransmitModeMode() whete I am setting the CC to Transmit mode by issuing STX after filling some bytes in TX FIFO. But when I read the chip status byte, I get the value back as 0x7F. It is not entering into the transmit mode itself.  :(

  • Sorry for the delay, this question has fallen thru the cracks. Did you find a solution to your problem? My guess is that your SPI communication is not yet fully functional and the simplest way to debug this is using an oscilloscope and prove for each of your commands (listed above) that they perform as you expect on the SPI wires and the CC2500 is responding accordingly.

    Regards,
    /TA