PPS from RTC component

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

cross mob
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

Hello,

   

I am working on a GPS clock using CY8CKIT-059. I have decided to use RTC block because of its DST support. I see in auto-generated code that it has a precious pulse-per-second ISR for internal purposes. Is there any way to get this PPS signal, to execute some code every second? 

   

One easy solution would be to place clock display update to main function - to uninterrupted code, but I would like to keep this for better purposes than updating display many times per second. It would be statically driven nixie tubes. Also I don't want to put sleep just to lower update rate.

   

Thanks for reply,

   

Stanislav

0 Likes
3 Replies
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

Also, when I log out, my question disappears. Is this normal forum behavior, or some kind of a bug?

0 Likes
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

On page#20 of RTC v2_0 datasheet ,it is mentioned about specific function which would be called at appropriate intervals based on the setting configured with RTC_WriteIntervalMask() function:

   

 Every Second handler – RTC_EverySecondHandler()

   

Stub routines for these functions are provided in which you can add your own code. The routine stubs are generated in the RTC_INT.c file the first time the project is built. Your code must be added between the provided comment tags as follows:

   


static void RTC_EverySecondHandler( void )
{
/* Place your every second handler code here. */
/* `#START EVERY_SECOND_HANDLER_CODE` */
/* `#END` */
}

   

The interval mask register is a write-only register that allows you to control handling of interrupt stubs of the RTC component.When writing the interval mask register, you must use the bit-field definitions as defined in the header (.h) file. The definitions for the interval mask register are as follows:

   

RTC_INTERVAL_SEC_MASK – The second interval mask allows handling an interrupt stub every second.

0 Likes
user_1570836
Level 4
Level 4
50 replies posted 25 replies posted 25 sign-ins

Thank you for reply. I had not already tested this on device, but inside IDE this works well - my code is preserved, when I change design.

0 Likes