Attached is a demo of the DS3202 done in SimpleIDE. It runs the clock in its own cog. It does not include code to decode the day and month; I figure that is pretty much the same for any of the clock chips. It also does not include code to solicit the time, date, etc to set the clock for the same reason.
I have a question for somebody that understands "C". I would liked to have put the closing bracket for the void ds3202Clock method below the two methods that read or write a register, but the compiler wouldn't allow it: something about the read/write methods definitions. If someone could explain that and tell me how to fix it (or alternately pat my head and say don't worry), I would be forever grateful.
tc
Don't know why I claimed the previous post was for DS3202; senior moment, I guess. Attached is the DS1302 ZIP file. I changed all the references from 3202 to 1302. tc
Comments
You did not specify the Microprocessor that you need code for. BS1, BS2, Propeller?
If you go to the upper right "Search" box and type in DS1302, you will find quite a lot of information and code.
Stop back if you can't find the specific information you need.
Here is something:
https://code.google.com/p/propgcc/issues/attachmentText?id=28&aid=280000006&name=c_sample.c&token=uxAlcWq_g4grqyz7XmoNPHMQk9o:1329328564639
And an earlier version of ICC:
http://forums.parallax.com/discussion/111670/iccprop-imagecraft-c-library-for-maxim-ds1302-real-time-clock
DISCLOSURE:I don't do C at all, so it may not be of any use.
Turnaround time will be longer for that one. It's on my list now...
I have a question for somebody that understands "C". I would liked to have put the closing bracket for the void ds3202Clock method below the two methods that read or write a register, but the compiler wouldn't allow it: something about the read/write methods definitions. If someone could explain that and tell me how to fix it (or alternately pat my head and say don't worry), I would be forever grateful.
tc