Motore di ricerca datesheet componenti elettronici
  Italian  ▼
ALLDATASHEETIT.COM

X  

AN1780 Scheda tecnica(PDF) 3 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) 3 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
 3 / 9 page
background image
3/9
STR71X REAL TIME CLOCK APPLICATION EXAMPLE
4 CONFIGURATION MODE
To write in the RTC_PRL, RTC_CNT, RTC_ALR registers, the peripheral must enter Config-
uration mode. This is done by setting the CNF bit in the RTC_CRL register.
In addition, writing to any RTC register is only enabled if the previous write operation is fin-
ished.
To enable the software to detect this situation, the RTOFF status bit is provided in the
RTC_CR register to indicate that an update of the registers is in progress. A new value can be
written to the RTC counters only when the RTOFF status bit value is ’1’.
Configuration Procedure:
1. Poll RTOFF, wait until its value goes to ‘1’
2. Set CNF bit to enter configuration mode
2. Write to one or more RTC registers
3 Clear CNF bit to exit configuration mode
The write operation only executes when the CNF bit is cleared and it takes at least two
Clock32 cycles to complete.
5 32-BIT COUNTER TIME CONVERSION
This application note explains how to convert the 32-bit time value into a date and time value
that can be put in the form of MM/DD/YYYY, HH:MM:SS. Many functions provided by the ARM
compiler used to convert from a date and time to seconds are also described.
These functions are modified in order to explore the STR71x RTC to deliver time and date.
5.1 C LIBRARY FUNCTIONS USED
5.1.1 RTC prescaler Initialisation:
Before start-up we must adjust the STR71x RTC prescaler register value in order to have the
RTC counter registers incremented every second, this can be configured by using a prescaler
value of 0x8000 (32768) to slow down the RTC clock from 32768 Hz to 1 Hz.
5.1.2 Origin Date Adjust
Since the date used in this application note is the same used with the UNIX operating system,
the reference date January 1, 1970, often referred to as Unix Epoch, we must
add this number
0x3FF36300 to the value obtained from the STR71x RTC Counter register with intent to have
a start date = 01/01/2004.



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