Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN1780 Datasheet(PDF) 6 Page - STMicroelectronics

Part # AN1780
Description  STR71X REAL TIME CLOCK APPLICATION EXAMPLE
PDF  9 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1780 Datasheet(HTML) 6 Page - STMicroelectronics

  AN1780 Datasheet HTML 1Page - STMicroelectronics AN1780 Datasheet HTML 2Page - STMicroelectronics AN1780 Datasheet HTML 3Page - STMicroelectronics AN1780 Datasheet HTML 4Page - STMicroelectronics AN1780 Datasheet HTML 5Page - STMicroelectronics AN1780 Datasheet HTML 6Page - STMicroelectronics AN1780 Datasheet HTML 7Page - STMicroelectronics AN1780 Datasheet HTML 8Page - STMicroelectronics AN1780 Datasheet HTML 9Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 6 / 9 page
background image
6/9
STR71X REAL TIME CLOCK APPLICATION EXAMPLE
Figure 2. C Code Flow:
Here is a section of code taken from main.c which performs the steps shown above in Figure
2 above:
#include "71x_lib.h"
#include "lcd.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#define RTC_PRESC 0x8000
Adjust current Date and Time
using HyperTerminal and UART0
Use localtime function in order to
convert the current date and time
to seconds since Unix Epoch
Substract this number 0x3FF36300
from the result in order to have
reference date first January 2004
Update the RTC device counter
Use a prescaler value of 0x8000
in order to have the RTC counter
registers incremented every one second
Add this number 0x3FF36300 to the
counter register value in order to have
a start date = 01/01/70
Use mktime function to Convert
the calendar time pointed to by timer
into a broken-down time
Read the RTC counter register value
main
Display time and date
Configure the RTC Alarm
RTC IRQHandler
Clear AIR and GIR Bits
Configure an alarm after 5 seconds
Display an alarm message



Html Pages

1 2 3 4 5 6 7 8 9


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com