Tag Archives: PIC microchip


Software realization of Real-Time Clock and Calendar

Dedicated real-time clock and calendar (RTCC) chips are useful in a wide range of embedded applications, such as data loggers, for accurate time-stamping of data measurements. The use of external RTCC chip frees the main processor from timekeeping responsibility and to perform other critical tasks. However, for small applications the software realization of RTCC in the main application can simplify the design and reduce the overall cost of the system. This application note from Microchip describes the implementation of software RTCC using PIC16F1827 microcontroller. The implementation provides the time (seconds, minutes, and hour), date (day, month, and year), day of week, and one alarm signal. The basis of this implementation of RTCC is the Timer1 counter, which is driven by an external 32.768 kHz crystal. The Timer1 counter can operate during Sleep mode, which helps to reduce the power consumption of the overall application if it is to be powered from a battery.