DS-1307 Real Time Clock

Dippy

Moderator
The big boys would probably have customised chips.
Maybe some would have age and temp compensation?

You'd have to ask them for a proper definitive answer.

Did you find a supplier for Ds3232?
I had to get mine as samples from Dallas-Maxim and then was told there was a 6 month lead time.
 

axeman22

Member
Did you find a supplier for Ds3232?
I had to get mine as samples from Dallas-Maxim and then was told there was a 6 month lead time.
yeah I bought a few DS3232's a while back, from Farnell components in Sydney, AU $13AUD per chip - free delivery to Melbourne.

Had I cottoned on to the DS3231 and appreciated the likeness I would have just grabbed some of eBay I reckon, they seem plentiful enough. I was imporessed with the Farnell setup on the DS3232's though, easy to order. My biggest greif on the DS3232 has been the SOIC packaging.. but as I said earlier, those converters which I bought in from the US are really good.
 

Dippy

Moderator
DS3232 don't seem to be the easiest things to get hold of.
None in Farnell UK.
Newark (Farnell's in USA) have 2 month lead-time.
Digi-Key none/non-stock.
Mouser nothing.
I surrender :eek:.
 

SAborn

Senior Member
Hi Dippy,

Try Farnell Australia as they are showing 40 in stock.
I see there is a serial version as well.

I would have thought a bloke like you would have a back door to most suppliers.
 

TAMeyer

Member
SRAM / On Board Memory

What is the attraction of the on board memory for the 3232? That is to ask, what are some uses for memory like this?


I picked up a 3231 pre-soldered on a small board from MaceTech.
http://macetech.com/store/index.php?main_page=product_info&cPath=5&products_id=8

Pricey perhaps, but less expensive for me in the long run. This solved the major time swings noted in http://www.picaxeforum.co.uk/showthread.php?t=15491

Of note is the graph plotting accuracy
http://www.maxim-ic.com/products/timers/DS3231_demo/

The 3231/32 seem to increase their accuracy when inside a “normal” temp range, while the 1307 has better accuracy at each edge of the bell curve.

Thanks

Terry
 

SAborn

Senior Member
You should all realise a watch crystal is designed to work in a watch, and a watch is normally strapped to your wrist, and your body temperture keeps the crystal at a constant temperture of around 38-40C.

So if you have a watch crystal in a location that the temperture is greatly different than this, than some errors will result.

For many years crystal ovens were used to maintain constant tempertures for crystals in delicate circuits so the thermal problems did not enter the situation.

For watch crystals the human body created the crystal oven.

Its not a fault in the DS1307, it is a problem caused by low quality crystals and / or where the crystal is located on the board and the track lengths used.

Before you blame the DS1307, check your circuit layout and the location the circuit is placed in.

The DS1307 works very well and is only let down by the crystal used and how the crystal is used.
You might say it is not idiot proof.
 

axeman22

Member
DS3232 don't seem to be the easiest things to get hold of.
None in Farnell UK.
Newark (Farnell's in USA) have 2 month lead-time.
Digi-Key none/non-stock.
Mouser nothing.
I surrender :eek:.
Dippy - if you send me your postal address I'll send you one :)


It seems that all things considered the DS3231 is the go.. the 3232 has SRAM but I don't really see much need so 3231 is the go. the 3231, 3232 and 3234 seem functionally identical from a base RTC and accuracy perspective. I used the online calculator for accuracy and note that I can expect my DS3232 to be off by MAX 1min over a year, I reckon that's pretty damn good I guess if you wanted SUPER accurate you would use a DS323(1,2) and also a cheap GPS module which you could poll periodically to get the accuracy of an Atomic clock - now that's hard core.

GPS chipsets are cheap these days.. anyone come accross a circuit and code setup like this..?

On another note I have decided to Abandon my search for a RTC as good as the DS323x in DIP package - after all, why would a chip manufacturer bother with DIP when anyone is practically going to want SOIC or smaller in practice. For me, I'm going to stick with the DS323x and just use converter boards :)
 
Last edited:

westaust55

Moderator
haven't been able to find any adapters as nice as these(attached) locally here in AU :-( everyone has the ugly boards where you have to add you own pins etc and it ends up quite wide.
Are you going to disclose the sorce of the "neat" SOIC adapters you are using? :confused:
 

axeman22

Member
Are you going to disclose the sorce of the "neat" SOIC adapters you are using? :confused:
hmm.. yep, I have mentioned these before :)

ok - without promoting my blog too much can I say that I have taken quite some time and effort to share this info, and the detail on there..

I have two posts on there;

but this is a direct link to the product in question. They're great..! I just rang both of the two listed Australian disty's for the Manufacturer Aries - and suprise suprise, no stock, don't bring them in, high $ RRP amd 6-8 weeks lead time. Seems getting them from Digi-Key is the go. I will say my customer experience with Digi-Key was great - just the shipping cost!


attached is a screenshot of the notes I made for myself when I was recording the MP3 file re this topic
 

Attachments

SAborn

Senior Member
For anyone in Adelaide Aztronics sell little adaptor boards for around a $1.00 each.
If you drop them a email they will post items to you as well.
They also stock a lot of harder to find stuff too.
 

axeman22

Member
For anyone in Adelaide Aztronics sell little adaptor boards for around a $1.00 each.
If you drop them a email they will post items to you as well.
They also stock a lot of harder to find stuff too.
nice, another place to get stuff from in Oz. any pics of the part your mentioning? I notice all they have online is a text PDF
 

Dippy

Moderator
Axeman, very kind offer. Appreciated.
Sadly, the project (a micro-SD based datalogger) is defunct.
I got a couple from Dallas-Maxim and got it going, but not much point taking it any further when the lead times for quanitities was so poor. So, it went into the dusty black-hole known as the bin.:(
 

SAborn

Senior Member
Sorry no pics of the boards but they look like the green ones you posted in your project.

If you really need i can take a camera in and photo a couple of boards next time i go shopping.
I tend to make my own so i dont have any of theirs handy.

I only noticed them today while having a hunt around for other stuff and as you guys commented on having trouble finding adaptors thought i post the find.

Albeit they were a little low in stock of them but are great guys and will get stuff in fast for you if you ask......they are one of the last real electronic stores left that have a mass amount of stuff out the back, and always happy to help out where they can.

They dont have a pretty web site but just good old fashion service and realistic prices, and lots and lots of stuff.
 

axeman22

Member
Sorry no pics of the boards but they look like the green ones you posted in your project.

If you really need i can take a camera in and photo a couple of boards next time i go shopping.
I tend to make my own so i dont have any of theirs handy.

I only noticed them today while having a hunt around for other stuff and as you guys commented on having trouble finding adaptors thought i post the find.

Albeit they were a little low in stock of them but are great guys and will get stuff in fast for you if you ask......they are one of the last real electronic stores left that have a mass amount of stuff out the back, and always happy to help out where they can.

They dont have a pretty web site but just good old fashion service and realistic prices, and lots and lots of stuff.
if taking a piccy is easy enough that would be super. I will be going to Adelaide more in the coming months so I'll have to be sure to pop in! - thanks :)
 

axeman22

Member
!! I ordered a few DS3231's as samples and thought I was in for a treat! .. then I got this from the Aussie disty :)

On Thu, Jul 1, 2010 at 6:29 PM, *****, David <David.*****@*****.com> wrote:
Hello Ian,

Thank you for your interest in our Maxim products, we regret to inform you that your sample request has been denied, as we have been unable to identify you as a manufacturer. In those cases where customers would like to revisit a denied sample request, you may do so by sending an email to maxim.samples.anz@*****.com providing additional customer and project information and we will revisit the request.
well, that sucks :-(
 
Last edited by a moderator:

hippy

Ex-Staff (retired)
Hope you don't mind but I took the liberty of removing the third party email address.

This is a common situation with samples now, only being supplied to business customers or those with a demonstrable potential commercial payback in future. Some companies probably feel their generosity in providing samples is being abused by people who simply don't want to pay for their products.
 

Dippy

Moderator
No free samples. Oh dear.

In fairness, distributors and manufacturers are NOT charities. They will, quite sensibley, only dish out freebies if they see potential further sales.
Wouldn't you?

So, why not buy some? :eek:
I must go to Tescos and get some free samples of Oven Chips.:rolleyes:

As an aside..
I have noticed over the years that Manufacturers are making it more difficult to get samples.
And over a similar period I have noticed the growing glee of hobbyists on how they've blagged some freebies.
Until recently when things are changing... how awful.

Why not just get freebies off Maxim. Jut lie through your teeth and say you have a production run of 1000000 this year.
 

axeman22

Member
No free samples. Oh dear.

In fairness, distributors and manufacturers are NOT charities. They will, quite sensibley, only dish out freebies if they see potential further sales.
Wouldn't you?

So, why not buy some? :eek:
I must go to Tescos and get some free samples of Oven Chips.:rolleyes:

As an aside..
I have noticed over the years that Manufacturers are making it more difficult to get samples.
And over a similar period I have noticed the growing glee of hobbyists on how they've blagged some freebies.
Until recently when things are changing... how awful.

Why not just get freebies off Maxim. Jut lie through your teeth and say you have a production run of 1000000 this year.
well Dippy, you made me laugh - actually, I am quite happy to buy some, as I already have - I purchase 2 x DS3232 a while back, have the unused one sitting no more than 8 inches from me as I type :) (the accuracy helps me drift off to sleep at night LOL)

next time I need more I will go for the DS3231 as the SRAM isn't needed. I actually did for some time find the sheer range of DS RTC's overwhelming.. but I think I have a handle on it now!

I still reckon Vendors are mad(and I work for one!) by not giving free samples to techies.. cost them bugger all and you get people talking about the product etc - all goodness.. but, what would I know :)
 

Dippy

Moderator
I was really on about the average tight-fisted hobbyist or schoolboy on the scrounge. Yes, you at the back there, you KNOW who you are ;)

