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.

CC1101 issue

Other Parts Discussed in Thread: CC1101

Hi,

I'm doing with CC1101 module with SPI, now I can send and receive Packet data with CRC OK.But when I read from RXFIFO, I just could read the last byte of the packet. For example, if I send 0x65 0x66 0x67, i just can read 0x67 for the fisrt byte and then 34 34. Could you help me to solve this problem. Thank you!

Here is my register configuration:

 {CC1101_IOCFG2,            0x07},
  {CC1101_IOCFG0,            0x02},
  {CC1101_FIFOTHR,           0x07},
  {CC1101_SYNC1,             0xD3},
  {CC1101_SYNC0,             0x91},
  {CC1101_PKTLEN,            0x03},
  {CC1101_PKTCTRL1,          0x00},
  {CC1101_PKTCTRL0,          0x04},
  {CC1101_ADDR,              0x010},
  {CC1101_CHANNR,            0x10},
  {CC1101_FSCTRL1,           0x0B},
  {CC1101_FSCTRL0,           0x00},
  {CC1101_FREQ2,             0x10},
  {CC1101_FREQ1,             0xA7},
  {CC1101_FREQ0,             0x62},
  {CC1101_MDMCFG4,           0x2D},
  {CC1101_MDMCFG3,           0x3B},
  {CC1101_MDMCFG2,           0x73},
  {CC1101_MDMCFG1,           0x22},
  {CC1101_MDMCFG0,           0xF8},
  {CC1101_DEVIATN,           0x00},
  {CC1101_MCSM2,             0x07},
  {CC1101_MCSM1,             0x3F},
  {CC1101_MCSM0,             0x18},
  {CC1101_FOCCFG,            0x1D},
  {CC1101_BSCFG,             0x1C},
  {CC1101_AGCCTRL2,          0xC7},
  {CC1101_AGCCTRL1,          0x00},
  {CC1101_AGCCTRL0,          0xB2},
  {CC1101_WOREVT1,           0x87},
  {CC1101_WOREVT0,           0x6B},
  {CC1101_WORCTRL,           0xFB},
  {CC1101_FREND1,            0xB6},
  {CC1101_FREND0,            0x10},
  {CC1101_FSCAL3,            0xEA},
  {CC1101_FSCAL2,            0x2A},
  {CC1101_FSCAL1,            0x00},
  {CC1101_FSCAL0,            0x1F},
  {CC1101_RCCTRL1,           0x41},
  {CC1101_RCCTRL0,           0x00},
  {CC1101_FSTEST,            0x59},
  {CC1101_PTEST,             0x7F},
  {CC1101_AGCTEST,           0x3F},
  {CC1101_TEST2,             0x88},
  {CC1101_TEST1,             0x31},
  {CC1101_TEST0,             0x09},


code read on STM32
void CC1101_ISRRx(void) { uint8_t i; uint8_t status; RF_DataTypeDef tmp; CC1101_CmdStrobe(CC1101_SRX); CC1101_CS_ASSERT; CC1101_Spi(CC1101_FIFO|0xFF); HAL_Delay(2); for(i=0; i<3; i++) { tmp.Cache.Data[i] = CC1101_Spi(0); } StoreRx(tmp); CC1101.ToRxMode=true;/* back again RX mode */ CC1101_CS_DEASSERT; }

code send on STM32
static void CC1101_ToTxMode(RF_DataTypeDef Data) { uint8_t i; /* Clear TX FIFO */ CC1101_CmdStrobe(CC1101_SFTX); /* Put burst data to TX FIFO */ CC1101_CS_ASSERT; CC1101_Spi(0x7F); /* burst data header*/ HAL_Delay(2); CC1101_Spi(0x65); CC1101_Spi(0x66); CC1101_Spi(0x67); CC1101_CS_DEASSERT; /* Turn to Tx mode */ CC1101_CmdStrobe(CC1101_SIDLE); CC1101_CmdStrobe(CC1101_STX); /* Set Tx Flag is busy */ CC1101.TxBusy=true; }

  • From what you have posted it's a bit difficult to see where the error is.

    It could be an issue with the Tx function (data is not written correctly into the Tx buffer). Try to increase the packet length by a few bytes and see if you are always missing the two first bytes or only send the last byte.