- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/resource-types/video/entering-sleep-mode-and-wakeup-using-rtc-psoc35
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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/resource-types/video/entering-sleep-mode-and-wakeup-using-rtc-psoc35