Nano System clock gaining time
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Nano System clock gaining time
We have several units using the NANO and the system clock gains about 5-minutes every 12-hours. Is there anything to be done?
Re: Nano System clock gaining time
Just basic questions: have you modified the ticks per second in predef.h? Are you using 2.x or 3.x tools?
Re: Nano System clock gaining time
The NANO uses a 25ppm oscillator, so that should not be happening. Can you confirm you are not talking about a real time clock, and as you say are describing the system secs value over a 12 hour period with no system file changes? It might be worth while to make a very simple app, like simplehtml, and add the ability to print out the secs value to verify it is not something in the application.
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Nano System clock gaining time
I'm using v2.9.5 tools. I wouldn't think that would make a difference. The ticks per second has not been changed.
Not sure what is meant by the distinction of real-time clock vs system clock. It's the clock we get the date and time from.
Not sure what is meant by the distinction of real-time clock vs system clock. It's the clock we get the date and time from.
Re: Nano System clock gaining time
How EXACTLY are you getting the time from the unit.
how are you setting the time...
Give the precise CODE you are using...
how are you setting the time...
Give the precise CODE you are using...
Re: Nano System clock gaining time
In the 3.X branch I find:
Fixing tick count multiple interrupt trip issues in 5441X, was causing clock to run fast
It has to do with the time keeping interrupts on all 5441X platforms. (Nano includee)
I'll see what it takes to back port this to 2.9.5
Fixing tick count multiple interrupt trip issues in 5441X, was causing clock to run fast
It has to do with the time keeping interrupts on all 5441X platforms. (Nano includee)
I'll see what it takes to back port this to 2.9.5
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Nano System clock gaining time
On bootup, RTCSetSystemFromRTCTime() is called to restore time from an external real-time clock, PFC8563.
When queried for the current time, this function is used:
When queried for the current time, this function is used:
Code: Select all
//Formats 16 bytes time into "string" as 1999/12/31,23:59
void FormatDateTime( char *string, bool add_sec )
{
time_t t;
time( &t );
struct tm *ptime = localtime( &t );
if ( !ptime )
{
string[0] = 0;
return;
}
siprintf( string, "%04d/%02d/%02d,%02d:%02d:%02d", ptime->tm_year + 1900,
ptime->tm_mon + 1,
ptime->tm_mday,
ptime->tm_hour,
ptime->tm_min,
ptime->tm_sec );
if ( !add_sec ) string[16] = NUL;
}
Re: Nano System clock gaining time
Please try the following change:
In nburn\nano54415\system\bsp.cpp
Find the xTick....
void xTick()
{
asm(".global Tick5441X");
asm(".extern OSTickISR");
asm(".extern write_pcsr");
asm("Tick5441X:");
asm(" move.w #0x2700,%sr"); //Add this line....
asm(" move.l %d0,-(%a7)");
asm(" move.b #0x0F,%d0");
asm(" move.b %d0,0xFC080001");
asm(" move.l (%a7)+,%d0");
asm(" jmp OSTickISR");
}
Remember you need to rebuild the platform after this change.
In nburn\nano54415\system\bsp.cpp
Find the xTick....
void xTick()
{
asm(".global Tick5441X");
asm(".extern OSTickISR");
asm(".extern write_pcsr");
asm("Tick5441X:");
asm(" move.w #0x2700,%sr"); //Add this line....
asm(" move.l %d0,-(%a7)");
asm(" move.b #0x0F,%d0");
asm(" move.b %d0,0xFC080001");
asm(" move.l (%a7)+,%d0");
asm(" jmp OSTickISR");
}
Remember you need to rebuild the platform after this change.
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Nano System clock gaining time
I made the change and built the system and my app. I loaded it into a Nano, and am running it. I'll know tomorrow if it worked. If it works, should the MOD5541X get the same change?
-
- Posts: 630
- Joined: Mon May 12, 2008 10:55 am
Re: Nano System clock gaining time
The fix works. Should this change be added to the other 5441X modules?