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.

Wake up by I/O

Other Parts Discussed in Thread: CC2540

Hi there,

I am trying to connect my CC2540 to an external MCU, I use one I/O from MCU to wake up the CC2540.

When the I/O is pull low, I use osal_pwrmgr_device( PWRMGR_ALWAYS_ON ) to keep the CC2540 to stay on.

When the I/O is pull high again, I use osal_pwrmgr_device( PWRMGR_BATTERY) to allow the CC2540 to sleep.

I found that after wake up, I need to wait 100ms in MCU side so that sending UART data without any issue (e.g. data corrupt).

I don't think this is normal since 100ms is too long.

Anyone can help? Thanks in advance.

Regards,

Cheong

  • Do you use an interrupt to wake the CC2540 or are you relying on some other periodic event? This might explain why you need to wait 100ms for the CC2540 to receive valid data on the UART, because the CC2540 is not waking instantly.

  • I added the following code to try:

    static void heartRate_HandleKeys( uint8 shift, uint8 keys )

    {

      if ( keys & HAL_KEY_SW_1 )

      {

    #if defined ( POWER_SAVING )    

         osal_pwrmgr_device( PWRMGR_ALWAYS_ON );

    #endif

      }

      else

      {

    #if defined ( POWER_SAVING )    

        osal_pwrmgr_device( PWRMGR_BATTERY );

    #endif    

      }

    }

  • There is no need to do this.

    As far as I remember, you can make a quick modification in hal_key.c. Give it a try in keyfob project.