- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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