Adafruit 264 ( DS1307 ) and Arduino Mega

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
joanba
 
Posts: 27
Joined: Tue Oct 30, 2012 6:57 am

Adafruit 264 ( DS1307 ) and Arduino Mega

Post by joanba »

Hi,

I want to use the breakout kit 264 ( RTC clock based on chip DS1307 ) with an Arduino Mega. The needed pins from the DS1307 circuit are, in this order: GND, 5V, SDA and SCL ( SQW not used ). In Arduino Mega, SDA pin is 20 and SCL pin is 21. But in order to put the DS1307 circuit attached to the Mega without any addidtional cabling, I need to know if its possible to do the following:

Arduino <--> Adafruit 264
18 TX1 <--> GND (?)
19 RX1 <--> 5V (?)
20 SDA <--> SDA (OK)
21 SCL <--> SCL (OK)

The question is if I can use Arduino pin TX1 (18) as a GND and pin RX1 (19) as a 5V with some code like this one:

Code: Select all

int wgnd = 18;
int w5v   = 19;

void setup() {                
  pinMode(wgnd, OUTPUT);  
  digitalWrite(wgnd, LOW);   
  pinMode(w5v, OUTPUT);  
  digitalWrite(w5v, HIGH);  
}
Is it correct at all ?

Regards,
Joan

joanba
 
Posts: 27
Joined: Tue Oct 30, 2012 6:57 am

Re: Adafruit 264 ( DS1307 ) and Arduino Mega

Post by joanba »

Hi,

It works !! I've tested it and it is fine. Anyway if somebody could give me some advice it will be very grateful.

Regards,
Joan

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit 264 ( DS1307 ) and Arduino Mega

Post by adafruit_support_bill »

Yes, that is a reasonable way to do it. The DS1307 does not require a lot of current, so it is OK to power it directly from GPIO pins.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”