RTCC.setAlarmDate

Name

 * RTCC.setAlarmDate

Description
Sets the alarm date of the Real Time Clock and Calendar (RTCC) by writing a value into the Alarm Date Value Register (ALRMDATE).

Note: that the behaviour of the RTCC Alarm is dependent not only on the values in the Alarm Time Value Register (ALRMTIME) and in the Alarm Date Value Register (ALRMDATE) but also the values in the RTC Alarm Control Register (RTCALRM) which are determined by other settings including the various RTCC.AlarmRepeat~ functions.

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.setAlarmDate(unsigned long alDate)
 * Parameters:
 * alDate = the alarm date to be set in BCD format (see below).
 * Returns/Output;
 * [None]

The format for the data in alDate is 0x00MMDD0W, where :-
 * MM is the month, i.e. 01 - 12,
 * DD is day of the month, i.e. 01 - 28/29/30/31 depending on the length of the month,
 * W is the day of the week, e.g. 0 - 6 where Saturday = 0 and Friday = 6 (see Note below),

i.e. if an alarm date of Saturday 31 December is to be set then alDate = 0x00123100.

Unlike the RTCDATE Register the ALRMDATE Register does not have a location implemented for Year and if a value is inserted in the same position as that for Year for the RTCDATE Register (the first 00 in the number format given above) it will be ignored by the ALRMDATE Register, i.e. alDate = 0x00123100 and alDate = 0x12123100 will both result in the same alarm date of Saturday 31 December being set.

Note: The RTCC has no calendar look-up, and takes the day of the week solely from the value input. To a certain extent the start of the week (day 0) is arbitrary and the setting of 0 = Saturday given above is based on the RTCC example included in the Pinguino IDE whereas in Table 29-2: Day of Week Schedule in the Microchip PIC32 Family Reference Manual, Section 29. Real-Time Clock and Calendar (RTCC) (see below) Sunday is taken to be day 0.