using RTC in PSoC3

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

cross mob
ShBa_282106
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

Hi!

   

Need to update display of an LCD through per second interrupt stub of an RTC. KIndly help me with a small example project using RTC. Am unable to understand example given in the documentation.

   

thnx in advance.

   

Neha

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

Neha, I have to admit that RTC is not an easy small usermodule. Partly that is because it contains a (nearly) complete calendar which is able to calculate the weekday for any given date, an alarm-clock and so on. The RTC may be programmed to generate an interrupt at every second, but that's like building a telescope for just watching birds.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Neha,

   

from what I understood,you need to update the LCD every second,right? Is this content some time related info?

   

If not,you could have a timer generating an interrupt every one second,and the interrupt thus generated update the LCD.

0 Likes
Anonymous
Not applicable

I'd recommend keeping as much code as possible out of the interrupt to improve system responsiveness. To do this, you could set a flag variable in the RTC once per second interrupt, and check for it in your main loop. When it's set in the main loop, update the LCD, and clear the flag.

   

Cheers!

   

-Max

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

It will not be THAT thing for an interrupt occuring every second, but generally it is more universal to increase a counter and use that to update a corresponding value and then resetting the counter. So you get the chance to count for lost interrupt-polls which may occur during heavy CPU-load

   

 

   

Bob

0 Likes