DS1307Ram

In addition to keeping the correct time and date, the DS1307 Real Time Clock (RTC) allows a program to access 56 bytes of Non Volatile (NV) RAM. Really useful if you want to store a few bytes of data between powering down and powering up your microcontroller. This simple program writes "10" and "20" to NV RAM and then reads it back...

' import module...
Imports DS1307         

' main program entry point...
Sub Main() 
   DS1307.WriteByte(0,10) ' write 10 to address location 0
   DS1307.WriteByte(1,20) ' write 20 to address location 1

   ' now read it back...
   Console.Write("Addr(0) = ", cstr(DS1307.ReadByte(0)),13,10)  
   Console.Write("Addr(1) = ", cstr(DS1307.ReadByte(1)),13,10) 
End Sub