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.

CC1120EM-868-915-RD: SPI read-write register not working(example code provided)

Part Number: CC1120EM-868-915-RD
Other Parts Discussed in Thread: CC1120

Hi, I am new to using this Transceiver, and I am faced with a problem.

I have paired this transceiver device with an STM32L476RG micro controller, and I am trying to achieve SPI communication between the two, with the MCU being the master.

I am trying a sequence where I write to a register and then read it. But it seems that on the SO line, all I am getting is just the status byte, and not the data byte. I should mention that I grouped my data size in 8 bits, and somehow the CSn byte goes high in between the 8 bits. (Is this expected?)

THe following is the sequence I am using:


        a = 0x3636; //0x36 = SIDLE(Command Strobe)
        HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);
        HAL_Delay(1);

          a = 0x002F; //Write
        HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);
          a = 0x0CAB; //Write (Writing AB to address 0C)
        HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);
        HAL_Delay(1);

          a = 0x00AF; //Read( THe last 8 bits show the extended register space command)
        HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);
          a = 0x0C00; //Read
        HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);
         a = 0x3D3D;//SNOP
         HAL_SPI_Transmit(&hspi2, &a , 1, HAL_MAX_DELAY);

Could anyone suggest what is going wrong here? And could someone else provide some instuctions as to how to fill in the TX FIFO and then send the data?

Thanks in advance.

 

  • You cannot pull CSn high in between the adress and the data. How the SPI needs to work for the CC1120 to work is explained in the CC1120 user guide. If you have problems getting the SPI on the MCU to work as you want to you should try to contact ST for support.
    BR
    Siri