- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am sure I am missing something here.
Could someone explain to me why the following code does not work? It works when I replace the sleep part with an one second delay.
#include <project.h>
int main()
{
CyGlobalIntEnable; /* Enable global interrupts. */
//enable the 1 second interval for RTC interrupt
RTC_WriteIntervalMask(RTC_INTERVAL_SEC_MASK);
//start the RTC
RTC_Start();
RTC_EnableInt();
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
LED1_Write(0);
for(;;)
{
LED1_Write(~LED1_Read());
CyPmSaveClocks();
RTC_DisableInt();
CyPmSleep(PM_SLEEP_TIME_NONE,PM_SLEEP_SRC_ONE_PPS);
CyPmRestoreClocks();
RTC_EnableInt();
}
}
Thank you!
George
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I attached the project. Maybe it's something electrical, since I have a separate source for the LED, controlled through another PSoC output. However, it does not work. Anyway, it was solved by the external RTC, which, I thing, is a better solution.
Thank you for your time!
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Post your project so forum can see all settings -
“File” Creator
“Create Workspace Bundle”
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dana,
I am sorry, but I don't have the project any more, since I changed to an external RTC with a 1Hz IRQ signal. However, I had the 32kHz clock activated and a RTC component instantiated. The project compiled without giving any error.
Thanks,
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Only thing I can see is there should be some delay after power up before you put device into sleep. CyDelay(100) before main loop might help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I attached the project. Maybe it's something electrical, since I have a separate source for the LED, controlled through another PSoC output. However, it does not work. Anyway, it was solved by the external RTC, which, I thing, is a better solution.
Thank you for your time!
George
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
THE RTC COMPONENT WAKES UP THE PSoC FROM SLEEP ONLY WITH EXTERNAL 32kHz CRYSTAL.
Sorry for the trouble!