Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > Memory > Setting RTC in CY14B101P-SFXI

Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Setting RTC in CY14B101P-SFXI
Moderator:
AJAI

Post Reply
Follow this topic



Setting RTC in CY14B101P-SFXI

jvalenzuela posted on 08 Jun 2011 9:33 PM PST

1 Forum Post

I having some trouble setting the real time clock with this particular NVRAM device. The exact sequence of events is as follows:

1. WREN

2. Write 0x02 to RTC register 0x00.

3. WREN

4. Write 7 bytes to RTC registers 0x09-0x0f.

5. WREN

6. Write 1 byte to RTC register 0x01.

7. WREN

8. Write 0x00 to RTC register 0x00.

 

Each of the above steps is standalone SPI transaction; the CS is pulled low for each and returns high before the next step. All values are legal BCD according to the data sheet. However, reading the RTC registers yields incorrect data and several bytes with values outside valid BCD values, which seems to mean that incorrect BCD data was loaded to begin with.




Re: Setting RTC in CY14B101P-SFXI

zsk posted on 10 Jun 2011 10:15 PM PST
Cypress Employee
19 Forum Posts

Hi,

I am an Applications Engineer from Cypress Semiconductor and would like to assist you in resolving RTC issue.

Sequence of writing into RTC registers are correct. Please verify the following in your system

 1. Reading of nvSRAM RTC registers  are limited upto 25MHz SPI speed. Write can be done upto 40 MHz. Please ensure that you are reading at 25MHz or below SPI Speed. Reading at higher SPI speed than 25 MHz may result in reading incorrect (garbage) data.

2.  Read and verify whether 0x02 is correctly set into RTC register 0x00 ( Step 2 in your sequence).

3. Please read out all 16 RTC registers for  5 seconds. This is to ensure that seconds register is updating correctly if RTC crystal is running.

Thanks,

Shivendra



Writing SRAM in CY14B101P-SFXI

asdfjkl; posted on 10 Sep 2011 01:26 AM PST
Member
2 Forum Posts

Hi,

I am new to Cypress Products.In my project i am using CY8C3246AXI-138,CY14B101p-SFXI.i want to read and write the SRAM.I tried to write by the steps followed.

CS_LOW

1.WREN

CS_HIGH

CS_LOW

2.WRITE Cmd

3.Address

CS_HIGH

CS_LOW

4.data bytes

CS_LOW

I am providing the Hardware and software that we made.Once check and give some suggesions for quick progress in our project.

 

Thank You.



Re: Setting RTC in CY14B101P-SFXI

zsk posted on 12 Sep 2011 11:14 PM PST
Cypress Employee
19 Forum Posts

Hi Sattipandu,

I reviewed your code sequence and found that there are two steps which you need to include for working with RTC.

1.       It is must to set the ‘w’ bit in the flag register before initiating a write to RTC register

2.       You must send the complete write command which include RTC write opcode, address, data with CS low. You have toggled CS between your steps 3 and 4.

Please follow the below steps and modify your code accordingly.

Step1:  Set the “WEN” bit in the status register. (You can read the status register and verify the "WEN" bit status- It must be set to “1” before going for further steps of writing)

  

     CS_LOW

         WREN =0x06

      CS_HIGH

 

Step 2: Set the "w" bit (Bit 2) in the RTC flag register (0x00) before initiating write into any RTC register (You can read the flag register and verify the "w" bit status- It must be set to “1”)

 

     CS_LOW

        WRITE Cmd =0x12

        Address = 0x00

        data bytes = 0x02

     CS_HIGH

 

Step 3: Once step 1 and step 2 are successful, the following Step 3 should be used to write a new value in the RTC time keeping registers.

 

 

     CS_LOW

        WRITE Cmd =0x12

        Address = as desired

        data bytes = as desired data byte/bytes (in bulk write mode)

     CS_HIGH

 Once you complete RTC register/s write cycle , you can read back and confirm whether the data written is updated correctly or not? Please note that after a successful RTC register write, you should clear the ‘w’ bit so that the RTC registers (second, minutes, hrs….) starts getting updated automatically. 

Please let me know if you have any further clarification.

Shivendra Singh

Cypress Semiconductor



Re: Setting RTC in CY14B101P-SFXI

asdfjkl; posted on 27 Oct 2011 02:59 AM PST
Member
2 Forum Posts

Hi,

I have succefully Completed the RTC Reading & Writing.But Now i am facing a new problem,that is my program is able to read and write RTC and Updating the time correctly in one PCB and not in other PCB.so i cross checked the Hard ware connections and also verified my program.but there is not mistake i found.So please suggest what could be the problem.



stalRe: Setting RTC in CY14B101P-SFXI

zsk posted on 31 Oct 2011 05:11 AM PST
Cypress Employee
19 Forum Posts

Hi,

RTC not updating time correcty migh be due to one of the following probable reasons.

1. C1 and C2 load capacitance are not matching with datasheet recommended values.

2. Crystal load spec is different than recommended 12.5 pF load.

3. You can measure the crystal clock output on either Xin or Xout pin using a CRO. It should measure ~32768 Hz sinusoidal wave output signal. (Please note that standard passive CRO probes loads the circuit which will impact on crystal oscillation due to additional load.Therefore, you should either use an active probe or may set the passive probe in 10x attenuation mode for better a better output result)

4. If you are unable to measure Xin/Xout directly on any of the crystal pin then you can probe on INT pin output after enabling "CAL" bit in the RTC flag register (bit 3 in Reg 0x00). It should measure 512 Hz square wave output on INT pin. Any standard CRO proble should be able to mesure digital output on INT pin.

5. In case if you are still unable to measure clock output in step 3 or step 4 then it resembles that crystal is not oscillating. This can happen either due to:

                a .Crystal oscillation bit is disabled in RTC register. OSCEN (active low) bit should be to "0" to enable the crystal oscillation.

                b. If step "5.a" is followed correctly and ok then most likely it is an issue with the crystal component and try to change the crystal and repeat step 3 or 4 to confirm.                

 If above debug methods didn't help you then try reading all 16 RTC address locations and send dump file to me for analysis. Please send atleast two readings taken at 10 seconds interval.

Thanks,

Shivendra

 

 

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 06/15/20