Hi,
I'm a newbie into embedded programming. The project i'm working on is based on an Atmel avr atmega128 device (with a GSM device connected to it). The environment used is IAR EW with AVRStudio.
Using the time.h library, i try to get the actual time with the following code :
--------------------------------------------------- time_t now; time(&now); printf("Time is %s\r\n", ctime(&now));
---------------------------------------------------
The only result I get is Wed Dec 31 23:59:59 1969. This means 1 seconds before 1970. Even after ten minutes, the command shows the same time...
I found an implementation of the time(...) command on the net where the show how it was computed. In this code, when there was no RTC, the result I get is coherent ... but there is an RTC on the hardware I use. I even have an AT command giving me the RTC time since last boot...
Does someone have an idea on how to solve this problem ?
Didrik