- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We are currently using a Timer2 period of 250mSec.
This currently SPEEDS UP the unix time to 4X - not what we want!
I tried calling RTC_1_SetPeriod() with different values - I still get the same clock-rate. I'm not sure what this function accomplishes!
I implemented a 'divide-by-4' counter in RTC_1_Update() to correct the problem - unix time is now updated once/second.
Is there a more elegant way to fix this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There usually is another way. Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I"m wary about posting proprietary source code publicly.
Thanks anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Then supply us with a resuced but working example that you did configure
or
compare your configuration to the examples provided on Creator's start page.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are still looking for a response, the function:
void RTC_1_SetPeriod(uint32 ticks, uint32 refOneSecTicks)
{
RTC_1_updateTimePeriod = ticks;
RTC_1_tickRefOneSec = refOneSecTicks;
}
first parameter "ticks" actually corresponds to a software divider, in my case I'm using LFCLK 32.768KHz and I need to make RTC work at the normal rate (1 second), so ticks = 1, in other words
RTC_1_SetPeriod(1, 32768);