Holding the logic 'high' state for a certain time


#1

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


#2

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


#3

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

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…

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

#4

Hiya,

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


#5

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


#6

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:

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?


#7