Hello!
I am working in a project that use a PIC16f1829 to comunicate via SPI with CC1101, I can transmit and receive packets with CC1101, but the goal of the project is to use the CC1101 in low-power mode, so after I configured the CC1101 I need to put him in lowest power mode, but this is not occur, I had verified if the strobe commands are ok, after I send the strobe commands I read the marcstate register to verify if the command was sucessfull always rigth, but when I send SPWD I can't read the status of CC1101, because this will wake-up the radio and I what is wrong in my firmware.
Here is the configuration of registers:
void ConfigureRF (void){
halRfWriteReg(IOCFG0,0x06); //GDO0 Output Pin Configuration
halRfWriteReg(FIFOTHR,0x47); //RX FIFO and TX FIFO Thresholds
halRfWriteReg(PKTCTRL0,0x05);//Packet Automation Control
halRfWriteReg(FSCTRL1,0x06); //Frequency Synthesizer Control
halRfWriteReg(FREQ2,0x21); //Frequency Control Word, High Byte
halRfWriteReg(FREQ1,0xE3); //Frequency Control Word, Middle Byte
halRfWriteReg(FREQ0,0x8E); //Frequency Control Word, Low Byte
halRfWriteReg(MDMCFG4,0x8A); //Modem Configuration
halRfWriteReg(MDMCFG3,0x75); //Modem Configuration
halRfWriteReg(MDMCFG2,0x13); //Modem Configuration
halRfWriteReg(MDMCFG1,0x23); //Modem Configuration
halRfWriteReg(MDMCFG0,0x2F); //Modem Configuration
halRfWriteReg(MCSM1,0x00); //Main Radio Control State Machine Configuration
halRfWriteReg(MCSM0,0x18); //Main Radio Control State Machine Configuration
halRfWriteReg(FOCCFG,0x16); //Frequency Offset Compensation Configuration
halRfWriteReg(AGCCTRL2,0x43);//AGC Control
halRfWriteReg(WORCTRL,0xFB); //Wake On Radio Control
halRfWriteReg(FSCAL3,0xE9); //Frequency Synthesizer Calibration
halRfWriteReg(FSCAL2,0x2A); //Frequency Synthesizer Calibration
halRfWriteReg(FSCAL1,0x00); //Frequency Synthesizer Calibration
halRfWriteReg(FSCAL0,0x1F); //Frequency Synthesizer Calibration
halRfWriteReg(TEST2,0x81); //Various Test Settings
halRfWriteReg(TEST1,0x35); //Various Test Settings
halRfWriteReg(TEST0,0x09); //Various Test Settings
halRfWriteReg(PATABLE,0x8E); //0dbm (1mW)
}
Send strobe Commands:
unsigned char Strobe (unsigned char strobe){
unsigned char status;
CSn = 0; //Chip Select
while(SO); //Wait MISO - low
status = SPI_Write(strobe);
CSn = 1; //Chip Select
Wait();
return status;
}
void main(){
InicializaCC1101();
while (status != 1){
status = ReadReg(MARCSTATE);
DelayMs(5);
Strobe(SIDLE);
}
status = Strobe(SPWD); // Standby
}
Thanks,
Giovani