![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
cs for writing
Fork of rtc_justtest by
Diff: main.cpp
- Revision:
- 1:21efeeb9b679
- Parent:
- 0:a07e5a4c94bb
diff -r a07e5a4c94bb -r 21efeeb9b679 main.cpp --- a/main.cpp Sat Dec 20 12:17:15 2014 +0000 +++ b/main.cpp Sun Dec 21 09:06:20 2014 +0000 @@ -12,32 +12,44 @@ // Setup the spi for 8 bit data, high steady state clock, // second edge capture, with a 1MHz clock rate spi.format(8,3); - spi.frequency(1000000); + spi.frequency(3000000); cs = 0; spi.write(0x80); // set write register to seconds spi.write(0x01); // send value of zero - //cs=1; - //cs=0; + cs=1; + cs=0; spi.write(0x81); spi.write(0x58); //write reg to minutes - //cs=1; - //cs=0; + cs=1; + cs=0; spi.write(0x82); spi.write(0x01); //write reg to hours (00-23) + cs=1; + cs=0; + spi.write(0x83); spi.write(0x01); //write reg to day (1-7) + cs=1; + cs=0; + spi.write(0x84); spi.write(0x01); //write reg to date(01-31) + cs=1; + cs=0; + spi.write(0x85); spi.write(0x01); //write reg to mnth(01-12) + cs=1; + cs=0; + spi.write(0x86); spi.write(0x01); //write reg to year(00-99)