e. Real time clock (RTC) and timed operations

PIC18F2xJ50 microcontrollers have inbuilt real time clock (RTC) with an alarm trigger. The clock operates on external 32.768 kHz crystal resonator or other clock source of this frequency. The clock also features a special register that allows for minor adjustments to get the correct time measurement.

The alarm trigger module enables setting one time trigger or a variety of periodical triggers. Therefore it is possible to switch on a device once in a desired time period (ex. once a minute, once a day, once a month,…). RTC sets pin PB1 (PR11) on PIC18F2xJ50 to logical 1 to indicate an alarm trigger under condition that the PB1 output control is assigned to RTC.

Please, see PIC18F2xJ50 RTC Example.zip and PIC18F2xJ50 RTC Example x64.zip sample applications with source code from Downloads section. The applications require a PIC18F24J50 or a PIC18F26J50 microcontroller with v2.5 firmware or newer to run. Download PIC18F24J50 firmware v2.6.4 - all subversions.zip or PIC18F26J50 firmware v2.6.4 - all subversions.zip or newer. Select a suitable firmware version for your needs and program it to the microcontroller. SVLIB_PIC18F24J50 v3.7.NET4.dll and SVLIB_PIC18F24J50 v3.7.NET4x64.dll are included within the samples. Look at subsection 5.a on programming details.

Click on the screenshot to enlarge it.