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.

CCS/LAUNCHXL-CC1310: slepp and interput handling

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310,

Tool/software: Code Composer Studio

Hi 

Have tried to look but can’t find any specific info on this.

Have a cc1310 deign. The system send out a small packet then goes to sleep for 20sec. If an interrupt occur in this period it must start sending each second for a minute or so, if no new interrupts occur then back to 20sec interval. I have looked at the pininterupt example but it does not do what I want.

 

My concern is that if I use sleep(20), get an interrupt and start using sleep(1) what happened with the first sleep regarding call stack?

Does sleep(1) clean up and terminate sleep(20). If not then I will get stack issues because I will “fill up” with sleep(20). If I had full control I would, use an HW timer set it to 20 and shutdown. If an interrupt comes in, I will reset the timer to 1 and run all in the same interrupt handler of the timer.

 And does usleep and sleep do behave the same?

Any input is appreciated.

  • Hi Thomas,

    It sounds like what you're looking for is a timer interrupt rather than a GPIO interrupt.  You can go through SYS/BIOS (TI-RTOS Kernel) user guide for examples and details on the Timer module.

    Yes Sleep() and uSleep() behave the same, the only difference is that Sleep() takes seconds as the parameter and uSleep() takes microseconds.

    Thanks,

    Alexis

  • Hi Alexis

    I must use DIO interrupts because the user need to wake the device pushing a button or if movement is detected. If this is the case the device need to be more aggressive.

    The whole point is to extend battery life. No point waking each second or 500ms to check if user have pushed button. but when the user push button i need to "kill" slepp 20 and move on.

    So in my "main" function i called sleep(20) and an incoming interrupt is waking the device, when the interrupt is done does the sleep(20) continues to sleep for the reaming seconds or where does it return. My concern is filling the stack when this happens multiple times. 

    I am struggle to find detailed information in the documentation also. Just searching for sleep, usleep, sleepmode etc does not return anything. 

    I have tried too look at the underlying source code but it is to much going on to understand how it is all "connected"

    Thanks Thomas

  • Hi Alexis,

    My problem is also similar. I want to give a 'high' signal on a certain DIO to wake the LAUNCHXL-CC1310 from standby mode (i.e., when the device is in sleep).

    Can someone suggest something?

    Thanks in advance,

    -Chandrasekhar DVS

  • Hi Chandrasekhar,

    I recommend looking at section 6.6.4 in the TRM: http://www.ti.com/lit/ug/swcu117h/swcu117h.pdf 

    Table 6-6 talks about what registers to use to configure the wake-up source for Standby Mode. 

    Thanks,

    Alexis

  • Hi Alexis,

    Thanks for your information. However, are there any examples on how to use such registers. What I mean is how do I write code for the sequence given in table 6.6.4? I did some searching and stumbled at a function given below in aon_event.h which can be apparently used to "Select event source for specified MCU programmable event" . 

    //! \param ui32MCUWUEvent is one of the programmable MCU wake-up event sources.
    //! - \ref AON_EVENT_MCU_WU0
    //! - \ref AON_EVENT_MCU_WU1
    //! - \ref AON_EVENT_MCU_WU2
    //! - \ref AON_EVENT_MCU_WU3
    //! \param ui32EventSrc is an event source for the event AON fabric.
    //! - AON_EVENT_DIO0                   : Edge detect on DIO0. See hw_device.h
    //! - ...
    //! - AON_EVENT_DIO31                  : Edge detect on DIO31. See hw_device.h
    
    extern void AONEventMcuWakeUpSet(uint32_t ui32MCUWUEvent,
                                     uint32_t ui32EventSrc);
    
    

    Is this the code version for configuring wake-up source for standby? If yes, how and where do I use this?

    Thanks in advance,

    -Chandrasekhar DVS