Is SQW (square wave output) derived from CAL register 0x08 and calibration circuitry?
In the document “AN53313 Real Time Clock Calibration in Cypress nvSRAM” (Author: Shivendra Singh) the Figure 2. “Oscillator Divider Circuit” I see the output named as “1 Hz signal calibrated over a 64 min cycle”. How can I get that calibrated 1Hz output?
The square wave output and 512 HZ calibration output on INT is derived from the RTC crystal output. Hence it would give an indication of ppm error but won't show the calibrated output. Calibration is applied directly on the RTC time registers. You should see the difference in time (few seconds) if run for a day with 0x1F and 0x3F CAL settings.
It is a pity that it is impossible to get INT signal when changing second in RTC.
In the Linux operating system and in the utility of hwclock many efforts to coordinate a read and write in RTC by the time of change of second become (for increase in accuracy). For example, reading time from RTC in a cycle becomes so far second won't change. Or other tricks and waiting of the estimated moment of change is performed.
INT signal on change of seconds is required to many programs working with RTC.
At the same time there is a redundancy in CY14B101PA. I mean bit of the M (D7) in “Alarm seconds” the register 0x02. Documentation says:
“There are four alarm match fields: date, hours, minutes, and
seconds. Each of these fields has a match bit that is used to
determine if the field is used in the alarm match logic. Setting the
match bit to ‘0’ indicates that the corresponding field is used in
the match process. Depending on the match bits, the alarm
occurs as specifically as once a month or as frequently as once
every minute. Selecting none of the match bits (all 1s) indicates
that no match is required and therefore, alarm is disabled.
Selecting all match bits (all 0s) causes an exact time and date
There is other way to set alarm is disabled. It is the bit AIE (D6) in the "Interrupts register" 0x06. The best application of state “Selecting none of the match bits (all 1s)” is to give the calibrated signal of 1 Hz at everyone to change of the RTC seconds.
It's a very good feedback. We will definitely consider for future products.
I cold write a Linux driver and test for said future product.
1. There is microprocessors which can get Pulse Per Second signals from GPS receiver or other external source.
But CY14B101PA 1 Hz is used to keep synchronous wall clock time in _all processors for not expensive computer systems.
2. Linux uses software factor for time correction. Using hardware CAL register releases CPU from that work. And it is more exact method because it does not depend on non-deterministic interrupts latency.