Pradeep Kotipalli
/
testing_rtc
hi rtc
Fork of testing_rtc by
Revision 2:c38929a198a7, committed 2014-12-21
- Comitter:
- pradeepvk2208
- Date:
- Sun Dec 21 09:56:03 2014 +0000
- Parent:
- 1:620887c20cee
- Commit message:
- ds3234 test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
rtc_tst.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 20 10:30:39 2014 +0000 +++ b/main.cpp Sun Dec 21 09:56:03 2014 +0000 @@ -10,6 +10,7 @@ while(1) { Getts(); + wait(5); } @@ -90,6 +91,6 @@ return 0; */ - + return 0; } \ No newline at end of file
--- a/rtc_tst.cpp Sat Dec 20 10:30:39 2014 +0000 +++ b/rtc_tst.cpp Sun Dec 21 09:56:03 2014 +0000 @@ -26,19 +26,19 @@ //cs=0; spi.write(0x82); - spi.write(0x15); //write reg to hours (00-23) + spi.write(0x00); //write reg to hours (00-23) spi.write(0x83); - spi.write(0x07); //write reg to day (1-7) + spi.write(0x00); //write reg to day (1-7) spi.write(0x84); - spi.write(0x20); //write reg to date(01-31) + spi.write(0x00); //write reg to date(01-31) spi.write(0x85); - spi.write(0x12); //write reg to mnth(01-12) + spi.write(0x00); //write reg to mnth(01-12) spi.write(0x86); - spi.write(0x12); //write reg to year(00-99) + spi.write(0x00); //write reg to year(00-99) cs=1; // Receive the contents of the seconds register @@ -109,7 +109,7 @@ char mi[3]=getstr(minutes); char s[3]=getstr(seconds);*/ char time[15]; - sprintf(time,"%d%d%d%d%d%d%d",year1,month1,date1,day1,hours1,minutes1,seconds1); + sprintf(time,"%2d%2d%2d%2d%2d%2d%2d",year1,month1,date1,day1,hours1,minutes1,seconds1); return(time); }