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.

Enabling sleep mode in CC2541 and wake up sources.

Other Parts Discussed in Thread: CC2541

Hii,

I'm using Wireless Connectivity Development Kit based on CC2541. I want to enable Sleep mode so cc2541 will be consuming minimum current.Also, how to wake it up through software(watchdog timer,UART, stream of data from Client(Btool)) and hardware interrupts(Button).

For now, I am using Btool as a Client with Hardware USB Dongle(Factory Program) and keyfob as a server with thermometer program.

I hope I made my point clear.

Thanks,

Kumar Karan Jain

  • You can add compile option POWER_SAVING in BLE stack to make BLE devices enter sleeping mode. You cannot wake up a sleeping device using UART or stream data from clienr(btool). To wake up by timer, you can define an application event and schedule it to wake up by API osal_start_timerEX. To wake up by button, you can refer to sample code in hal_key.c which show you how to define a pin to GPI and connect interrupt service to it.
  • Hello Kumar,

    If using UART or SPI, you can define and use the MRDY/SRDY pins to support wake up. Note that the CC2540USB dongle with HostTest firmware does not support POWER_SAVINGS.

    Best wishes
  • Hii YK Chen,

    Thanks for your reply.

    1.) I am a beginner of CC2541, recently started using this.I found it many times in program where it(osal_start_timerEX) is bisng eing called, I dont understand how to use this function,which parameter has to be passed. Please elaborate how to utilize this function.

    2.) I'm using thermometer program from generic location C:\Texas Instruments\BLE-CC254x-1.4.0\Projects\ble\Thermometer\CC2541DB , Utilizing the TempImeas function by writing 0x0001 to handle 0x0018 after discovering handle by UUID 0x2A1E.
    This routine send measurement after each second I want to implement sleep mode here after it send first measurement and wake up by either key press or OSAL timer event.

    Please help me out with this issue.
    If anything left to clear query, please let me know.

    Thanks
    Kumar Karan Jain
  • HIi


    Also, I please tell where these events are called.How these call back function flow works,like

    extern void Hal_Init ( uint8 task_id ); --> task_id- where it assigned, similar to thois there are many other function, where i am confused with same part.
    In thermometerCB() function also have same query.

    Please explain this part.

    Thanks,
    Kumar Karan Jain
  • I would like to suggest you reading TI_BLE_Sample_Applications_Guide.pdf and TI_BLE_Software_Developer's_Guide.pdf in BLE Documents folder first.
  • In addition to what YiKai has suggested, you can refer 'OSAL API.pdf' and 'HAL Driver API.pdf' located at "C:\Texas Instruments\BLE-CC254x-1.4.0\Documents\osal" and "C:\Texas Instruments\BLE-CC254x-1.4.0\Documents\hal", respectively.

    It helps you to understand the OSAL and HAL APIs.

  • Thanks to YK chen and Dhaval.


    I have read documents suggested, understood the routine but unable to get where to place these routines. I utilize HalSleep(30000) in the if ( keys & HAL_KEY_SW_2 ) in this routine but when I press this is key it is not getting sleep down.

    If you can help with example it would really be appreciable.

    Thanks,
    Kumar Karan Jain
  • You don't have to call HalSleep in your application. If you define POWER_SAVING in your project, CC254x would automatically go to sleeping mode when there is no event or task to handle.
  • As I know POWER_SAVING has to be defined in the preprocessor, If I'm wrong please correct me .
    In which mode it will be - PM2 or PM3.

    Also tell me if I want it to be in sleep mode where it can only be wake up by button press, How could I do that.


    Thanks,

    Kumar Karan Jain
  • Hi Kumar,

    The device will go in to PM2/PM3 automatically. To achieve better sleep current you need to configure the GPIOs as OUTPUT-LOW. For more information please refer this application note.

    To wake the device up from power down mode using switch, you can register a interrupt on switch press for GPIO on which button is connected. So whenever the button will be pressed device will be active.

    Hope this helps!

    Thanks,

    Dhaval

    Note: You may like to click on 'Verify Answer', if this has answered your question.

  • It goes to PM2.

  • If client will be mobile device (android OS), then could it be possible to wake up server(CC2541) from sleep mode by transmitting data stream or any command.
    As I used a module based on CC2541(HM-11), which is capable of wake up from data stream or a command from client.

    Please provide your value feedback.


    thanks,
    Kumar Karan Jain
  • To make it possible, your peripheral device need to be remain connected with the central device. And in that case device won't go in to sleep mode, as your radio remain active.

    So AFAIK, it is not possible to wake up your device by sending command from your central device.