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.

setting RXOFF_MODE to IDLE

Other Parts Discussed in Thread: CC1120

I am a novice for this field and I am studying the official example cc1120_vchip_easy_link_rx.c. Can anyone please tells me where do I set the RXOFF_MODE to IDLE in the following codes? I have been study it for long, but I cannot find that particular code to do so. Is it done implicitly?

 while(TRUE){
    
    // Wait for packet received interrupt 
    if(packetSemaphore == ISR_ACTION_REQUIRED){
      
      // Read number of bytes in rx fifo
      cc112xSpiReadReg(CC112X_NUM_RXBYTES, &rxBytes, 1);
      
      // Check that we have bytes in fifo
      if(rxBytes != 0){
        
        // Read marcstate to check for RX FIFO error
        cc112xSpiReadReg(CC112X_MARCSTATE, &marcStatus, 1);
        
        // Mask out marcstate bits and check if we have a RX FIFO error
        if((marcStatus & 0x1F) == RX_FIFO_ERROR){
          
          // Flush RX Fifo
          trxSpiCmdStrobe(CC112X_SFRX);
        }
        else{
        
          // Read n bytes from rx fifo
          cc112xSpiReadRxFifo(rxBuffer, rxBytes);  
          
          // Check CRC ok (CRC_OK: bit7 in second status byte)
          // This assumes status bytes are appended in RX_FIFO
          // (PKT_CFG1.APPEND_STATUS = 1.)
          // If CRC is disabled the CRC_OK field will read 1
          if(rxBuffer[rxBytes-1] & 0x80){
            
            // Update packet counter
            packetCounter++;


            halLedToggle(LED1);

          }
        }
      }
      // Reset packet semaphore
      packetSemaphore = ISR_IDLE;
      
      // Set radio back in RX
      trxSpiCmdStrobe(CC112X_SRX);
      
    }
  } 

  • Solved it. Though this problem seems stupid, it annoyed me a lot.

    This is not the code's issue, it relates to the register I have set in resigterConfigure(); RFEND_CFG1 register especially. To configure the 5:6 bits, the RXOFF_MODE to select the state after I have successfully received a packet. And the RFEND_CFG0 relates to the state I have received a bad packet.

     

    Thanks everyone.