Shop OBEX P1 Docs P2 Docs Learn Events
$1.65 Real Time Clock- I2C — Parallax Forums

$1.65 Real Time Clock- I2C

ercoerco Posts: 20,256
edited 2014-01-15 16:51 in General Discussion
http://www.ebay.com/itm/I2C-RTC-DS1307-AT24C32-Real-Time-Clock-Module-for-Arduino-Uno-AVR-ARM-PIC-/200834465268 Free shipping.

That's an ... I2C RTC for 165c

(cents)

Cheapest I've seen. Unless Amanda, Rick, Mike or Duane can do better... Let the games begin!

Even a classic BS2 can do I2C... http://forums.parallax.com/showthread.php/82908-I2C-On-A-BASIC-Stamp
«1

Comments

  • Mike CookMike Cook Posts: 829
    edited 2013-10-28 13:52
    If your using these with the propeller on the propellers built in I2C, you need to disable the AT24C32.
    At least I had to. I tried changing the address of the EEPROM but ended up completely removing the EEPROM from the clock board.


    Still a fantastic price for a ‘built up ‘ board.

    I paid about twice that a few months ago for these.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-10-28 14:16
    How is this possible? You can't even buy the chip for that price at Digi-Key even if you order 500 at once. It is cheaper to buy the bare chip if you purchase a couple of thousand at once.

    I just ordered two.

    I'm still waiting for a couple of DS3231 boards. I'm pretty sure the DS3231 is more accurate than the DS1307 though I suppose a lot depends on what crystal is used with the DS1307.
  • skylightskylight Posts: 1,915
    edited 2013-10-28 14:17
    Thanks erco just ordered 5 of them hope they arrive in good time
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-10-28 14:19
    Wow! That 165c WITH the battery!!!

    What a great way to add an RTC to a Raspberry Pi, too!

    all for 165c!!!

    This is very timely and it makes cents!!
  • ercoerco Posts: 20,256
    edited 2013-10-28 14:21
    Happy to assist. Just keep sending those dollars for my twins' college fund...!
  • Mike CookMike Cook Posts: 829
    edited 2013-10-28 14:22
    Duane Degn wrote: »
    How is this possible? You can't even buy the chip for that price at Digi-Key even if you order 500 at once. It is cheaper to buy the bare chip if you purchase a couple of thousand at once.

    I just ordered two.

    I'm still waiting for a couple of DS3231 boards. I'm pretty sure the DS3231 is more accurate than the DS1307 though I suppose a lot depends on what crystal is used with the DS1307.

    Here's some: http://www.ebay.com/itm/161113736351?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649

    N
    ot too bad at $4, $2 would be better! :smile:
  • ercoerco Posts: 20,256
    edited 2013-10-28 14:25
    A LIR2032 battery alone (plus shipping) costs more than this module, which includes the battery and free ship. Go figure.

    http://www.ebay.com/sch/i.html?_sacat=0&_from=R40&_sop=15&_nkw=LIR2032&LH_BIN=1
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-10-28 14:30
    Mike Cook wrote: »

    Sorry, I used the wrong link in my earlier post.

    These are the DS3231 boards I'm waiting for.

    $T2eC16NHJGIFFoTmFfWzBSDw5)QdM!~~60_12.JPG

    $5.62 is a higher price than the one you found but the boards I ordered include a battery (though it's soldered in place).
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2013-11-10 07:38
    I know I may be late on this, but if you need to have the batteries replaced, use only LIR2032 (rechargable CR2032). Putting a normal CR2032 inside would make it go ka-pop! which is probably hazardrous.

    Unfortunately, I ordered the one without the battery. And alas, I have to buy that LIR2032.

    One alternative is to remove the "charger circuitry" on the board if you insist on the regular CR2032.
  • jmgjmg Posts: 15,173
    edited 2013-11-10 14:40
    Mike Cook wrote: »
    If your using these with the propeller on the propellers built in I2C, you need to disable the AT24C32.
    At least I had to. I tried changing the address of the EEPROM but ended up completely removing the EEPROM from the clock board.

    The photo shows two SO8 - are you saying the second SO8, is a AT24C32 ?
  • ozarkshermitozarkshermit Posts: 14
    edited 2013-12-14 17:57
    I bought one of these shortly after the opening post - and am completely satisfied with it - so - I decided to buy two more. Unfortunately I must have bought them from a different vendor, because neither of them work - - The YEARS does not work. Same program, same hardware, as the original. (actually plugged them into the original circuit board that I made). When reading back years to display on a LCD, the data is meaningless. Everything else works as it should - Month, day of week, date of month, hrs, minutes, seconds. I contacted the seller, waiting for an answer. Here is who I just got the last two from :

    http://www.ebay.com/itm/400603657994?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

    Anyone else have a problem?

    I'll wait for a response from the vendor and follow up
    As I said, the first one I bought works like a champ
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-14 18:20
    What are you using to interface with the RTC? Did you set the time first?
  • ercoerco Posts: 20,256
    edited 2013-12-14 18:21
    Odd, it's the same seller. My two work as advertised, in a quick test, although I haven't rechecked long-term accuracy lately, that seems to be people's main concern. Dollars to doughnuts, the seller ships you two more free, no questions asked. No doubt a lot of the Ebay China stuff is cheap and possibly mfr seconds or out of spec, but I find the sellers are gold and I have yet to be stiffed by one. They will either refund or send a replacement, no questions asked.

    Edit: Duane types much faster than me! DOH!
  • ozarkshermitozarkshermit Posts: 14
    edited 2013-12-14 20:57
    Problem Solved - - Operator Error

    Somehow The byte I was writing to the years register became corrupted - - I gave the seller + feedback

    Ken
  • RS_JimRS_Jim Posts: 1,766
    edited 2013-12-15 05:16
    So, has anyone gotten working code? I found nothing in OBEX.
    Jim
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-15 08:15
    RS_Jim wrote: »
    So, has anyone gotten working code? I found nothing in OBEX.
    Jim

    I used Kye's demo. It works with both DS1307 and DS3231 boards.

    I've attached the demo I had on my hard drive. I'm not sure if it's in the OBEX.

    BTW, My DS3231 boards finally arrived. I think they took over a month. The seller repeatedly emailed me to see if they had arrived yet. I'm sure he would have sent new ones if I asked. I told him I wasn't in a rush and I could wait to see if the first boards turned up. They eventually did.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-01-11 03:42
    Anyone has DS3231 sample code for basic stamp?
  • RDL2004RDL2004 Posts: 2,554
    edited 2014-01-11 03:55
    It's been a while, but I think I was able to just use Jon's DS1307 code pretty much as is. At least, it made a good starting point.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-11 10:01
    I second Rick's suggestion. I used DS1307 code with my DS3231 on the Propeller. It seems to work fine.
  • RDL2004RDL2004 Posts: 2,554
    edited 2014-01-11 10:47
    Yeah, I meant to also say that I think it's pretty much the same chip. I haven't looked at the data sheets in a long time, but I believe the main difference is the on board oscillator/crystal which is factory adjusted. The usual reason for inaccuracy with the 1302/1307 is the difficulties getting the external crystal exactly right.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-01-11 21:17
    I have DS1307, but it does not works. When checking with scope, if DS1307 is working properly, should there be some pulses on crystal pins?
  • SapphireSapphire Posts: 496
    edited 2014-01-11 21:43
    Your scope will probably load the crystal down too much and stop oscillations. But you can "talk" to the DS1307 using I2C even without a crystal. The crystal is only used for timekeeping. Can you read a byte? If you can read and write but the time isn't advancing, you need to clear the CH bit. You can also write to the Control Register and enable the SQW output to verify the crystal is oscillating. This output is derived from the crystal.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-01-11 22:02
    I haven't tried that yet,. I've inspected both SCLK and SDA pins with scope. There's repeated pulses on SCLK, but nothing on SDA.
  • JLockeJLocke Posts: 354
    edited 2014-01-11 22:47
    IIRC, you must set the time on the chip before trying to read it. I think I tried several different DS1307 chips before I realized this.
  • SapphireSapphire Posts: 496
    edited 2014-01-11 22:52
    CuriousOne wrote: »
    I haven't tried that yet,. I've inspected both SCLK and SDA pins with scope. There's repeated pulses on SCLK, but nothing on SDA.

    Any pulses on SDA when you write data? If not, then something is wrong with your I2C bus.

    If you get pulses on writing but no ACK and none on reading, then the DS1307 chip may be bad. You are using 4.7k pullups, right?

    You can read without writing, but the clock won't start counting until you write to the seconds register to clear the CH bit.
  • SapphireSapphire Posts: 496
    edited 2014-01-11 22:57
    Oh, and you are using the correct I2C address? It should be $D0 for write and $D1 for read.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-01-12 03:04
    Will check code tomorrow, not have the hardware and code at hands today.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-01-13 00:46
    oscrop.jpg
    Decided to do "clean" test, so taken 23C32 chip and tried to run i2c.bsp from "basic stamp syntax and reference manual", getting this error when reading chip:

    Error at location: 0000
    Found: 255, Expected: 00

    If I remove the error check, all memory reads as 255. I've double checked wiring, everything is OK, pullups are 4.7k, and pulses present on both pins when checking with scope. Just manual says 24LC16 chip, and mine is 24C32, this can be a reason?
    1024 x 388 - 36K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-01-13 04:28
    Just my Two Cents... for what it is worth.

    You may find it a lot easier to use this to get a 'startup time setting' and to use an UTC time scheme internally on a Forth cog for your actual Propeller RTC. UTC is very easy to code as a stop watch, a timer, multiple alarms, a DOW of the week timer, a DOM timer, and so on. Everything is based on one 32birt number representing time in seconds. Linux uses this scheme for a file time stamp.

    You can spend an awful lot of mental effort trying to read and convert the RTC for each and every activity --- so consider using it just to set the clock whenever you have a power on, a power outage, or a reset.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-13 08:10
    CuriousOne, Do you have a Propeller board? If so, I'll post the code I used to test my DS3231.
Sign In or Register to comment.