Home/Support/Support Forum/ConnectCore9P 9215 Battery backed RTC NVRAM
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

ConnectCore9P 9215 Battery backed RTC NVRAM

0 votes
Hi,

THe RTC module in the NS9215 supports 64 bytes of NVRAM that is supported by the backup battery according to the datasheet.

Has anyone managed to get this working?

I have tried accessing it directly, and it seems that I can read and write to it, I can then read back the updated value, but when I hit the reset button it appears that the contents get set back to zero.

Any assistance would be very helpfull
asked Oct 13, 2010 in NET+OS by rdeabill Community Contributor (142 points)
recategorized Nov 26, 2013 by tuxembb

Please log in or register to answer this question.

4 Answers

0 votes
Hi,
Yes i did..
and it is working fine..
this piece of code is enough :

#include <rtc.h>


rtc_time.date = 26;
rtc_time.dayOfWeek = NA_RTC_THURSDAY;
rtc_time.hours = 11;
rtc_time.hundredths_second = 0;
rtc_time.minutes = 58;
rtc_time.month = NA_RTC_AUGUST;
rtc_time.seconds = 0;
rtc_time.year = 2010;


if( naRtcSetTime(device_id,&amp;rtc_time) != NASTATUS_SUCCESS)
{
perror("RTC Set Time Failed\n");
exit(1);
}


try this :)
answered Oct 13, 2010 by bobthomas13 Seasoned Professional (182 points)
what do you use as device_id?
Its the identifier of RTC.
Take a look at
Digi ESP for NET+OS User Guide > Reference > NET+OS 7.5 API Reference > Hardware/Board Support > Device Drivers > Real Time Clock Driver (RTC)
0 votes
Hi,
Thanks for the response. I also have the RTC itself working and it keeps time OK onthe backup battery.

It appears that there is also some uncommitted NVRAM within the same module, and that is what I am trying to use.

According to the NS9215 data sheet P272 it is
RTC register address map
0x9006_0000 – 0x9006_00BF RTC CSR Space
0x9006_0000 – 0x9006_00FC 64-byte Battery Backed RAM


Having written this I think I can see the mistake. The datasheet is has both the CSR space and the RAM overlapping. I will give it another try at 0x9006_00C0 and see if that works better.
answered Oct 13, 2010 by rdeabill Community Contributor (142 points)
0 votes
Hi,

Check P460

Register address map || Register Address Description

9006 0000 RTC General Control register
9006 0004 12/24 Hour register
9006 0008 Time register
90060 000C Calendar register
9006 0010 Time Alarm register
9006 0014 Calendar Alarm register
9006 0018 Alarm Enable register
9006 001C Event Flags register
9006 0020 Interrupt Enable register
9006 0024 Interrupt Disable register
9006 0028 Interrupt Status register
9006 002C General Status register

These are the CSRs..
I think you can use the rest of the space :) :)
answered Oct 13, 2010 by bobthomas13 Seasoned Professional (182 points)
0 votes
Thanks for these info :)
answered Oct 15, 2010 by autostudio01 New to the Community (1 point)
...