I rarely get samples from Distributors but I have noticed an increased number of hurdles when ordering from Manufs. Sometimes you have to develop a bit of a relationship (buying or discussing) to get your bits.
Anyway, go for it, good luck.
 

slimplynth

Senior Member
Please can someone at rev-ed give me a 1 off sample for each of the following (provided the codes to assist you):

i) PNS - NET 001
ii) Voice synth. - SPE030
iii) 21 Ch Servo Driver - AXE030

Much obliged, I look forward to my delivery.

:)
 

BeanieBots

Moderator
Phone the supplier.
Discuss your requirements.
Get them to suggest a suitable device.
Ask them to send you one.

You'll be lucky with the SPE030.
No longer manufactured, harder to find than rocking horse droppings.
 

Dippy

Moderator
Just connect Stephen Hawking to your project board.

Would he be taken as seriously if I changed his voice chip to emulate Julian Clary?
 

andyshrimpton

New Member
help with connection between ds1307 and 28x2 pixace

I am just about to connect a ds1307 RTC to a picaxe 28x2 chip, in the pdf file in post one shows a typical connection to a cpu (i assume a picaxe chip), what are the 3no. resistors doing and how to you size them.

I have recent blown up a 28moudle so would not like to make another error.

Also do i assume that the RTC is prgrammed through the picaxe chip? using the code in the same pdf file.

