need help on RTC programming ?

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

hello

   

I am trying to work with RTC component of Psoc 4. I already done LED based project  now I want to set alarm for LED using RTC component. but I am getting problem 

   

 

   

 

   

 

   

/* Alarm Date: 29/06/2015 */  D/M/Y    

   

 Alarm Time: 15:44:00 */   (    H/M/S)

   

 

   

I am attaching project workspace  my program is incomplete  tell me atleast five  mistakes so that I can reduce the error

0 Likes
12 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

1) Your global interrupts not enabled

   

2) You need to enable generation for the alarm APIs by ticking the

   

check box -

   

 

   

   

 

   

You need to setup the clock for the RTC -

   

 

   

0 Likes
Anonymous
Not applicable

1. * Enable global interrupts */
    CyGlobalIntEnable;

   

2. alarm APIs

   

   

 

   

 

   

3. how to  setup the clock for the RTC ?

   

when I click on clock component. I show following option  thats different from  your example

   

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

In workspace explorer is yourprojectname.cydwr file, double click that,

   

then pick clocks tab, edit clock at top, LF clocks tab following that.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Start debugging. See if RTC running, then write test code and try it.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I showed the wrong clock config screen, thats for a BLE part.

   

 

   

Basically you set as follows -

   

 

   

   

 

   

Then in WDT ISR you use the RTC_Update(void) function to inc the clock.

   

 

   

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

You could use a uart component and read it on the computer or add an LCD component and read the data there. As you are using an CY8CKIT-049-42xx you can't debug the program unless you have a Miniprog3.  That is the draw back in using the Cy8Ckit -049-4200 boards. You can also add print statements in the program and read that on the Computer using the Uart component.

   

 

   

BobGoar

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The Miniprog3 permits you to debug. Unless you are using

   

a CY8CKIT-042 and that debug is handled by a second processor,

   

a 5LP family part.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Hello

   

I looked at back side of kit  cy8ckit -049-42xx

   

anyway please look my project work space tell me , can  I check RTC component without LCD interacing?   I am setting Alarm for LED. If the LED will on for specific alarm I will sure that I am going on correct way 

   

I tryied but I don't understand why  LED is not turn On for specific Alarm

   

 

   

vead

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Are you trying to light the Led connected pin_red when an alarm occurs?  The PWM_1  is not triggered in the program and You have no code in the program that will trigger an Alarm led.and no way to trigger PWM_1 to light the led.  I made a clock program last night for the PSOC 4M and it worked fine. The alarm led came on when the alarm time was reached and lasted for one minute The program also lights a Led each second to tell you it was running. . The program displayed the clock on the Putty terminal on my computer and it seemed to work very well.  The PSOC family is great but it takes a lot of though and engineering to get a program to work.  You don't have an easy way to debug your program as you are using the PSoc4 4200 kit it makes it hard to troubleshoot your program.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Go to this page, video.cypress.com/video-library/video/PSoC. choose PSOC 4, there are

   

two videos on blinking an LED.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

hello

   

I looked that link. this show the message  '' The video you are trying to watch is currently  unavailable please check back soon

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I just tried both videos right now, both showing correctly.

   

 

   

Bob

0 Likes