RTC Marco callbacks

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

cross mob
Anonymous
Not applicable

Hi,

   

I got a problem about RTC marco callbacks.

   

When I read the parameters of RTC ,it was working.But I want RTC do something every second.So I fininshed some code according to CAG 6.1.6

   

code of user code is listed below

   

TaskHandle_t rtc_task_handle;

   

void RTC_6813_EverySecondHandler_Callback(void)
{
    if(rtc_task_handle!=NULL)
    {
        vTaskResume(rtc_task_handle);  
    };
}

   

void rtc_test_task(void *pvparameter)
{
    uint8_t data;
    
    for(;;)
    {
        
        vTaskSuspend(xTaskGetCurrentTaskHandle());
        data=RTC_6813_ReadSecond();
        uart_485_send_block(&data,1);
    };
}

   

code of cyapicallbacks.h is listed below

   

#ifndef CYAPICALLBACKS_H
#define CYAPICALLBACKS_H
    
    /*Define your macro callbacks here */
    /*For more information, refer to the Macro Callbacks topic in the PSoC Creator Help.*/
    
#define RTC_6813_EVERY_SECOND_HANDLER_CALLBACK
    
void RTC_6813_EverySecondHandler_Callback(void);
    
#endif /* CYAPICALLBACKS_H */  

   

code of startup is listed below

   

    RTC_6813_Start();
    RTC_6813_EnableInt();
    xTaskCreate(rtc_test_task,"rtctest",configMINIMAL_STACK_SIZE,NULL,1,&rtc_task_handle);

   

Other tasks of system are fine.The callback function of RTC was not invoked!

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

From the datasheet (component) -

   

 

   

General Description

   

The Real-Time Clock (RTC) component provides accurate time and date information for the
system. The time and date are updated every second based on a one pulse per second interrupt
from a 32.768-kHz crystal. Clock accuracy is based on the crystal provided and is typically
20 ppm.

   

 

   

Here is a series of projects with wakeup that you can look at -

   

http://www.cypress.com/forum/psoc-3-known-problems-and-solutions/psoc-wake-sleep-and-executing-inter...

   

http://www.cypress.com/forum/psoc-3-known-problems-and-solutions/psoc-3-sleep-mode-projects-various-...

   

 

   

http://www.cypress.com/resource-types/video/entering-sleep-mode-and-wakeup-using-rtc-psoc35

   

 

   

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CEMQFjAFahUKEwihz5OL2vjHAhXL0YA...

   

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CDwQFjAEahUKEwihz5OL2vjHAhXL0YA...

View solution in original post

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

From the datasheet (component) -

   

 

   

General Description

   

The Real-Time Clock (RTC) component provides accurate time and date information for the
system. The time and date are updated every second based on a one pulse per second interrupt
from a 32.768-kHz crystal. Clock accuracy is based on the crystal provided and is typically
20 ppm.

   

 

   

Here is a series of projects with wakeup that you can look at -

   

http://www.cypress.com/forum/psoc-3-known-problems-and-solutions/psoc-wake-sleep-and-executing-inter...

   

http://www.cypress.com/forum/psoc-3-known-problems-and-solutions/psoc-3-sleep-mode-projects-various-...

   

 

   

http://www.cypress.com/resource-types/video/entering-sleep-mode-and-wakeup-using-rtc-psoc35

   

 

   

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CEMQFjAFahUKEwihz5OL2vjHAhXL0YA...

   

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=5&ved=0CDwQFjAEahUKEwihz5OL2vjHAhXL0YA...

0 Likes