How to set RTC?


#1

Hi,
How we can set RTC within ADL ?
I see there is function adl_rtcGetTime but there is no way to set it, any ideas ?
Tnx.


#2

For that purpose you need to use AT+CCLK. Unfortunately there is no adl_rtcSetTime command. The problem with AT+CCLK is that you cannot set milliseconds. Internally the millisecond counter is not set to zero when using AT+CCLK, meaning that you need to introduce a time offset variable if you plan on using it in time critical applications. But time precision is a general problem with wismo modules. Even in ‘boost mode’ simple commands consume a few milliseconds. Theoretically the time can be measured up to microseconds, but on an ARMv9 processor the output is rather random. I guess you can use it as an alternative to the random number generator. However, an adl_rtcSetTime command would still be interseting in the future. When will wavecom consider introducing it?

Regards,

wismo_coder


#3

AT Command?

Another one for the list of missing ADL support:
viewtopic.php?f=3&t=904&p=4451&hilit=messing+about+with+AT+commands#p4451
viewtopic.php?t=1171&hilit=mess+about+with+AT+commands


#4

You have acknowledged my doubts about setting RTC …
As it seems I’ll use AT+CCLK :smiley:

Thank you for reply !


#5

Hi All,

Just to let you know that there is now an adl_rtcSetTime() function in Oasis 2.02 (firmware R71a).

I’ve tested it on my Q2686 and it works OK - but you really need to ensure that the year is 4 digits long.

adl_rtcSetTime() will accept a time structure with a two digit date value, and appear to set the time (i.e. return with no error). However, the system time (as checked with AT+CCLK?) will be wrong, and the internal RTC hardware doesn’t appear to get updated (i.e. for me the RTC reverted to the last valid time after a reboot).

Using adl_rtcSetTime() should let you set the RTC fractional seconds - but I haven’t tested it.

cheers, Dave


#6

Hello,

I have module Q2687. I have problem with function adl_atCmdCreate, I need set RTC. This is my program:

#include “adl_global.h”
#include “adl_rtc.h”

const u16 wm_apmCustomStackSize = 1024;
static ascii buf[256];

void HelloWorld_TimerHandler ( u8 ID )
{
TRACE (( 1, “Embedded : Hello World” ));
adl_atSendResponse ( ADL_AT_UNS, “\r\nHello World from Open-AT\r\n” );
wm_sprintf(buf,"AT+CCLK=“08/08/08,08:08:00"”); //zapisywanie daty pod zmienna buf
adl_atCmdCreate(buf, ADL_AT_PORT_TYPE(ADL_PORT_OPEN_AT_VIRTUAL_BASE, FALSE), NULL, “*”, NULL);
}

void adl_main ( adl_InitType_e InitType )
{
TRACE (( 1, “Embedded : Appli Init” ));
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, HelloWorld_TimerHandler );
}

When program go to adl_atCmdCreate function, program call ERROR and every thing is break. But in Terminal Emulator by at+cclk? comend a can check thay RTC was changed. Whay my program call ERROR?

Regards.


#7

Why don’t you just use the adl_rtcSetTime() call - noted by davidc nearly a year ago?