Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

AN1780 Scheda tecnica(PDF) 6 Page - STMicroelectronics

Il numero della parte AN1780
Spiegazioni elettronici  STR71X REAL TIME CLOCK APPLICATION EXAMPLE
PDF  9 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Produttore elettronici  STMICROELECTRONICS [STMicroelectronics]
Homepage  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1780 Scheda tecnica(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


Scheda tecnica Scarica

Go To PDF Page


Link URL



Lei ha avuto il aiuto da alldatasheet?  [ DONATE ] 

Di alldatasheet   |   Richest di pubblicita   |   contatti   |   Privacy Policy   |   Collegamento alla scheda tecnica    |   scambio Link   |   Ricerca produttore
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