# Holding the logic 'high' state for a certain time

**URL:** <https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667>\
**Category:** Open AT\
**Created:** [September 25, 2009, 4:30am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667 "2009-09-25T04:30:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shafeer](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shafeer](https://forum.sierrawireless.com/u/Shafeer)\
**Post date:** [September 25, 2009, 4:30am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/1 "2009-09-25T04:30:49Z")

</div>

I have a fastrack supreme 10 modem, using adl is it possible to instruct the GPIO to hold a ‘high’ state(high bit) for a amount of time(eg. 5mins)

Thanks  
Shafeer

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [September 25, 2009, 5:24am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/2 "2009-09-25T05:24:45Z")

</div>

Hiya,

Are you writing your own application, or relying on the internal AT commands?

If you are writing your own application, you can use a timer or calendar alarm event to generate pretty much any time you want. If you’re relying on the internal AT commands, I don’t think that there’s anything there…so you might (probably) have to write a simple application to do this.

Have a look at : adl\_tmrXXXX() functions, adl\_rtcXXXX() functions, adl\_gpioXXXX() fucntions and the AT+CALA command. This should give you a good starting point…

ciao, Dave

---

<div class="post-metadata">

**Author:** ![Shafeer](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shafeer](https://forum.sierrawireless.com/u/Shafeer)\
**Post date:** [September 25, 2009, 6:43am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/3 "2009-09-25T06:43:28Z")

</div>

Thanks for your reply  
I will be using adl\_tmrsubscribe, but i want to know if adl\_tmrsubscribe has maximum time?

in other words,using this hello world code as a reference

```auto
void adl_main ( adl_InitType_e InitType )
{
    TRACE (( 1, "Embedded : Appli Init" ));    
    /* Set 1s cyclic timer */
    adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
}
```

can i modify it to wait for around 20 mins?  
In this way…

```auto
/* Set 20mins(1200s) cyclic timer */
    adl_tmrSubscribe ( TRUE, 12000, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
```

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [September 25, 2009, 6:59am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/4 "2009-09-25T06:59:42Z")

</div>

Hiya,

> [@Shafeer](#):
>
> I will be using adl\_tmrsubscribe, but i want to know if adl\_tmrsubscribe has maximum time?

Sure does. Look in the ADL guide for the value of ADL\_TMR\_100MS\_MAX\_VALUE (Section 3.4.3.1 in the ADL R7.4 version). According to the guide, the max period for the timer is around 7 days.

For long duration events, you might be better to read the real-time clock (using adl\_rtcXXX()), and subscribe to the +CALA unsolicited event, and then set an alarm sometime in the future using a call to AT+CALA. It’s a bit messy (some ADL calls, some AT commands) though.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![Madouc](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Madouc](https://forum.sierrawireless.com/u/Madouc)\
**Post date:** [September 25, 2009, 7:00am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/5 "2009-09-25T07:00:21Z")

</div>

> [@Shafeer](#):
>
> Thanks for your reply  
> I will be using adl\_tmrsubscribe, but i want to know if adl\_tmrsubscribe has maximum time?
> 
> in other words,using this hello world code as a reference
> 
> ```auto
> void adl_main ( adl_InitType_e InitType )
> {
> TRACE (( 1, "Embedded : Appli Init" ));    
> /* Set 1s cyclic timer */
> adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
> }
> ```
> 
> can i modify it to wait for around 20 mins?  
> In this way…
> 
> ```auto
> /* Set 20mins(1200s) cyclic timer */
> adl_tmrSubscribe ( TRUE, 12000, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
> ```

if you would look at the documentation you will find that:

> [@ADL user guide](#):
>
> 3.4.3.1 ADL\_TMR\_100MS\_MAX\_VALUE  
> ADL\_TMR \_100MS\_MAX\_VALUE defines the maximal value that can be set for a timer with a  
> granularity of 100 ms. Refer to the TimerValue parameter in adl\_tmrSubscribe  
> function (see section 3.4.7) and adl\_tmrSubscribeExt function ( see section 3.4.8 ). The  
> maximal period of the timer is about 7 days.  
> • Code  
> #define ADL\_TMR\_100MS\_MAX\_VALUE 0x5E9000  
> • Description  
> ADL\_TMR\_100MS\_MAX\_VALUE : Max value for 100ms-timer

---

<div class="post-metadata">

**Author:** ![Shafeer](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shafeer](https://forum.sierrawireless.com/u/Shafeer)\
**Post date:** [September 25, 2009, 9:14am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/6 "2009-09-25T09:14:27Z")

</div>

great thanks for prompt replies

i wont be needing 7 days long timer…max a few hours only

just another thing, my (one-shot timer)timer is gonna activate everytime a sms is recieved

According to the user guide:

```auto
adl_tmr_t *tt
void Timer_Handler(u8 Id, void * Context)
{
     adl_atsendResponse...
     //Timer is not unsubscribed since it expires "naturally"
}

bool SMS_AUTO_Handler(ascii *SmsTel, ascii *SmsTimeOrLength, ascii *SmsText)
{
    tt = adl_tmrSubscribe ( FALSE, 12000, ADL_TMR_TYPE_100MS, Timer_Handler);
}
```

Since the one shot timer is not unsubscribed, whenever a new message is recieved, will it overwrite the old subscription?

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [September 25, 2009, 10:04am UTC](https://forum.sierrawireless.com/t/holding-the-logic-high-state-for-a-certain-time/3667/7 "2009-09-25T10:04:45Z")

</div>

> [@ADL User Guide](#):
>
> Note:  
> Once a “one shot” (non cyclic) timer has expired and the handler is called, there is no need to unsubscribe from the Timer service: such a timer is automatically unsubscribed once elapsed.
