RTC in ATmega8. Clock or Counter???

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

ATmega8 has RTC feature.
Is this Real Time Clock OR Real Time Counter.
Can I maintain day-date-time in mega8 without affecting my main code?

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

Do you mean the asynchronous mode of Timer2?

Timer2 can be connected to a quartz running at 32768Hz which is usually used as time base in any clocks.
You can use this timebase to make your own software calendar. But if you remove the power supply the AVR will be reset and therfore
all calendar data, too. You'll need a buffer battery to prevent calendar corruption.

Usually the clock quartz is used to calibrate the internal RC oscillator.
This would enable you to use the USART with baudrates up to 115200 Baud.

Take a look at the Atmel application note "AVR055: Using A 32kHz XTAL For Run-Time Calibration Of The Internal RC"
http://www.atmel.com/dyn/resources/prod_documents/doc8002.pdf

You'll find well explainations about the asynchronous mode of Timer2 in
Atmel application note "AVR130: Setup And Use The AVR Timersf":
http://www.atmel.com/dyn/resources/prod_documents/DOC2505.PDF

Regards
Sebastian

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

Thanks sabastian.
I am developing a POS. Today, me and my client will finalize the controller. Mostly mega325. I thought the RTC inside any AVR is ready-to-use one type of which will replace the DS1307. But it seems, I have to write code, which will affect my main processing work. I feel better use external DS1307 with mega325 or higher.

YB