# ConnectCore9P 9215 Battery backed RTC NVRAM

**URL:** <https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932>\
**Category:** NET+OS\
**Tags:** rtc\
**Created:** [October 13, 2010, 10:20am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932 "2010-10-13T10:20:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdeabill](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rdeabill](https://forums.digi.com/u/rdeabill)\
**Post date:** [October 13, 2010, 10:20am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/1 "2010-10-13T10:20:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bobthomas13](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bobthomas13](https://forums.digi.com/u/bobthomas13)\
**Post date:** [October 13, 2010, 11:54am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/2 "2010-10-13T11:54:02Z")

</div>

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

#include

```
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

```

");  
exit(1);  
}

try this 🙂

---

<div class="post-metadata">

**Author:** ![rdeabill](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rdeabill](https://forums.digi.com/u/rdeabill)\
**Post date:** [October 13, 2010, 12:32pm UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/3 "2010-10-13T12:32:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bobthomas13](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bobthomas13](https://forums.digi.com/u/bobthomas13)\
**Post date:** [October 13, 2010, 1:11pm UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/4 "2010-10-13T13:11:16Z")

</div>

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 🙂 🙂

---

<div class="post-metadata">

**Author:** ![autostudio01](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@autostudio01](https://forums.digi.com/u/autostudio01)\
**Post date:** [October 15, 2010, 4:19am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/5 "2010-10-15T04:19:02Z")

</div>

Thanks for these info 🙂

---

<div class="post-metadata">

**Author:** ![gavello](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@gavello](https://forums.digi.com/u/gavello)\
**Post date:** [October 1, 2013, 9:12am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/6 "2013-10-01T09:12:55Z")

</div>

what do you use as device\_id?

---

<div class="post-metadata">

**Author:** ![tuxembb](https://avatars.discourse-cdn.com/v4/letter/t/b38774/32.png) [@tuxembb](https://forums.digi.com/u/tuxembb)\
**Post date:** [October 3, 2013, 12:14am UTC](https://forums.digi.com/t/connectcore9p-9215-battery-backed-rtc-nvram/4932/7 "2013-10-03T00:14:02Z")

</div>

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)
