![Infineon SPI F-RAM FM33256B Скачать руководство пользователя страница 13](http://html1.mh-extra.com/html/infineon/spi-f-ram-fm33256b/spi-f-ram-fm33256b_manual_2055116013.webp)
Application Note
13 of 19
001-87564 Rev.*D
2021-06-01
A Design Guide to SPI F-
RAM™ Processor Companion
- FM33256B
Pseudo Code Examples
r e s t r i c t e d
10.2
Set RTC Time/Date
/*************************
Set RTC time/date *******************************/
// Step #1 Set W bit which allows writes to RTC registers
data[0] = 0x02;
// Data for setting the W bit
WRITE_RTC (0x00,
// Sets the address pointer to Register 00h
data,
// Writes data 0x02 which sets the W bit
0x01);
// Number of bytes to be written
// Step #2 Write time/date to RTC Registers
data[0] = 0x00;
// Seconds set to 00
data[1] = 0x10;
// Minutes set to 10
data[2] = 0x14;
// Hours set to 14 (2 PM)
data[3] = 0x03;
// Day set to the third day of the week
data[4] = 0x04;
// Date set to the fourth day in March
data[5] = 0x03;
// Month set to March
data[6] = 0x08;
// Year set to 2008
WRITE_RTC (0x02,
// Sets the address pointer to Register 02h
data,
// Writes time/date
0x07);
// Number of bytes to be written
// RTC does not start to run yet.
// Step #3 Clear W bit to start RTC with the exact time
data[0] = 0x00;
// data=0x00 clears the W bit
WRITE_RTC (0x00,
// Sets the address pointer to Register 00h
data,
//
Data=0x00 clears the W bit to start RTC with time
defined
// in Step #2. The 8th clock of data byte defines the
actual
// start of the RTC.
0x01);
// Number of bytes to be written