Reply to topic  [ 82 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9  Next
Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU0011) 
Author Message

Joined: Thu Dec 25, 2014 6:14 pm
Posts: 2
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Hi,

I've just ordered and am now waiting for this RTC to arrive :-)

I'm very new to this so apologies if this is a silly question, but what is the difference between the P1 and P2 sets of pins?
If you only want to use the RTC features, which set of pins would you need to connect?
e.g. If I want to connect to Arduino UNO R3, is the following correct:

RTC P2 <---> Arduino UNO
GND <----> GND
VCC <----> +5V
SCL <----> A5
SDA <---> A4

Thanks in advance for any info/help with these questions :-)


Mon Mar 16, 2015 6:01 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Quote:
what is the difference between the P1 and P2 sets of pins?


Nothing, they are electrically connected together. The additional header is probably just there to make it convenient to daisy-chain other I2C devices on the same bus. The significant different is that one header has the addition of the SQ ant BAT pins.

Quote:
If I want to connect to Arduino UNO R3, is the following correct:


Yeah that looks fine to me.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Tue Mar 17, 2015 10:00 am
Profile

Joined: Thu Dec 25, 2014 6:14 pm
Posts: 2
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Thanks for the confirmation :-)


Tue Mar 17, 2015 10:45 am
Profile

Joined: Wed Aug 21, 2013 7:38 am
Posts: 49
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Hi,

I just opened up my HC RTC from May 2014, and had it working in minutes with a Micromite MkII with I2C.
The MMBasic is smart and knows the type of RTC connected, avoiding all of the frustrating (=Arduino headers, libraries, compiler) :cry: I2C setup.

The Micromite MkII is a home programmed (OS firmware, one-time-only using a PICkit3 or 3clone), open source, Microchip PIC32MX170 MIPS 32-bit CPU, 48 MHz, and 10uF MLCC Vcap, that is powered by a UART dongle at 3.3v maximum (use a 5v USB to 3.3 regulator if needed) and uses a console terminal at 38400 baud for self-generated editing, debugging and load/save to PC
See http://geoffg.net/micromite.html for details

I would recommend a Hobbycomponents Model HCMODU0051 Silicon Labs CP2102 3.3V USB to UART serial interface module adaptor to power and communicate. An extension USB cable may be required or HC dupont jumpers.

or

Model HCCABL0015 - USB to RS232 TTL Serial Interface Cable - but requires a 5v to 3.3v LDO regulator (I use MPC1700-330) and two filter capacitors to safely power the Micromite and peripherals, the cable however is a bonus.

This is all the code needed to set, read the DS1307 RTC and syncs the Micromite MkII to real-time every 12 hours.
The internal MMII Basic clock can drift +- 3 seconds per hour.

Code:
'this will set the RTC to 2015 July 24 14:01:02 PM and can be done from the command line prompt.
RTC SETTIME 15, 7, 24, 14, 01, 02


This will sync the internal pseudo RTC to the real RTC.
Code:
RTC GETTIME ' get and set the internal time at startup

SETTICK 12*3600*1000, SetTime, 4   ' interrupts set to 12 hours * 3600 seconds per hour * 1000 ticks per second

Do
   '< normal user program goes here>
   PAUSE 1000
   Print Date$, Time$  'to console UART Dongle to Teraterm or Putty
Loop

SetTime: ' interrupt called every 12 hours
RTC GETTIME ' reset the internal MM Basic time to RTC
IRETURN


Fri Jul 24, 2015 2:04 pm
Profile

Joined: Wed Feb 25, 2015 10:23 am
Posts: 3
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Hello,
I just ordered 3 pieces of this module.
I read that to read/write the time or to read/write to the eeprom I just need to connect the module to the I2C pins of the Arduino but I am wondering what the "DS" and "SQ" pins are used for. Can someone shed some light on this !
Thanks.


Wed Jul 29, 2015 7:01 pm
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
The DS1307 has a feature where you can output a square wave to a pin. Without referencing the datasheet I think this can at fixed frequencies of 1Hz, 4KHz, 8KHz, and 32KHz. You have to configure an internal register to do this but when configured correctly the square wave will appear on the SQ pin.

If you take a look at the pictures in the first post you'll notice there a 3 pads in the top left corner. These allow you to solder an optional DS1820 temperature sensor. If you do this the DS pin connects to its data out pin.

If you are only interested in the RTC and EEPROM features then the only pins you need to connect to your Arduino are as follows:

RTC.......Arduino(UNO)
GND.....GND
VCC......5V
SDA......A4
SCL.......A5


I'll update the first post to add these answers.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Jul 30, 2015 7:50 am
Profile

Joined: Wed Feb 25, 2015 10:23 am
Posts: 3
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Thank you for your reply.


Thu Jul 30, 2015 9:36 am
Profile

Joined: Mon Jun 13, 2016 11:11 am
Posts: 2
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Hi,

I need to change the analog pin on the arduino since I already have my lcd screen connected on A4 and A5.

How can i do that?

Thanks


Thu Jun 16, 2016 10:41 am
Profile
Site Admin

Joined: Sun Aug 05, 2012 4:15 pm
Posts: 697
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
The analogue pins A4 and A5 also double up as a hardware serial I2C interface which the RTC module and the library make use of. This hardware interface is fixed to these pins and so as a result you can't move it to a different set of pins. However, depending on your LCD, it is probably also using these pins as an I2C interface. As the I2C interface can support multiple salve devices being connected to it at the same time, if your LCD does have an I2C interface and doesn't use the same slave addresses as this module you should be able to connect them both to these pins.

Just check first to see if your LCD is an I2C slave device.

_________________
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.


Thu Jun 16, 2016 12:14 pm
Profile

Joined: Mon Jun 13, 2016 11:11 am
Posts: 2
Post Re: Tiny RTC DS1307 + 24C32 Real Time Clock Module (HCMODU00
Hi Andrew,

Wouaah you're right!!! it just works!!!!
Connected my Serial I2C LCD 1602 Module (HCARDU0023) (0x27) and my Real Time Clock module HCMODU0011 DS1307 on pin A4 and A5 together works like a charm !!!!

Many thanks!


Thu Jun 16, 2016 1:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 82 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Thank you to phpBB.com & phpBB.ro.
Design created by Florea Cosmin Ionut.
© 2011 All contents of this site are © Hobby Components LTD