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.

Command strobes in CC1101

Other Parts Discussed in Thread: CC1101

Hi,

  I have CC1101 Evaluation module (CC1101EMK433) interfaced with MSP430F5529LP launchpad via SPI. I have checked the working of SPI: when I send SRES strobe I receive 0x0F which I monitored using CCS's watch window. Now the issue is when I pass STX, the return status byte doesn't show 0x2_. It remains in 0x0F which was received when SIDLE is passed. However, when I read the address of STX (keeping BURST bit low and MSB of the header high for read operation), upon sending the dummy byte for receiving the data in the address, I get 0x2F here which tells me that the module is in TX mode (STATE bits).  I tried the same with SRX which is passed after passing SIDLE. I observed the same pattern. When I read the SRX register, I get 0x1F in RX buffer which tells the module is in RX mode. 

Is this the correct way of making the strobes work or there is some issues? While it is transmitting, I checked the RF output using spectrum analyser which had the same RF parameters that were configured by the microcontroller. Please find the code and the image of the spectrum below.

int main(void) 
{
    WDTCTL = WDTPW | WDTHOLD;	// Stop watchdog timer
    config_CLOCK();
    SPI_SETUP();
    CC1101_RST();
    CC1101_init();
    SPI_STROBE(SIDLE);
    status = SPI_REG_READ(SIDLE);
    SPI_STROBE(STX);
    status = SPI_REG_READ(STX);
 //   SPI_STROBE(SRX);
 //   status = SPI_REG_READ(SRX);
}
void SPI_REG_WRITE(char tx_addr, char tx_data) //Function for SPI writing of registers

{
	P2OUT &= ~BIT6;							//CS = low
	while(P3IN & SPI_SOMI);						//Wait till SO = low
	while (!(UCB0IFG & UCTXIFG));					//Wait till UTXBUF is empty (UTXIFG1 = 1)
		__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);						//Erase RX-Flag of previous Byte
	UCB0TXBUF = tx_addr;						//Send register address  [GOES TO INTERRUPT FUNCTION]
	while (!(UCB0IFG & UCTXIFG));					//Wait till UTXBUF is empty (UTXIFG1 = 1)
	while (!(UCB0IFG & UCRXIFG));					//Wait till whole word is received (SO status byte)
		__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);						//Erase RX-Flag of previous Byte
	UCB0TXBUF = tx_data;						//Send Data
	while (!(UCB0IFG & UCTXIFG));					//Wait till UTXBUF is empty (UTXIFG1 = 1)
	while (!(UCB0IFG & UCRXIFG));					//Wait till whole word is received (SO status byte)
		__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);					//Wait till whole word is received (SO status byte)
	P2OUT |= BIT6;							//CS = high for acknowledgement
}

char SPI_REG_READ(char reg_addr) //Function for SPI reading of registers
{
	char rx_data;

	P2OUT &= ~BIT6;							//CS = low
	while(P3IN & SPI_SOMI);						//Wait till SO = low
	while (!(UCB0IFG & UCTXIFG));						//Wait till UTXBUF is empty (UTXIFG1 = 1)
		__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);						//Erase RX-Flag of previous Byte
	UCB0TXBUF  = (reg_addr | RWbit);					//Send addresse + R/W bit = 1 for read operation
	while (!(UCB0IFG & UCTXIFG));						//Wait till UTXBUF is empty (UTXIFG1 = 1)
	while (!(UCB0IFG & UCRXIFG));						//Wait till whole word is received (SO status byte)
		__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);							//Erase RX-Flag of previous Byte
	UCB0TXBUF = 0x00;							//Send dummy bits for read operation
	while (!(UCB0IFG & UCTXIFG));						//Wait till whole word is received (SO status byte)
		__delay_cycles(8000);
	rx_data = UCB0RXBUF;						//Read Data
	P2OUT |= BIT6;							//CS = high for acknowledgement
	return rx_data;
}

void SPI_STROBE(char strobe)
{
	P2OUT &= ~BIT6;							//CS = low
	while(P3IN & SPI_SOMI);						//Wait till SO = low
	while (!(UCB0IFG & UCTXIFG));						//Wait till UTXBUF is empty (UTXIFG1 = 1)
	__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);						//Erase RX-Flag of previous Byte
	//IFG2 &= ~UTXIFG1;						//Erase TX-Flag of previous Byte
	UCB0TXBUF = strobe;						//Send register address
	while (!(UCB0IFG & UCTXIFG));						//Wait till whole word is received (SO status byte)
	__delay_cycles(8000);
	while (!(UCB0IFG & UCRXIFG));						//Wait till whole word is received (SO status byte)
	__delay_cycles(8000);
	UCB0IFG &= ~(UCRXIFG);					//Erase RX-Flag of previous Byte
	P2OUT |= BIT6;							//CS = high for acknowledgement
}