tutorial on RTC

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hi all, is there a tutorial on this forum for a real time clock on Atmega16? i tried to search but couldnt find it.. thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

npat_avr wrote:
hi all, is there a tutorial on this forum for a real time clock on Atmega16? i tried to search but couldnt find it.. thanks

I understand not the need of such a tutorial.

Simple connect a crystal and establish a timer interrupt to get one second ticks, thats all.

On mains powered designs a standard crystal e.g. 11.0592MHz can do the job.
On battery powered designs a second crystal of 32.768kHz may save some power.

Maybe, you should look on the timer tutorial.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i did. i already got the timer working but how do i get it to display the time on an LCD? i am trying to work on a project with an LCD and want to see the time on it.do i have to use the EEPROM/SRAM inside the AVR?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are at least two typical ways:

1. count seconds (0..59), minutes (0..59), hours (0..23) in separate variables (unsigned char).

2. count seconds as 32 bit variable (unsigned long) and convert it to time/date.

you should found examples on the web for both.

Displaying variables was another task.
E.g. "printf" or "itoa" can be used to do so.

Peter