Pages: [1] 2   Go Down
Author Topic: chronodot  (Read 4353 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a Chronodot RTC (version 2.1) and I'm trying to figure out how it's supposed to be wired up to my Arduino. I've been referring to this link: http://docs.macetech.com/doku.php/chronodot
There's an Arduino program on there, but it doesn't indicate anywhere in the program the pins on the Arduino to which I need to connect the wires. Anybody know? Thanks.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also, does anybody know anything about Arduino libraries made specifically for Chronodot?
Logged

Dubuque, Iowa, USA
Offline Offline
Edison Member
*
Karma: 33
Posts: 2280
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Macetech's example code uses the Wire library, and from the documentation:

On most Arduino boards, SDA (data line) is on analog input pin 4, and SCL (clock line) is on analog input pin 5. On the Arduino Mega, SDA is digital pin 20 and SCL is 21


..and that just leaves you with VCC and GND to hook up.

I'm not aware of any libraries for the DS3231.
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. I wired the SDA and SCL pins to A4 and A5, respectively, and I wired the VCC and GND pins to power and ground on my breadboard, respectively. I uploaded their example program and opened the serial monitor, but I'm not getting any data. Do you have any idea what the problem could be? Do I need to wire any of the other pins on the Chronodot?
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Double check you are using the analog pins and not digital 4 and 5.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

My wires were connected to the correct pins.
Logged

0
Offline Offline
Edison Member
*
Karma: 7
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm not aware of any libraries for the DS3231.
Here is one:
http://hacks.ayars.org/2011/04/ds3231-real-time-clock.html
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 446
Posts: 23871
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need pullup resistors on the A4/A5 lines also (like 10K) if the chronodot does not include them:

"The SDA and SCL pins are used to communicate with the ChronoDot, using the I2C standard interface. The I2C bus requires pullup resistors from SDA and SCL to VCC. Since many devices that have I2C buses already have the resistors in place, these are not provided with the ChronoDot. But there are two locations for 4.7K or 10K resistors to be soldered, in case your controlling device does not have its own pullup resistors. "
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, I tried using 10K resistors. I simply connected one leed on each resistor to the VCC rail of my breadboard and the other leeds to the SDA and SCL pins. No results. Do I actually need to solder the resistors onto the Chronodot board?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 332
Posts: 16568
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do I actually need to solder the resistors onto the Chronodot board?

No, that is not a requirement. Here is a useful I2C troubleshooting sketch. It scans all possible legal I2C addresses and tells you if there is a response from any address. After uploading, just open the serial monitor and set to 38400 baudrate, then press the reset button on the board and see if your Chronodot is answering the inquirey.

Code:
/**
 * I2CScanner.pde -- I2C bus scanner for Arduino
 *
 * 2009, Tod E. Kurt, http://todbot.com/blog/
 *
 */

#include "Wire.h"
extern "C" {
#include "utility/twi.h"  // from Wire library, so we can do bus scanning
}

// Scan the I2C bus between addresses from_addr and to_addr.
// On each address, call the callback function with the address and result.
// If result==0, address was found, otherwise, address wasn't found
// (can use result to potentially get other status on the I2C bus, see twi.c)
// Assumes Wire.begin() has already been called
void scanI2CBus(byte from_addr, byte to_addr,
                void(*callback)(byte address, byte result) )
{
  byte rc;
  byte data = 0; // not used, just an address to feed to twi_writeTo()
  for( byte addr = from_addr; addr <= to_addr; addr++ ) {
    rc = twi_writeTo(addr, &data, 0, 1);
    callback( addr, rc );
  }
}

// Called when address is found in scanI2CBus()
// Feel free to change this as needed
// (like adding I2C comm code to figure out what kind of I2C device is there)
void scanFunc( byte addr, byte result ) {
  Serial.print("addr: ");
  Serial.print(addr,HEX);
  Serial.print( (result==0) ? " found!":"       ");
  Serial.print( (addr%4) ? "\t":"\n");
}


byte start_address = 1;
byte end_address = 127;

// standard Arduino setup()
void setup()
{
    delay(2000);
    Wire.begin();
    Serial.begin(38400);
    Serial.println("\nI2CScanner ready!");

    Serial.print("starting scanning of I2C bus from ");
    Serial.print(start_address,HEX);
    Serial.print(" to ");
    Serial.print(end_address,HEX);
    Serial.println("...Hex");

    // start the scan, will call "scanFunc()" on result from each address
    scanI2CBus( start_address, end_address, scanFunc );

    Serial.println("\ndone");
}

// standard Arduino loop()
void loop()
{
    // Nothing to do here, so we'll just blink the built-in LED
    digitalWrite(13,HIGH);
    delay(300);
    digitalWrite(13,LOW);
    delay(300);
}


Lefty
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks retrolefty. Here's what I got…I'm attaching a screencap to this message.

I'm also attaching a picture of what I have wired up; maybe you guys can tell me if I got anything blatantly incorrect?
Also, there are two places that say R1 and R2 as you can see here in this image: http://www.adafruit.com/images/medium/ChronoDotV2_MED.jpg do I need to solder 10K resistors into those holes?


* Photo on 2011-09-08 at 02.22 copy.jpg (95.63 KB, 640x480 - viewed 145 times.)

* Screen shot 2011-09-08 at 2.34.08 AM.tiff (1029.25 KB, 574x608 - viewed 169 times.)
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 332
Posts: 16568
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, the problem is how you are mounting the chronodot to your breadboard, you are shorting all the pins together on each side of the dot, and not actually wiring anything to any of the dot pins. Breadboards holes are all wired together only on the 5 holes in a row. You need to rotate the chronodot 90 degrees and have it straddle the center section. Does that make sense? You maybe could use a ohm meter to get a better idea of how the breadboard holes are arranged and used?

Lefty
« Last Edit: September 08, 2011, 02:00:52 am by retrolefty » Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks so much! I feel so derpy for not realizing that. It works now.

However, I'm confused by the data that it's spitting out. I posted a screencap. Shouldn't it be getting the exact time?


* Screen shot 2011-09-08 at 1.09.52 PM.tiff (1027.37 KB, 572x609 - viewed 169 times.)
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 446
Posts: 23871
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to tell it what time it is to start. After that, assuming you have battery backup as well, it will have the correct time.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Full Member
***
Karma: 0
Posts: 157
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I do that? I tried using the script and library I found on this site, but to no avail: http://www.radekw.com/blog/2011/01/09/connecting-chronodot-and-setting-the-time/
Logged

Pages: [1] 2   Go Up
Jump to: