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.

CC1310: May the RF core stay in WOR mode without give it the command continuously ?

Other Parts Discussed in Thread: CC1310

Hi,

I'm using a cc1310 custom board.

I have seen the WOR RX example code. It run a RX_sniff command right? Once it runs, then the RF core will be in the RX sniff state after a while which the time has been set in the "RF_cmdPropRxSniff.startTime" . After the RX sniff working period, it gives a "RF_EventLastCmdDone" message in the callback. Is that right?

I replant the code to my custom board. There are the peripherals i used : UART, GPIO, PIN interrupt, and RF core.

I want to ask, can i just leaving the RF core,just let it restart the period automatically ? If i have to restart the period, then the power of the hole device is too high (it's about 1.5mA on my board, no such things like LED and i disconnected the XDS debugger). I think the TI-RTOS just put the device into wfi state. But what i want is that it could stay in the standby state. Once there is any data received from the RF core. It wakes up the main core and the main core does the relevant response.

I think it should be around 7uA when the device is at sleep period of RX sniff state. And should i close the UART before entering the RX sniff state?

Hope you could help me , thanks.

BR,

Mikel

  • Hi everyone,

    I just debugged for a moment and i found i issue, that confused me a lot.

    The current 1.5mA i said before, it caused by two questions:

    1. internal pullup. After i delete the pollup option, the current  really decrease so much.

    2. The UART. this is the main problem i got now. I delete the UART initialize function, then the current just turns to less than 10uA. But when i try to use UART_close() to close the uart peripheral. It turns to 900uA. Which means, if i close the uart just after the opening operation. The current is 900uA. But if i never open the uart at all, the current is less than 10uA.

    So, what cause this issue?

    PS: i just leave the power management to the TI-RTOS by adding the function "Power_idleFunc()" to the idle function.

    there is my uart code. hope you could help me. thanks a lot.

    BR,

    Mikel

    uart.c
    #include "uart.h"
    
    UART_Handle Uart_handle;
    uint8_t RX_temp_buff[64];
    
    uint8_t Uart_RX_buffer[UART_RX_RINGBUFFER_SIZE];
    uint8_t Uart_TX_buffer[UART_TX_RINGBUFFER_SIZE];
    
    ring_buffer_typedef Uart_RX_ringbuffer;
    ring_buffer_typedef Uart_TX_ringbuffer;
    
    bool Uart_RXNE_flag = false;
    
    Swi_Handle Uart_write_swi_handler;
    
    bool Uart_TX_idle_flag = true;
    static uint8_t Uart_TX_temp_buffer[64], Uart_TX_length;
    
    void Uart_RX_callback(UART_Handle uart_handler, void *buf, size_t count)
    {
      Write_ring_buffer(&Uart_RX_ringbuffer, (uint8_t *)buf, count);
      UART_read(Uart_handle, RX_temp_buff, 64);
      core_PostEvent(CORE_EVENT_UART_RECEIVED);
    }
    void Uart_TX_callback(UART_Handle uart_handler, void *buf, size_t count)
    {
      Uart_TX_idle_flag = true;
      Swi_post(Uart_write_swi_handler);
    }
    void Uart_write_swi_ISR(UArg a0,UArg a1)
    {
      if(!Is_ring_buffer_empty(&Uart_TX_ringbuffer))
      {
        Uart_TX_idle_flag = false;
        Uart_TX_length = Read_ring_buffer(&Uart_TX_ringbuffer, Uart_TX_temp_buffer, 64);
        UART_write(Uart_handle, Uart_TX_temp_buffer, Uart_TX_length);
      }
    }
    void Uart_Init(void)
    {
      UART_Params Uart_params;
      UART_Params_init(&Uart_params);
      
      Uart_params.readMode = UART_MODE_CALLBACK;
      Uart_params.readDataMode = UART_DATA_BINARY;
      Uart_params.readCallback = (UART_Callback)Uart_RX_callback;
      
      Uart_params.writeMode = UART_MODE_CALLBACK;
      Uart_params.writeDataMode = UART_DATA_BINARY;
      Uart_params.writeCallback = (UART_Callback)Uart_TX_callback;
      
      Uart_params.baudRate = 9600;
     
      Uart_handle = UART_open(Board_UART, &Uart_params);
      //Open RX timeout (32-bit period no data)
      if(UART_STATUS_SUCCESS != UART_control(Uart_handle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL))
      {
        while(1);
      }
      if(Uart_handle == NULL)
      {
        while(1);
      }
      Init_ring_buffer(&Uart_RX_ringbuffer, Uart_RX_buffer, UART_RX_RINGBUFFER_SIZE);
      Init_ring_buffer(&Uart_TX_ringbuffer, Uart_TX_buffer, UART_TX_RINGBUFFER_SIZE);
      
      Swi_Params SWI_PARAM;
      Swi_Params_init(&SWI_PARAM);
      SWI_PARAM.arg0 = 1;
      SWI_PARAM.arg1 = 0;
      SWI_PARAM.priority = 1;
      SWI_PARAM.trigger = 0;
      Uart_write_swi_handler = Swi_create(Uart_write_swi_ISR,&SWI_PARAM,NULL);
      
      UART_read(Uart_handle, RX_temp_buff, 64);
    }
    void Uart_close(void)
    {
      UART_readCancel(Uart_handle);
      UART_close(Uart_handle);
    }
    void Uart_change_baud(uint8_t baud, uint8_t parity)
    {
      UART_close(Uart_handle);
      UART_Params Uart_params;
      UART_Params_init(&Uart_params);
      
      Uart_params.readMode = UART_MODE_CALLBACK;
      Uart_params.readDataMode = UART_DATA_BINARY;
      Uart_params.readCallback = (UART_Callback)Uart_RX_callback;
      
      Uart_params.writeMode = UART_MODE_CALLBACK;
      Uart_params.writeDataMode = UART_DATA_BINARY;
      Uart_params.writeCallback = (UART_Callback)Uart_TX_callback;
      switch(baud)
      {
        case 0:
        {
          Uart_params.baudRate = 1200;
          break;
        }
        case 1:
        {
          Uart_params.baudRate = 2400;
          break;
        }
        case 2:
        {
          Uart_params.baudRate = 4800;
          break;
        }
        case 3:
        {
          Uart_params.baudRate = 9600;
          break;
        }
        case 4:
        {
          Uart_params.baudRate = 19200;
          break;
        }
        case 5:
        {
          Uart_params.baudRate = 38400;
          break;
        }
        case 6:
        {
          Uart_params.baudRate = 57600;
          break;
        }
        case 7:
        {
          Uart_params.baudRate = 115200;
          break;
        }
      }
      switch(parity)
      {
        case 0:
        {
          Uart_params.parityType = UART_PAR_NONE;
          break;
        }
        case 1:
        {
          Uart_params.parityType = UART_PAR_EVEN;
          break;
        }
        case 2:
        {
          Uart_params.parityType = UART_PAR_ODD;
          break;
        }
        case 3:
        {
          Uart_params.parityType = UART_PAR_NONE;
          break;
        }
      }
      Uart_handle = UART_open(Board_UART, &Uart_params);
      if(Uart_handle == NULL)
      {
        while(1);
      }
      //Open RX timeout (32-bit period no data)
      if(UART_STATUS_SUCCESS != UART_control(Uart_handle, UARTCC26XX_CMD_RETURN_PARTIAL_ENABLE, NULL))
      {
        while(1);
      }
    }
    void Uart_Write_data(uint8_t *pBuffer, uint8_t length)
    {
      Write_ring_buffer(&Uart_TX_ringbuffer, pBuffer, length);
      if(Uart_TX_idle_flag)
      {
        Uart_TX_idle_flag = false;
        Uart_TX_length = Read_ring_buffer(&Uart_TX_ringbuffer, Uart_TX_temp_buffer, 64);
        UART_write(Uart_handle, Uart_TX_temp_buffer, Uart_TX_length);
      }
    }
    void Uart_discard_data(void)
    {
      Uart_RX_ringbuffer.next_in = Uart_RX_ringbuffer.next_out;
    }
    uart.h