Hi everyone,
First of all I want to apologize for my bad english second I hope I posted this were it's supposed to (yes I am new).
I barely started to program some Atmega8, making some progress, still afraid to mess around with fuse bits.
I scrached the surface of what timers can do, and I came up with this: clock with timer0.
The code is in the attachments, didn't wanted to make a very long post. It actually works. Sort of. Now you can stop laugh.
Problem is that is off by about 2 minutes every hour. I am using the internal RC oscillator at 1Mhz and Atmel Studio 6.
I would like to know, is something about the code that sets it off, or the internal oscillator is way too off, because my next ideea is to use a cheap chinese clock on T0 on rising edge to make it tick. If the code is OK not causing the delay then using an "external clock source (literally)" should give me the precision of the cheap clock I use for this purpose.
Thank you,
Alex