thanks in advance
 

hippy

Ex-Staff (retired)
For most I2C devices there will be two pull-ups to +V on the SDA and SCL lines. Commonly 4K7 is recommended for +5V operation so it is best to start with those.

The third R for DS1307 is for pulling up the SQWOUT open-collector output. If not using that output, just ignore it, leave it floating. If wanting to drive a LED from the pin I'd suggest starting with a LED plus 1K from +V to SQWOUT.
 

axeman22

Member
here is some code.. it's a subset of a larger program I had. Give it a whirl.. if it doesn't work post here and I'll breadboard it up and check the code.

init:
symbol seconds = b0
symbol mins = b1
symbol hour = b2
symbol day = b3
symbol date = b4
symbol month = b5
symbol year = b6
symbol control = b7

i2cslave %11010000, i2cslow, i2cbyte

`gosub SETCLOCK
`This would set the clock on startup...

~================================
main:

gosub READCLOCK

goto main
~================================

READCLOCK:
readi2c 0,(b0,b1,b2,b3,b4,b5,b6,b7)
debug b0 ` this slow things down but you can see the time on the debug output.
RETURN

SETCLOCK:
let seconds = $00
let mins = $05
let hour = $22
let day = $06
let date = $10
let month = $04
let year = $10
let control = %00010000 ' Enable output at 1Hz
writei2c 0,(seconds,mins,hour,day,date,month,year,control)
RETURN
 

andyshrimpton

New Member
Ds1307 working

Thanks Gents for the help

I have my first DS1307 chip working. I am now going to intergate it into my main code, which will will give me better results than using the "pause" command as i have many "if....and....If...then......" statment lines which effect the length of my loops and effect the timing over a few hours.

I now hope to use the 1HZ pin the over come these issue.

One question what is the Date=$10 doing, i cant work it out, having a dumb moment

i feel that another door has been opened here and the light is flooding it :)


Andy
 
Last edited:

hippy

Ex-Staff (retired)
The $10 is most likely a BCD representation of the decimal value 10. The leftmost four bits hold the tens value, the rightmost four bits hold the units value. The DS1307 uses BCD data represntations. A Forum search will reveal more
 

axeman22

Member
Thanks Gents for the help

I have my first DS1307 chip working. I am now going to intergate it into my main code, which will will give me better results than using the "pause" command as i have many "if....and....If...then......" statment lines which effect the length of my loops and effect the timing over a few hours.

I now hope to use the 1HZ pin the over come these issue.

One question what is the Date=$10 doing, i cant work it out, having a dumb moment

i feel that another door has been opened here and the light is flooding it :)


Andy
I have been playing with DS3232 and DS1307 - this code may have been from the DS3232 which has some interesting memory addresses.

the LET statements are all just defining variables which I then stuff into the RTC to set the clock.

if you want me to post working code for a DS1307, just ask, I'll make up a CCT, grab some code and post it :) .. at the moment I have a DS3232 on the breadboard
 

axeman22

Member
One question what is the Date=$10 doing, i cant work it out, having a dumb moment
$10 is the tenth day of the month. :)

here's a great visual on BCD - Binary Coded Decimal

I was playing around at 22:05:00 10th April 2010 - Saturday, with me considering Monday to be the first day of the week.

SETCLOCK:
let seconds = $00 --> second 00
let mins = $05 --> Minute 05
let hour = $22 --> Hour 22, with bit 6 set to 0 meaning 24 hour mode.
let day = $06 --> 6th Day of the Week. I consider Monday as day 1.
let date = $10 --> 10th Day of the month.
let month = $04 --> April
let year = $10 --> 2010
 

andyshrimpton

New Member
Set the ds1307 RTC

Thanks Axeman

This is the code i used to set up my ds1307 chip.


i2cslave %11010000, i2cslow, i2cbyte

SETCLOCK:
let seconds = $50 ' 00 Note all BCD format
let mins = $59 ' 59 Note all BCD format
let hour = $12 ' 12 Note all BCD format
let day = $01 ' 01 Note all BCD format
let date = $28 ' 01 Note all BCD format
let month = $04 ' 04 Note all BCD format
let year = $09 ' 09 Note all BCD format
let control = %01110000 ' Enable output at 1Hz %01110000 bit 1&2 sets frequancy to 1Hz

writei2c 0 (seconds,mins,hour,day,date,month,year,control)
return

I works in 24 hour mode which i require but i cant see what controls it to be in that mode.

NOW THE PENNY HAS DROPPED. I see what i have done wrong. User Error as normal

When playing the the "let control" data line the %01110000 which is used to set up the DS1307 the first BIT on the right is BIT0 not BIT1, so i have been changing the wrong bit all the time.

Its easy when you open your eyes and read correctly what is in front of you!!!
 

Peter Graat

New Member
I also used de DS3232N for a RTC. It is on the same I2C-bus as an 24LC512 EEPROM. I programmed the correct time almost 1 year ago. It's now off for some 15 seconds, it's incredible. With a steady hand I soldered the SO20 chip of the DS3232 and the SO16 chip of the DS3231 to a 8pin IC-socket. I could also include a 100nF capacitor in the socket. See attached pictures.

DS3232-1.jpgDS3231 & DS3232.jpg
 
Top