RTCC.setTime

Name

 * RTCC.setTime

Description
Sets the time of the Real Time Clock and Calendar (RTCC) by writing a value into the RTC Time Value Register (RTCTIME).

Only works for 32-bit Pinguinos with a 32,768 kHz quartz crystal which allows the use of the built-in RTCC functionality of the PIC32, such as the Olimex PIC32 Pinguino OTG.

Syntax
void RTCC.setTime(unsigned long tm)
 * Parameters:
 * tm = the time to be set in 24 hour clock and BCD format (see below).
 * Returns/Output;
 * [None]

The format for the data in tm is 0xhhmmss00 using a 24 hour clock, where :-


 * hh is the hour in 24 hour format, i.e. 00 - 24,
 * mm is the minutes, i.e. 00 - 59,
 * ss is the seconds, i.e. 00 - 59,

i.e. if a time of 2:35:25 pm is to be set then tm = 0x14352500

Example
Setting the time with hour / minute in Decimal ( Read from Button)