Hi there,
Just a quick question, does anyone have any experience using C to program the real time clock ship DS1337 (or one like it).
I am trying to figure out where to start with this, so any advice etc would be great.
Thanks
Sean
Hi there,
Just a quick question, does anyone have any experience using C to program the real time clock ship DS1337 (or one like it).
I am trying to figure out where to start with this, so any advice etc would be great.
Thanks
Sean
So, what have you already got?
It's an I2C device, so you will need SOME way to do I2C communication from your code.
The datasheet for the part can be found here:
QuickView - DS1337, DS1337C I²C Serial Real-Time Clock
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Hi, and thanks for the link (and reply).
I have the data sheet, and an understanting (roughly) of what is going on with the RTC. I know that its a TWI, master/slave setup etc, but its the actual coding that I am not sure about. I just don't know where to start.
I have checked online for example code etc, on places like avrfreaks.net, but there isn't a lot of information.
Thanks
Sean
It took me about 10 seconds to find this:
Interfacing I²C Serial Real-Time Clocks to a Microcontroller - Maxim
which appears to have something that resembles C code in it - I think it's your task to determine if it's useful or not.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Thanks for the link, it seems like it could be helpful.
Also, maybe it took you 10 seconds to find that because you are (I assume) vastly more experienced at this stuff that I am, and therefore you are more aware of where to look, and what you are look for.
However, like I said, thats very much for your help.
Sean
I tried to beat matsp's time (and failed: ~15 secs), here's what I did:Also, maybe it took you 10 seconds to find that because you are (I assume) vastly more experienced at this stuff that I am, and therefore you are more aware of where to look, and what you are look for.
- searched Google for "real time clock ship DS1337", which is a verbatim quote from your initial post
- clicked on the first hit
- used the site's search to find "ds1337"
- clicked on the eighth hit
- tadaa
I'm sure you could have come up with this technique, too. :P
Greets,
Philip
All things begin as source code.
Source code begins with an empty file.
-- Tao Te Chip
Well, you live and you learn don't you?
Thanks
Sean
Ok, so I did cheat a tiny bit: I started with the page I'd already posted, which has a link to the application notes, one of which is "connect this chip to microcontroller", and I just clicked through those two links and checked that the app-note was not a "here's the pins, you connect them to these pins on your microcontroller, we'll leave it to you to figure out how to write to code" application note.
It would take a little bit longer if I'd started from scratch with just the part number. But google is USUALLY good at finding info on modern (still in production) parts from the part number alone.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I did use Google, and got links to people personal sites etc where they had posted up projects and that sort of stuff, nothing that really gave an explanation of what was going on, more like 'if you want to do this, here is the code for it' ....treating the code like a black box.
I have never really had to go looking for app notes before, in college, they usually give us all the info we need, so that has its down sides.
But now that I know the craic, I can look for them first off
Thanks
Sean