Hi Experts,
I got a problem to control CC1120 by using STM32 LL_Driver
According to CC1120 User guide (Figure 1) I know that to write data to the register located at the extended address, add +0x00 to 0x2F, enter the address of the extended register, and then enter the value of what I write to the register
- Figure 1
For example ) There is a case where I want to write 0x01 to the FREQ0 register(0x0E) located at the extended address.
In that case, I transmitted the packet as shown in Figure2 to CC1120 using STM32 to SPI Interface
- Figure 2
It was confirmed that the above method works when applied to the STM32 HAL_Driver. (By read Partnumber)
However when using LL_Driver, that method did not work.
This is my question,
1. Is the packet written to the extended register correct?
2. I Attach the LL_Driver Function that I wrote. Thank you for check the code
<LL_Driver code>
void Extend_Resgister_write(uint8_t action_byte, uint8_t register_byte, uint8_t extend_register_byte, uint8_t value_byte)
{
int i=0;
uint8_t TX_Data[4] = {0,};
//uint8_t RX_Data[4] = {0,};
TX_Data[0] = action_byte|register_byte;
TX_Data[1] = extend_register_byte;
TX_Data[2] = value_byte;
LL_GPIO_ResetOutputPin(CS_GPIO_Port, CS_Pin);
for(i=0;i<4;i++)
{
while(!LL_SPI_IsActiveFlag_TXE(SPI1)) {}
LL_SPI_TransmitData8(SPI1, TX_Data[i]);
}
LL_GPIO_SetOutputPin(CS_GPIO_Port, CS_Pin);
}
Looking forward to your advice. Thank you.
Kind regards,
- Jae-Heyeong Kim