![Infineon SPI F-RAM FM33256B Manual Download Page 9](http://html1.mh-extra.com/html/infineon/spi-f-ram-fm33256b/spi-f-ram-fm33256b_manual_2055116009.webp)
Application Note
9 of 19
001-87564 Rev.*D
2021-06-01
A Design Guide to SPI F-
RAM™ Processor Companion
- FM33256B
Real-Time Clock
r e s t r i c t e d
In the FM33256B, the RTC data may be read without interrupting the RTC operation. When the RTC is read by
writing the
‘
R
’
bit in the control register (register 00h, bit 0) with a
’
1
’
, a snapshot is taken of the current time-
day-date and stored in the registers where it can be read by the host. The snapshot ensures that the time
doesn’t change
between successive reads from the host. However, internally, the RTC will be running normally.
Similarly, during RTC writes, the registers hold the data written by the host and wait to transfer it to the RTC
counters after all the time-day-date information has been written and
the ‘
W
’
bit (register 00h, bit 1) is cleared.
If W = 0, writes to the RTC registers are ignored. For more information on RTC read and write, refer
5.1
Backup Power
The RTC, event counter, and various control settings are maintained by using a backup power source on the
V
BAK
pin even if the primary power source is removed. The V
BAK
source may be a battery or a large-value super
capacitor. For more information, refer to
AN404 - F-RAM RTC Backup Supply (VBAK pin) and UL Compliance
When using a super capacitor as the backup source, the capacitor can discharge over a long period to a point
where the V
BAK
voltage drops out of spec and the RTC stops functioning, resulting in the loss of backup data. To
avoid this situation, the charge on the capacitor needs to be restored. For different types of charging, refer to
AN401 - Charging Methods for the F-RAM RTC Backup Capacitor
5.2
RTC Calibration
RTC calibration is required primarily to compensate the frequency shift due to crystal tolerance, temperature
effect, and load-capacitance mismatch. A 512-Hz signal brought out on the ACS
(Alarm/Calibration/SquareWave)
pin is used for calibration. For more information about calibration, refer to
AN402 - F-RAM RTC Oscillator Design Guide.
5.2.1
Setup Example
The following example is a setup procedure that describes the correct sequence for power-up, initialization,
and register settings:
•
Apply V
DD
power.
•
Apply battery to the V
BAK
pin. If a super capacitor is used, the trickle charger may be set (VBC = 1). Optionally
set the FC bit. If a battery is used, make VBC = 0.
•
Set the V
DD
voltage trip point bit, VTP if you prefer a setting higher than the default setting (lowest of the four
settings; 2.6 V).
•
Enable the RTC oscillator (set
OSCEN
̅̅̅̅̅̅̅̅̅
= 0).
•
Enter the RTC calibration mode (CAL = 1).
•
Determine the RTC clock error and sign by monitoring the 512-Hz output (ACS pin). Use a frequency counter.
•
Write the error correction sign to Calibration Sign bit (CALS, register 01h, bit 5) and value to CAL (4:0). Refer
to the Calibration Adjustments table provided in the
•
Exit the RTC calibration mode (CAL = 0).
•
Set the Write bit (W bit) to enable writing the time-day-date values to the RTC.
•
Write the time-day-date values to registers 02h
–
08h.
•
Clear the W bit to start the RTC with the new values.
•
Resume normal operation.
To read the RTC, follow this simple three-step procedure: