Hi Is there anyone that can help me write code for a time counter. Is it possible to write code for a AT89c2051 to have a timer stored in a register while haveing some other code running? The timer must look like XX:YY, x=hour, y=minute. Sorry for bad english.
Why does it specifically need to be in a register?
I wrote code for 8051 to save data onto a eeprom but i need to know when was this data written, and have a timer wich starts at 00:00 when the cpu is started i don't need it to be in a register. I just need an example or somethis like this. PS i have other code running too thanks
So what is your difficulty? If you have your time stored as hh:mm, you just increment the mm every minute and the hh every hour (ie, every 60th minute).
the only problem is that i don't know how to make such a thing meaning that i don't know how to make this cpu act like a timer. I am new in this. plese post a example of a timer . Thanks
Sounds like a homework exercise to me! Stefan
"i don't know how to make this cpu act like a timer" No need - it has built-in timers! "I am new in this" Have you done the background reading: http://www.keil.com/forum/docs/thread3387.asp You will also need to read the data sheet for your particular chip "plese post a example of a timer" There are several already in the Downloads area of this very site!
Hi, thank you for youre help. I now have it running and ready to go.