Error happening during manual store in CY14B512I

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Ashbin
Level 1
Level 1
5 questions asked 5 sign-ins Welcome!

nvsram_rtc.PNG

In one of our designs as seen from the attached screesnhot, the VCAP pin was accidently pulled up instead of directly connecting to the ground using the specified capacitor for enabling Auto Store feature. Since the cards are already assembled, removing the trace was not an option. Hence what we have done is that, we have left the VCAP pin of the RTC open as mentioned in the datasheet  and thus autostore is not happening. We are using I2C to issue software store command whenever the card reboots or shuts down. However, as evident, the time thus written is not accurate as the delay between Manual Store command and actual power down of card is non-zero. This non-zero delay will keep on adding during each power down and thus increase the error. Can you suggest some workaround for this?

It will be better if anyone explain the actual procedure to store time and date accurately if autostore has been disabled.

0 Likes
1 Solution
ShivendraSingh
Employee
Employee
25 solutions authored 50 replies posted 10 solutions authored

Hi Ashbin,

Since the VCAP is shorted to VCC, as you mentioned, the AutoStore function will not work. So, you have two methods to execute the nonvolatile Store, either via I2C command or using the HSB pin. 

Some insight on the nvSRAM RTC settings and its functionality-

When you set the new base time and/or date in the user RTC registers, please make sure you execute the SW store command so that the new time/date set is stored into its nonvolatile counterpart. This setting resets the RTC clock counter to 0 as well. RTC clock counter then increments the RTC tick by 32768 counts every second and accumulates over the time until user resets the base time with a new time. The base time + tick count is used internally by the device to calculate the current time and date whenever user queries them. When the device VCC is down, the RTC clock needs to continue running either on battery or super capacitor power, VRTC_BAT in your schematic. When the VCC power returns, the RTC block power switches to the VCC power to save the battery.

Once you set the new RTC time following which execute the nonvolatile STORE command only once, you need not execute the nonvolatile Store before every reboot or shutdown for the RTC function. However, you need the nonvolatile Store before every reboot or shutdown to save any update.change to the main memory array.  

You may observe some lag in time primarily because when you read the RTC register, you set the R bit '1', which freezes the update to the volatile registers. Once you read the RTC register content and clear the R bit, it updates the time to new value. However, this R bit setting only needed to access the RTC register, hence should not take more than few ms with slow I2C access. System power down essentially shouldn't change the RTC accuracy until there is clock error at the input. The inaccurate RTC timing can be either due to crystal accuracy, unmatched crystal load or even the PCB routing/layout for the crystal.

It would be great if you can share the RTC register dump where you observe the time lag and after every power cycle.

You can capture for 2-3 cycles with expected vs read time.

Thanks,

Shivendra

View solution in original post

0 Likes
2 Replies
ShivendraSingh
Employee
Employee
25 solutions authored 50 replies posted 10 solutions authored

Hi Ashbin,

Since the VCAP is shorted to VCC, as you mentioned, the AutoStore function will not work. So, you have two methods to execute the nonvolatile Store, either via I2C command or using the HSB pin. 

Some insight on the nvSRAM RTC settings and its functionality-

When you set the new base time and/or date in the user RTC registers, please make sure you execute the SW store command so that the new time/date set is stored into its nonvolatile counterpart. This setting resets the RTC clock counter to 0 as well. RTC clock counter then increments the RTC tick by 32768 counts every second and accumulates over the time until user resets the base time with a new time. The base time + tick count is used internally by the device to calculate the current time and date whenever user queries them. When the device VCC is down, the RTC clock needs to continue running either on battery or super capacitor power, VRTC_BAT in your schematic. When the VCC power returns, the RTC block power switches to the VCC power to save the battery.

Once you set the new RTC time following which execute the nonvolatile STORE command only once, you need not execute the nonvolatile Store before every reboot or shutdown for the RTC function. However, you need the nonvolatile Store before every reboot or shutdown to save any update.change to the main memory array.  

You may observe some lag in time primarily because when you read the RTC register, you set the R bit '1', which freezes the update to the volatile registers. Once you read the RTC register content and clear the R bit, it updates the time to new value. However, this R bit setting only needed to access the RTC register, hence should not take more than few ms with slow I2C access. System power down essentially shouldn't change the RTC accuracy until there is clock error at the input. The inaccurate RTC timing can be either due to crystal accuracy, unmatched crystal load or even the PCB routing/layout for the crystal.

It would be great if you can share the RTC register dump where you observe the time lag and after every power cycle.

You can capture for 2-3 cycles with expected vs read time.

Thanks,

Shivendra

0 Likes

You can measure the 512 Hz digital output clock on the INT/SQW pin to measure the input clock error instead of probing on the analog pins of the crystal (XIN/XOUT). Please refer to the CAL bit setting and related section in the datasheet to enable the clock on the INT.

You can also refer to the following Application note for further details.

AN53313 - Real Time Clock Calibration in Cypress nvSRAM

https://www.cypress.com/file/40376/download     . 

AN61546 - Nonvolatile Static Random Access Memory (nvSRAM) Real Time Clock (RTC) Design Guidelines and Best Practices

https://www.cypress.com/documentation/application-notes/an61546-nonvolatile-static-random-access-mem...

Thanks,

Shivendra

0 Likes