|
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.
|