Greetings, Julien.
As was mentioned on this list previously, using hwclock would be a
simpler/safer way to set the clock. If you insist on (or need to be) accessing
the hardware of the RTC directly ...
Julien wrote:
> Is there any way that the same data is in all addresses starting at
> 0x11700000 ? Because I'm trying to read hours, minutes, etc... when UIP
> is low, and I obtain the same value for all registers.
[snip]
> Here is what I'm doing on my program :
You left out important parts of your program. How did you declare the
variables you are using to access the bytes from the RTC? You have to remember
that you are accessing external hardware. The variables you declare which
point to locations in the RTC should be declared as 'volatile unsigned char *'
(although the use of 'unsigned' is optional).
You also seem to have missed one important bit of information I provided in a
previous message about the use of the UIP bit. Checking the UIP bit for 0 is
ok if all you want to do is read one byte. If you want to read all RTC values
in one go, you need to hold off reading until you see the UIP bit go from 1 to
0.
If you don't wait for the 1 to 0 transition of UIP you have no way to know how
much time you have to read values before the RTC starts an internal update
cycle.
In the case of writing to the RTC, check page 9 of the PDF file. It states you
need to raise the SET bit in register B before writing to the time/date/alarm
locations. There is also information about the update cycle on page 17 that
has useful information about getting reliable data from the RTC.
--
Cheers!
Kevin.
http://www.ve3syb.ca/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172 |"Same thing we always do, Pinkutus:
| Try to assimilate the world!"
#include <disclaimer/favourite> | -Pinkutus & the Borg
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|