Real Time Clock
Discovery
Posts: 606
I use a Dallas Semiconductor DS1302 real time clock with BS2 series controllers. I would like to migrate the software and the clock to a Propeller.
Can that be accomplished? If so, how?
Sincerely,
Discovery
Can that be accomplished? If so, how?
Sincerely,
Discovery
Comments
Try looking through this code from the OBEX. DS1302 full
-Tommy
Discovery
Discovery
ds1337
Any of the DS13xx chips will work. Some have more pins than others of course and different features.
I've used this one: http://www.mouser.com/ProductDetail/Maxim-Integrated/DS1338Z-33+/?qs=0Y9aZN%252bMVCVblIXsYVg1wg==
Below is code that will integrate into the standard C time functions in PropellerGCC.
The GbI2C_rtc_getReg() and GbI2C_rtc_writeReg() functions to access the RTC hardware are left as an exercise for the user.
I cannot get this code to compile...should it as supplied?
Discovery
No. It is a snippet. I've given instructions on what needs to be done.
Never bother with SPI RTCs, there's no point unless it's price sensitive in volume. The I2C versions connect straight to P28,P29 I2C pins so you don't waste any I/O. At present I am using MCP79410 as RTCs as the 411/412 are also available with unique MAC addresses. The chip also includes a timing correction register. Other than that they also include EEPROM which is good for configuration data and some RAM as well. Even in one off they are only a buck a piece or double that from Element14.
I am sure that your comment was well intended; however, I am struggling to get C programs to work using the IDE. The only method that I found that works is to obtain a C program from forum personnel that works then I make changes until the program does what I want it to do. For me to write C programs from the definitions of functions just isn't happening.
Sincerely,
Discovery
Do you have code that works with the MCP79410 RTC that you would send to me? In the mean time I will checkout the RTC at Element14.
Thanks,
Discovery