Go Down

Topic: How to: wire the DS1337 RTC? (Read 9707 times) previous topic - next topic

madepablo

I found a problem at D1337 library. This is the first error returned by Arduino IDE during complilation process:

Code: [Select]
C:\Archivos de programa\arduino-0017\hardware\libraries\DS1337\/DS1337.h:251: error: expected unqualified-id before 'void'

Code: [Select]
volatile static voidFuncPtr DS1337callbackFunc[3];
what is the line 251.

I tried including previously this line:
Code: [Select]
typedef void (*voidFuncPtr)(void);

but it neither work, producing the same error....

Any idea?

madepablo

#16
Aug 30, 2010, 01:08 am Last Edit: Aug 30, 2010, 01:09 am by madepablo Reason: 1
Here i posted the DS1337 RTC wiring diagram that i use:
http://fritzing.org/projects/ds1337/

Due to the limitations in components in frizting, take into account:
* the 555 is in really our DS1337
* the crystal must be a 32.728 kHz
* the resistances are 10kOhms
* the capacitor is a 0.1 uF

I don´t use the INTB/SQW out, but i draw its connection just in case it could be useful to you.

If you just want to setup the clock and get the time and date, you could use the DS1307 library from this from. But if you want to use the alarms, you need any of the DS1337 libraries presented in this forum and also here in this post.

For the moment i have a lot of problems to have the alarms working, but this is another story.

mpeuser

Quote
limitations in components in frizting

No, you can easily change that all...

madepablo

Thanks deSilva!

yes, you are right!. I know that everybody can develop their own componentes. But for the moment, this is the first time that i use Fritzing, and at present day there is not that component on the default library. In the future, if i learn how to do it, and i have time, i will try to develop and share it.

Thanks again for your comment!

mcbain

is the INTB/SQW for the alarm?
if i want to skip it, what pins do i not use then?

madepablo

#20
Sep 06, 2010, 11:02 pm Last Edit: Sep 06, 2010, 11:05 pm by madepablo Reason: 1
It is for the square wave out, what could be also used for alarm, but also for other things (such as for move a real-physical clock). But for the moment i have the alarms near to be working, and i don´t use the INTB/SQW (the libraries that i found there don´t use it).

I use: Vcc (3V3 OR 5V both works for me, but i prefer to use 3V3), GND, INTA (Digital pin 2 OR Digital pin 3, is up to you), SDA (analog pin 4), SCL (Analog Pin 5).

cheers,

mcbain

Hi and thank you for fast reply  ;)

but another question:

why do you use the analog pins on the RTC?
SDA and SCL

i thought this chip was all digital :)

madepablo

#22
Sep 07, 2010, 04:17 pm Last Edit: Sep 07, 2010, 04:50 pm by madepablo Reason: 1
Uhmm good question. I am so noob on electronics, but i think that this is because the serial communication between ds1337 an arduino. Many other devices uses serial comunications by this way. Other communication way is the SPI through the 10 to 13 digital pins in arduino. But this device (as far as i know) don´t have this type of communications.

BUT, i used it because i readed that it must be in that way. I don´t know if other type of communucations are possible for this device, sorry  :-[
[edit]Sorry, i mean analog pins 4 and 5 are for I2C communications, what (as far as i know) it the communication way for this sensor...[/edit]

madepablo

#23
Nov 14, 2010, 12:06 am Last Edit: Nov 14, 2010, 12:23 am by madepablo Reason: 1
I used the DS1337 following this circuit:
http://fritzing.org/projects/ds1337/

The battery used to power the ds1337 is a 3V coin-cell (not the AA cells showed in the diagram), what should remain for more than one year. However, the coin cell is already dry after about one month.

I think that the diode between the coin-cell and the ds1337 consume a lot of power, also when the RTC is connected to the arduino board.

I am not sure if i could remove this diode... may be it could be dangerous, burning the coin-cell when it is connected to the arduino board 3V3 pin... or not? Do you recommend to me to use a rechargeable 3V coin cell?

Any idea about how could i solve this problem?
Thanks a lot!!

Go Up