herunterladen
![](https://oss-datasheet.aipcba.com/html/72CCDCDE8B889A82F14435AB0E0BDDE0/bg1.png)
1 Introduction
The MC9S08LG32 is a member of the Freescale HCS08
family MCUs. It uses the S08 core and integrates many
peripherals, such as LCD, SPI, I
2
C, SCI, ADC, and Real Time
Counters. This application note describes how to initialize and
maintain the Real Time Clock (RTC) in the MC9S08LG32
microcontroller family.
MC9S08LG32 Demo Board used for RTC setup is shown in
Figure 1. The system communicates with the MC9S08LG32
target via a USB Background Debug Mode (BDM) interface.
With BDM protocol, system can update the MC9S08LG32
firmware. RTC is implemented using the Real Time Counter
IP (S08RTCV1) on MC9S08LG32. RTC can be displayed on
the LCD connected on the board.
In this application note, the MC9S08LG32 RTC driver
interfaces are explained. Various applications for
MC9S08LG32 can make use of this driver. The following
sections will describe the details and the steps for creating an
application using it.
This application note does not cover how to configure the
LCD. For details, please see AN3823 on http://
www.freescale.com.
Freescale Semiconductor
Document Number: AN4478
Rev. 0, 03/2012
Software Real Time Clock
Implementation on MC9S08LG32
by:
Nitin Gupta
Automotive and Industrial Solutions Group
© 2012 Freescale Semiconductor, Inc.
Contents
1 Introduction................................................................1
2 Real Time Clock (RTC)............................................2
3 RTC driver framework..............................................2
3.1 RTC.c.............................................................3
3.2 RTC.h.............................................................5
3.3 RTC_main.c...................................................6
4 Integration of RTC driver..........................................7
5 Test results.................................................................7
6 Conclusion.................................................................8
7 References.................................................................8