Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > RTC Clock Input

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



RTC Clock Input
Moderator:
ANCY

Post Reply
Follow this topic



RTC Clock Input

Doug McClean posted on 09 May 2011 1:32 PM PST
Top Contributor
38 Forum Posts

Hello,

The datasheet for the RTC component says that it's based on a 1 PPS interrupt from a 32.768 kHz crystal.

It would be really nice for me (and probably others) if it was possible to configure it to be based on a different signal. I'd like to run the local RTC on the PSoC chip based on the 1 PPS output signal from my GPS module. That way I would only have one clock and wouldn't need to access the GPS RTC over the UART.

It seems like it might not be a huge change, because all the logic of responding to that interrupt would remain the same, but I might be wrong about that.

This isn't possible, right?




Re: RTC Clock Input

Gautam Das posted on 11 May 2011 11:44 AM PST
Cypress Employee
742 Forum Posts

Hi Doug Mclean,

 

Are you getting a 1Hz pulse from GPS module? If so, then there is one way you can use RTC.

I haven't tried this method yet, but it may be implemented in the following way.

1) Use a PICU interrupt and set it to Rising edge. This pin will be connected to the 1Hz signal from the GPS module.

2) The CY_ISR(RTC_ISR) which is available in the RTC_INT.c file (assuming the name of the RTC component used is 'RTC') is placed in the executable part of the ISR of the PICU.

3) There is no need of using an RTC component in this project as only PICU will take care of the all the parameters.

4) The RTC component available in PSoC Creator is a software implementation which uses 1pps clock from the 32.768KHz crystal. Hence, this can be implemented in software.



Re: RTC Clock Input

Doug McClean posted on 13 May 2011 05:06 AM PST
Top Contributor
38 Forum Posts

Wow, that is absolutely perfect, thank you very much.



Re: RTC Clock Input

Doug McClean posted on 13 May 2011 10:12 AM PST
Top Contributor
38 Forum Posts

Except that I do need to have an RTC component so that the RTC code will be generated, right?

Will anything go wrong if I add the component, copy the code into a different place, remove the component and call the copy?



Re: RTC Clock Input

Gautam Das posted on 17 May 2011 04:09 AM PST
Cypress Employee
742 Forum Posts

Hey Doug,

 

Are you using the Alarm feature available in the RTC component?

 



Re: RTC Clock Input

Gautam Das posted on 17 May 2011 11:59 AM PST
Cypress Employee
742 Forum Posts

Hi Doug McClean,

 

There is another rather simple way to do this.

1) You can place an RTC Component and configure it in accordance with your requirement.

2) Now place a digital input pin and connect it to an Interrupt Component. This Pin must be connected to the 1 Hz Pulse from GPS.

3) In the main( ) function, initialize all the parameters of RTC such as sec, min, hour, date, etc But donot start the RTC Component.

4) In the CY_ISR of Interrupt, call the RTC_ISR( ) function which is found in the RTC_INT.c file.

 

Now the project will perform all the functions of the RTC except for the fact that the interrupt source is not the PPS from external 32.768KHz but is from an external 1Hz clock (which in this case is received from the GPS module).

This method is better than the previous method suggested as there is no possibility of encountering any error which may arise due to incorrect copying of the APIs and header files of the RTC component to the Pin Interrupt's ISR file.

 

A sample project was constructed and for testing purpose a 1Hz clock was brought out from a pin. The digital input pin and the clock output pins were externally connected using a wire.

The schematic is as shown below.

 

 

 

 

In the isr_1.c, the RTC_ISR( ) is called. This is shown in the snap-shot given below:

 

 

 

The project has been attached along with this post.



Re: RTC Clock Input

Doug McClean posted on 18 May 2011 08:19 AM PST
Top Contributor
38 Forum Posts

Aha!

Thanks again.






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: 01/01/20