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.

CC1120: I can't write to register another value

Part Number: CC1120


I can read the default value from the CC1120 registry that is used for configuration. Then I try to write a different value in it. After reading again, I still get the default value.

I am using STM32VLDISCOVERY. I can read the value, so the configuration of communication via SPI is correct.
Of course I know that the write address is given unchanged, for reading increased by 0x80.

Anyone have an idea what's wrong?

  • Hi,

    Which specific register are you trying to write to? Have you used a logic analyzer to verify what is actually happening on the SPI bus?

    Regards,
    Fredrik

  • Hey,
    the first picture is sending the value 0x18 to the PREAMBLE_CFG1 register. In the second picture there is a later reading of the value of this register, which has not changed and is the default 0x14.

    Interesting: when I write bytes into the TXFIFO register and then read NUM_TXFIFO, I can read how many bytes there are in FIFO, but two bytes less than I wrote.

  • Please make sure that the SPI timing is according to the SPI spec. in the data sheet when it comes to rise time, hold time etc.

    Also, make sure that the radio is in IDLE when accessing the registers.

    There are some noise on the MISO line? Where does it come from?

    Below is a plot showing how 0x18 is correctly written and read to the register at address 0x0D:

    BR

    Siri

  • I compared with time requirements and it's ok. The device is in IDLE when I want to read and write.
    The disturbance on MISO was some one-time garbage, it doesn't appear again.
    The strange thing is that each register can be read correctly. Writing to TXFIFO is also correct, subsequent NUM_TXBYTES reading shows the number of bytes saved. That is, the TXFIFO register entry works.

    I can't save anything to other registers.

  • Here attempt to write and read later from the PKT_LEN register. Does anyone have a solution for this?

  • I am afraid it is difficult to help when we are not seeing the same problem here. Have you used a oscilloscope to measure all the timing to see that it is OK according to spec?

    Can you please do the following sequene and show everything in on plot, so that we are sure that there is not something happening in between SPI accesses:

    SRES, write to PKT_LEN, read from PKT_LEN.

    Also, are there any other devices sharing the same SPI bus?

    Siri

  • It turned out that the problem was STM (despite the correct runs on SPI), I connected a new one. Now write registers working properly.

    However, I took the configuration of the registers from Smart RF Studio and I cannot carry out the transmission.


    Transmit side: I send bytes to TX FIFO, the NUM_TXBYTES register shows me the number of those bytes, after the STX command the data is sent (NUM_TXBYTES = 0x00, IDLE status).

    Receiving side: after the SRX command, CC1120 is in the RX state (MARC_STATE = 0x6D), but receives no data (NUM_RXBYTES all the time 0x00).

    What am I doing wrong?

            uint8_t SET_IOCFG3 =			0xB0;
      	uint8_t SET_IOCFG2 =  		   	0x06;
      	uint8_t SET_IOCFG1 = 			0xB0;
      	uint8_t SET_IOCFG0 = 			0x40;
      	uint8_t SET_SYNC_CFG1 =			0x0B;
      	uint8_t SET_DCFILT_CFG =		0x1C;
      	uint8_t SET_PREAMBLE_CFG1 =		0x18;
      	uint8_t SET_IQIC =  	   		0xC6;
      	uint8_t SET_CHAN_BW =     		0x08;
      	uint8_t SET_MDMCFG0 =       	0x05;
      	uint8_t SET_AGC_REF =       	0x20;
      	uint8_t SET_AGC_CS_THR =    	0x19;
      	uint8_t SET_AGC_CFG1 =      	0xA9;
      	uint8_t SET_AGC_CFG0 =      	0xCF;
      	uint8_t SET_FIFO_CFG =      	0x00;
      	uint8_t SET_FS_CFG =        	0x12;
      	uint8_t SET_PKT_CFG0 =      	0x20;
      	uint8_t SET_PKT_LEN =       	0xFF;
      	uint8_t SET_IF_MIX_CFG =    	0x00;
      	uint8_t SET_FREQOFF_CFG =   	0x22;
      	uint8_t SET_FREQ2 =         	0x6C;
      	uint8_t SET_FREQ1 =         	0x80;
      	uint8_t SET_FS_DIG1 =       	0x00;
      	uint8_t SET_FS_DIG0 =       	0x5F;
      	uint8_t SET_FS_CAL1 =       	0x40;
      	uint8_t SET_FS_CAL0 =       	0x0E;
      	uint8_t SET_FS_DIVTWO =     	0x03;
      	uint8_t SET_FS_DSM0 =       	0x33;
      	uint8_t SET_FS_DVC0 =       	0x17;
      	uint8_t SET_FS_PFD =        	0x50;
      	uint8_t SET_FS_PRE =         	0x6E;
      	uint8_t SET_FS_REG_DIV_CML = 	0x14;
      	uint8_t SET_FS_SPARE =          0xAC;
      	uint8_t SET_FS_VCO0 =           0xB4;
      	uint8_t SET_XOSC5 =             0x0E;
      	uint8_t SET_XOSC1 =             0x03;

    MCU_Init();

    registerConfig(); //with CC1120 reset before write config

    WriteStrobe(CC112X_SCAL); //PARTVERSION is 0x23, manual calibration not needed

    RunTX(); or RunRX();

    TX:

    WriteStdFIFO();

    WriteStrobe(CC112X_STX);

    RX:

    WriteStrobe(CC112X_SRX);

    ReadSingleExt(CC112X_NUM_RXBYTES); //problem - all time 0x00

  • On the RX side, nothing else is needed other than:

    1. Reset CC1120
    2. Configure CC1120 with settings from SmartRF Studio
    3. Strobe RX
    4. Wait for data to be received (wait for packet received interrupt on GPIO or read RX DATA).

    Are there any change that you have configured the radio to use any kind of filtering (length or address)? If you have, data will not be written to the RX FIFO, if length or address fails.

    If this is not the case, I suspect that you have a HW problem with the radio. Are you using any of our EMs or have you made your own HW?

    Siri


  • I bought KIT EVAL CC1120EMK-868-915.
    I did not give any address, nor did I configure address detection.
    The settings from SmartRF Studio show that the length is given in the first byte to be sent from TX, and the register limits the maximum data length to 0xFF.

  • Ok, the data reception is working now, the signal strength indication is too.
    I don't know what the obstacle was, but today I have connected and it works.